From patchwork Wed Jan 25 08:43:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikram Garhwal X-Patchwork-Id: 13115283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 70116C54E94 for ; Wed, 25 Jan 2023 08:46:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.483894.750305 (Exim 4.92) (envelope-from ) id 1pKbPw-00012j-Bk; Wed, 25 Jan 2023 08:46:04 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 483894.750305; Wed, 25 Jan 2023 08:46:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pKbPw-00011s-80; Wed, 25 Jan 2023 08:46:04 +0000 Received: by outflank-mailman (input) for mailman id 483894; Wed, 25 Jan 2023 08:46:03 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pKbPv-0000gj-Jv for xen-devel@lists.xenproject.org; Wed, 25 Jan 2023 08:46:03 +0000 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on20619.outbound.protection.outlook.com [2a01:111:f400:7eaa::619]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 970f5534-9c8c-11ed-b8d1-410ff93cb8f0; Wed, 25 Jan 2023 09:45:17 +0100 (CET) Received: from DS7PR05CA0092.namprd05.prod.outlook.com (2603:10b6:8:56::10) by SA3PR12MB7877.namprd12.prod.outlook.com (2603:10b6:806:31b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Wed, 25 Jan 2023 08:44:35 +0000 Received: from DM6NAM11FT021.eop-nam11.prod.protection.outlook.com (2603:10b6:8:56:cafe::e3) by DS7PR05CA0092.outlook.office365.com (2603:10b6:8:56::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.21 via Frontend Transport; Wed, 25 Jan 2023 08:44:34 +0000 Received: from SATLEXMB04.amd.com (165.204.84.17) by DM6NAM11FT021.mail.protection.outlook.com (10.13.173.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6023.16 via Frontend Transport; Wed, 25 Jan 2023 08:44:34 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Wed, 25 Jan 2023 02:44:33 -0600 Received: from xsjfnuv50.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Wed, 25 Jan 2023 02:44:23 -0600 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 970f5534-9c8c-11ed-b8d1-410ff93cb8f0 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G29PBh7Q//H4VRO1nigiPDvX3sAA1yAaKLmXvbI7Co9W1bRWbKh+Cec6MjztCuIWvuhHzcf59hNLWI2PwCJ0oKFS9nYPdSWi9/jcyAJ+Jff3b56VcmInAFObCTIlV7MgztF6ull7RR9/xLcctF7AMohAkFvs9QO+YiKNe50FCx61RSFCqs+Mg0Pow9WPRTFhRCPEVUIf1ZuG+7zzYYOk3f2zbSZlLZrEZBLy0mtbQMg3kKmRf6YGN6OECcXo8tDfmSGh+Lf4ouVKBYKxasGUz7H6OHMJcYvT7QAM7OGomSHFDSG2tvUNY8vvlwKpwhayY7obyTqnPrxn4FSmp8Yw8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=z7qBBSFtT16dKo24xhhVW2fFUFVUWqNupyxQmZ/Rxf8=; b=eLOp4Hs/DeOsIJjTESCYLUSu8gCKJYEzVnXLdOmQxHHPJpA+iN1YI9J9/6d8F0Y1xPN866lNOmx44lXyzfhmP//g8LCzBPGVxamImFKBz+dqo/c0OROWSwnHWQl382LQfSph/BYZ4NYHfb0bpsVL4qlTYNDuNBi1qHTV/qwj0o0XWU3XbjVDNCJyD/SadkzqBzlEjpdMe/COKapnpZNaph51UFIUFpzwfWobSEq879FO6IQcm53yeF0rN3pqTBqqFfYfC8upj95Okct0MToopdI6vli1JA1MUzrcsW9w0r9MFvXYguW7a2k74XUrA/IJaBeoyuaaE7EdLQ7Lg0jqJQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=nongnu.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z7qBBSFtT16dKo24xhhVW2fFUFVUWqNupyxQmZ/Rxf8=; b=CelUXT+ym5KFe2kLYH40QX4Hi47zAVtLuKj2vXVGu3jeLuZkCIr6LWuzv/krv/+2jDaL2yfbztmJrl6npBcY54mtXYAR/2d+YhnJGWpVNvWnSsKwP7s+9s/7FZKkU3tIM5RBlLX2p8pKCANBLl/J6LKqoEmnBq8han/1lDnNwOs= X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C From: Vikram Garhwal To: CC: , , , , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , Stefano Stabellini , Anthony Perard , "Paul Durrant" Subject: [QEMU][PATCH v3 01/10] hw/i386/xen/: move xen-mapcache.c to hw/xen/ Date: Wed, 25 Jan 2023 00:43:46 -0800 Message-ID: <20230125084356.6684-2-vikram.garhwal@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230125084356.6684-1-vikram.garhwal@amd.com> References: <20230125084356.6684-1-vikram.garhwal@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT021:EE_|SA3PR12MB7877:EE_ X-MS-Office365-Filtering-Correlation-Id: 143b188b-9fee-43fa-77b7-08dafeb06280 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IezT27L6yStktY1CqCs1KqhaXS6gIJXqUBISPyav23MuWr43mQu+evXfv5PbmF+Zrrp20WkyaI2ukrfKRmVwdLjk0lftg88EV7W6vqsUsoNUuU7T1MTYB+w/oaQNVugDJXv6aP4navVEpiQEh1+BkUJALUEqsrzbpbgHBImtsWyewlcNynR2plHUuxq3IsE9dvxSVYk7HzGyqZbaRA0WcOWLAcx2ibzl/vA4G4hX72McW841u3dlTYvzpjd3inOUE8cPWEtDKP3V5wGstkotGewzHFiCGg5yj5b3tMpumye8sleypu7vU+90G9xY06wDKZBFMXQLxz6M4dwe3lWpe452g97PJBcm/oNF4jO46BPYk1TGUfpgOrB2kWijC4zUkgCriXvzmLIJ2JwSj3cz7598/frfUkDDmX2PA1QQN5dOERj9SAx7ew4S5ACC4Cgkbl6dco2sTp8231jeW8Us7wWLIGi0EhfBKaK9nf0wJv+2SlC/ULkZJPo8H8ZyhDH3RRkNFw0iR8o09FM7tmIwgRfxEUFZiZCoDPXxjwJdxRubAOgFUGdpTpJW26/fllP4jhPNE81LujiuASnwHM+vUwC0ZXJujJr0E2zHyg+t8Knlk/bHMcWXtLCVOJQyufBRPPIO5B9cBbcN/AfBNjXyAPbJ1xi84Nn7RfwZfKjxXfezHD8IurI0Par/RRBSHWYFSrHhYu2+ujtqnVrPKROBUXDDenFXpGombBKFCuGxqgA= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230025)(4636009)(376002)(346002)(396003)(136003)(39860400002)(451199018)(40470700004)(46966006)(36840700001)(83380400001)(41300700001)(36860700001)(426003)(1076003)(6666004)(6916009)(478600001)(70206006)(86362001)(70586007)(2616005)(36756003)(54906003)(336012)(82310400005)(356005)(44832011)(5660300002)(47076005)(82740400003)(81166007)(2906002)(316002)(40460700003)(40480700001)(26005)(8676002)(186003)(4326008)(7416002)(8936002)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2023 08:44:34.5850 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 143b188b-9fee-43fa-77b7-08dafeb06280 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT021.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7877 xen-mapcache.c contains common functions which can be used for enabling Xen on aarch64 with IOREQ handling. Moving it out from hw/i386/xen to hw/xen to make it accessible for both aarch64 and x86. Signed-off-by: Vikram Garhwal Signed-off-by: Stefano Stabellini --- hw/i386/meson.build | 1 + hw/i386/xen/meson.build | 1 - hw/i386/xen/trace-events | 5 ----- hw/xen/meson.build | 4 ++++ hw/xen/trace-events | 5 +++++ hw/{i386 => }/xen/xen-mapcache.c | 0 6 files changed, 10 insertions(+), 6 deletions(-) rename hw/{i386 => }/xen/xen-mapcache.c (100%) diff --git a/hw/i386/meson.build b/hw/i386/meson.build index 213e2e82b3..cfdbfdcbcb 100644 --- a/hw/i386/meson.build +++ b/hw/i386/meson.build @@ -33,5 +33,6 @@ subdir('kvm') subdir('xen') i386_ss.add_all(xenpv_ss) +i386_ss.add_all(xen_ss) hw_arch += {'i386': i386_ss} diff --git a/hw/i386/xen/meson.build b/hw/i386/xen/meson.build index be84130300..2fcc46e6ca 100644 --- a/hw/i386/xen/meson.build +++ b/hw/i386/xen/meson.build @@ -1,6 +1,5 @@ i386_ss.add(when: 'CONFIG_XEN', if_true: files( 'xen-hvm.c', - 'xen-mapcache.c', 'xen_apic.c', 'xen_platform.c', 'xen_pvdevice.c', diff --git a/hw/i386/xen/trace-events b/hw/i386/xen/trace-events index 5d6be61090..a0c89d91c4 100644 --- a/hw/i386/xen/trace-events +++ b/hw/i386/xen/trace-events @@ -21,8 +21,3 @@ xen_map_resource_ioreq(uint32_t id, void *addr) "id: %u addr: %p" cpu_ioreq_config_read(void *req, uint32_t sbdf, uint32_t reg, uint32_t size, uint32_t data) "I/O=%p sbdf=0x%x reg=%u size=%u data=0x%x" cpu_ioreq_config_write(void *req, uint32_t sbdf, uint32_t reg, uint32_t size, uint32_t data) "I/O=%p sbdf=0x%x reg=%u size=%u data=0x%x" -# xen-mapcache.c -xen_map_cache(uint64_t phys_addr) "want 0x%"PRIx64 -xen_remap_bucket(uint64_t index) "index 0x%"PRIx64 -xen_map_cache_return(void* ptr) "%p" - diff --git a/hw/xen/meson.build b/hw/xen/meson.build index ae0ace3046..19d0637c46 100644 --- a/hw/xen/meson.build +++ b/hw/xen/meson.build @@ -22,3 +22,7 @@ else endif specific_ss.add_all(when: ['CONFIG_XEN', xen], if_true: xen_specific_ss) + +xen_ss = ss.source_set() + +xen_ss.add(when: 'CONFIG_XEN', if_true: files('xen-mapcache.c')) diff --git a/hw/xen/trace-events b/hw/xen/trace-events index 3da3fd8348..2c8f238f42 100644 --- a/hw/xen/trace-events +++ b/hw/xen/trace-events @@ -41,3 +41,8 @@ xs_node_vprintf(char *path, char *value) "%s %s" xs_node_vscanf(char *path, char *value) "%s %s" xs_node_watch(char *path) "%s" xs_node_unwatch(char *path) "%s" + +# xen-mapcache.c +xen_map_cache(uint64_t phys_addr) "want 0x%"PRIx64 +xen_remap_bucket(uint64_t index) "index 0x%"PRIx64 +xen_map_cache_return(void* ptr) "%p" diff --git a/hw/i386/xen/xen-mapcache.c b/hw/xen/xen-mapcache.c similarity index 100% rename from hw/i386/xen/xen-mapcache.c rename to hw/xen/xen-mapcache.c