From patchwork Tue Jan 31 22:51:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vikram Garhwal X-Patchwork-Id: 13123514 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.gnu.org (lists.gnu.org [209.51.188.17]) (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 903EDC636D4 for ; Tue, 31 Jan 2023 22:53:19 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMzUC-0002Dk-Ff; Tue, 31 Jan 2023 17:52:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMzU8-0002Db-OF for qemu-devel@nongnu.org; Tue, 31 Jan 2023 17:52:16 -0500 Received: from mail-co1nam11on20610.outbound.protection.outlook.com ([2a01:111:f400:7eab::610] helo=NAM11-CO1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMzU6-0002dZ-8F for qemu-devel@nongnu.org; Tue, 31 Jan 2023 17:52:16 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GC630tdiylspJQ4CZzRXUIhUCIIjHuaqddW8vav2zZ7hSknTPzIqO0wB90QAIad3ejhmf21n1UItVMVh51Ui+Zqh/72X/9TbV4AYrjqOvtTWtDpPuPvagz+u8Bpf8wXCB4NVvvPEQ4nV1uT5uCy+heCkK2f1CzJ0M5o7dFhVtjDtAe48fCRnoSBh8I+eRP6GmdwtDkkdrk7Emdyk6XXgZTW7gblwH8gEyn4ek7z6mueixxozqIKojuXuLphMJfhyjMptrpLhfosmVjoMy2WVJO5RQ/N4OwJtrRcxlh4EYOQtsKUgcOMPLSYCm4lGnA8rb6iTfYcBF/z70UqK2ILkvA== 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=M3gQ32FuazLL/p1bb8hJYqGYblDgjbOQzTUPbz1jpF2kIpgHkfVXukZF50GAN8mLoAURC4mSy7H0tc8kQqu8VPbOdZkRM4PuTIFU8eC21hOs00FF7JZk/KLzUAKa7rAAVuzCtxhE2YqKVRIwX1rAJ6Mx82G3FM34VwWIoNo/5CyClztlT4UtJIIzvN+FT0sGWueDFZUbwg9s0hH821svWe9jKi6l0N6RbDkx0z3iXoVGfgbbcOoNhTqB+OQz442/iXIJyjVoL1o71wI/oKHV3jzm6TecqOzQvmq6/3cfG5b06UcOdFIcyrgPcNuZQidJiHuHgA2lZWTUfmK1fuPOTg== 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=b6mJgIk2FVkh3991xxSYYBweFi5PPhaqnw63j/avr9IVKf1R2a1Yfsky6STo7Id+KNaK/igYs3/0C6J8k8Y7J4RT9tYNMPAuRnFKrGJ/mX4dPBM+/nQXP6xRTBzMazIXWJx0slUJjt+I/pEFQIvo/gJ3k6WAn6e5/mGO5aw88rg= Received: from MW4PR04CA0121.namprd04.prod.outlook.com (2603:10b6:303:84::6) by IA1PR12MB6626.namprd12.prod.outlook.com (2603:10b6:208:3a2::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Tue, 31 Jan 2023 22:52:09 +0000 Received: from CO1NAM11FT100.eop-nam11.prod.protection.outlook.com (2603:10b6:303:84:cafe::a1) by MW4PR04CA0121.outlook.office365.com (2603:10b6:303:84::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38 via Frontend Transport; Tue, 31 Jan 2023 22:52:09 +0000 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 Received: from SATLEXMB04.amd.com (165.204.84.17) by CO1NAM11FT100.mail.protection.outlook.com (10.13.175.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.22 via Frontend Transport; Tue, 31 Jan 2023 22:52:09 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) 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; Tue, 31 Jan 2023 16:52:07 -0600 Received: from SATLEXMB03.amd.com (10.181.40.144) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 31 Jan 2023 16:52:07 -0600 Received: from xsjfnuv50.xilinx.com (10.180.168.240) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server id 15.1.2375.34 via Frontend Transport; Tue, 31 Jan 2023 16:52:06 -0600 From: Vikram Garhwal To: CC: , , , , "Michael S. Tsirkin" , Marcel Apfelbaum , "Paolo Bonzini" , Richard Henderson , Eduardo Habkost , Stefano Stabellini , Anthony Perard , Paul Durrant Subject: [QEMU][PATCH v5 01/10] hw/i386/xen/: move xen-mapcache.c to hw/xen/ Date: Tue, 31 Jan 2023 14:51:40 -0800 Message-ID: <20230131225149.14764-2-vikram.garhwal@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230131225149.14764-1-vikram.garhwal@amd.com> References: <20230131225149.14764-1-vikram.garhwal@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT100:EE_|IA1PR12MB6626:EE_ X-MS-Office365-Filtering-Correlation-Id: da900d49-00e6-4d0b-d87e-08db03ddc8a2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sMTu4NTIVq6BnP/vfpJum4h8Whh8iXnSpPCSrTjTFrxJWJbH/aolzHISb/7YEwwIBlmt1bNnmTPvjsBu/kCZEYEteOjQS3cDggp3E1RsJH9fo++fYFxlIX1j9sXoRsUg9x4dAn/ixMiEMrbUzpjGIkE23ju2hO/XSlJP9DcWRvK3D1vh5/FcabaT3yly/gPeILAMQh6D4Pww9RLY/uY2vzOpoKWRhGDAWGrjoLc4TfkuyjWQg34C93kKh06pRsx6znY3bsbTu4kRsor3w2Qhj/k6JaiwiQWN6MEb8aLt3IsfNKaQBskG7JuypnHdbBXSBAzbG5TrZviHwJ7QBruqjQLGxVtmIkHXSyn8oX7ZHiT8OL/y/2Jh6fnQNK//flwNTny04woF2BhjPgDd45OUYUcS+IF2eZgSPJzaZxQixVs0s/ayjXylg/L1zEKeJm23jgTAsydg6IgbAZLotfnmdbhzImp8Do3KOF0meCzJNuYp106tWYBg3HsW+OrCNxdr4B12x9cEWDwktaUvIogpHbIufvidsSPkUfieq0fWNkZGOrmmkygppu+A9s/4vixsjxvSKxpog+1MQJu07rPI+L7mO6gtmKbTf1EfLI7qoTMbH6Cdv6g7thSnoCh2ejTqfEB6jDLq23v9BdCo9Y8ArpzBuSOoQGykQDTP3kTWi3GBP9PQZzrdg6+PlFijOxOenp4nmcM1meT0S+Mn3unyWi+dEsTmXLVeCW1VN6KNllA= 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)(346002)(39860400002)(396003)(376002)(136003)(451199018)(36840700001)(40470700004)(46966006)(8936002)(70206006)(316002)(70586007)(4326008)(8676002)(6916009)(5660300002)(7416002)(54906003)(44832011)(2906002)(1076003)(41300700001)(478600001)(186003)(6666004)(336012)(26005)(2616005)(356005)(36756003)(40460700003)(83380400001)(81166007)(47076005)(426003)(36860700001)(82310400005)(82740400003)(86362001)(40480700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2023 22:52:09.0265 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: da900d49-00e6-4d0b-d87e-08db03ddc8a2 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: CO1NAM11FT100.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6626 Received-SPF: softfail client-ip=2a01:111:f400:7eab::610; envelope-from=vikram.garhwal@amd.com; helo=NAM11-CO1-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org 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 Reviewed-by: Paul Durrant --- 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