From patchwork Mon Feb 17 10:18:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Teddy Astie X-Patchwork-Id: 13977471 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 00D79C021A7 for ; Mon, 17 Feb 2025 10:18:35 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.890007.1299077 (Exim 4.92) (envelope-from ) id 1tjyCq-000165-1M; Mon, 17 Feb 2025 10:18:28 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 890007.1299077; Mon, 17 Feb 2025 10:18:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tjyCp-00014y-KV; Mon, 17 Feb 2025 10:18:27 +0000 Received: by outflank-mailman (input) for mailman id 890007; Mon, 17 Feb 2025 10:18:26 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1tjyCo-0008Nl-8u for xen-devel@lists.xenproject.org; Mon, 17 Feb 2025 10:18:26 +0000 Received: from mail178-27.suw51.mandrillapp.com (mail178-27.suw51.mandrillapp.com [198.2.178.27]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 853ebf0b-ed18-11ef-9aa6-95dc52dad729; Mon, 17 Feb 2025 11:18:25 +0100 (CET) Received: from pmta13.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1]) by mail178-27.suw51.mandrillapp.com (Mailchimp) with ESMTP id 4YxJWy43Xhz6CPyQG for ; Mon, 17 Feb 2025 10:18:22 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id 83694620b59941faaa58546f2c7bf24c; Mon, 17 Feb 2025 10:18:22 +0000 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: 853ebf0b-ed18-11ef-9aa6-95dc52dad729 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1739787502; x=1740057502; bh=4U0gQ1LwmfSJjBNx+a/TBnpKULERm/cQUAt5K2wmoPM=; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=WHOegyZehYdUxq9ncTPTLcDG+LemZbXY3ePpQlwwB8qNFOcQfLtFZkhtuZ+qEKZa3 D1RzS1xoSgW44cHabMP6M93o2+zWPMWGKNpi4PyRsMJEsatJBhWTN0KnDPB4OpzH+K eafxDJvLsNmt5wyMtj/rtakJkVl57TgBEpo3Bj4xyg5vXOHKnaQZDglh+pBOPojjGt Wiru4nLcKO51RLYDn6O5Y1GzY4EsDOOPp0waVKHiuZiDjduf+xX9+qvOu1tx5WXrm2 Q9GagtHhRNHGHtz8ZmbSwrfXcUCFrV1YxF4wVnU8lcDBA3mJO3RIV3h/VfiGgPJd8g 0RKUOKF69ApbA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1739787502; x=1740048002; i=teddy.astie@vates.tech; bh=4U0gQ1LwmfSJjBNx+a/TBnpKULERm/cQUAt5K2wmoPM=; h=From:Subject:To:Cc:Message-Id:In-Reply-To:References:Feedback-ID: Date:MIME-Version:Content-Type:Content-Transfer-Encoding:CC:Date: Subject:From; b=qw3ThI/gyKATkVg6M3+CmClz8rrBmKerozE8KvgquMtkdN+gnf8NksoaRsSJttzLn HnnKYzCpMyFy4UerZ33DJRoYI/FQSZypbfREWpYbA2ZDd3S5PBOd3QEpBehBQtWjtt Q/6C6Cbs5x5LMZ23+6FaBjLWJDn3OF1ha5re2EJhGz2rRGCoQwbjvG1uxPMujKGQD0 KbdK/c6Lbhji3jVRy7BU9tAdSb7uT0Nq0YE7Gfa0X8aQFZrIpEoO1tzPU3D2bLD7RM 2C/XKHdYn+DY9CYsV1lE9R0vP5p5NpevBXgwLe6254U9i8qZs60QdSzNITn6njD67J TdmliTRamIFkQ== From: "Teddy Astie" Subject: =?utf-8?q?=5BXEN_RFC_PATCH_v6_03/11=5D_x86/domain=3A_Defer_domain_i?= =?utf-8?q?ommu_initialization=2E?= X-Mailer: git-send-email 2.47.2 X-Bm-Disclaimer: Yes X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1739787500080 To: xen-devel@lists.xenproject.org Cc: "Teddy Astie" , "Jan Beulich" , "Andrew Cooper" , " =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= " Message-Id: <03ef72e582221299e12c44176dbbe31ce5da9261.1739785339.git.teddy.astie@vates.tech> In-Reply-To: References: X-Native-Encoded: 1 X-Report-Abuse: =?utf-8?q?Please_forward_a_copy_of_this_message=2C_including?= =?utf-8?q?_all_headers=2C_to_abuse=40mandrill=2Ecom=2E_You_can_also_report_?= =?utf-8?q?abuse_here=3A_https=3A//mandrillapp=2Ecom/contact/abuse=3Fid=3D30?= =?utf-8?q?504962=2E83694620b59941faaa58546f2c7bf24c?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20250217:md Date: Mon, 17 Feb 2025 10:18:22 +0000 MIME-Version: 1.0 For the IOMMU redesign, the iommu context pagetable is defined once during initialization. When reusing P2M pagetable, we want to ensure that this pagetable is properly initialized. Signed-off-by: Teddy Astie --- xen/arch/x86/domain.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 78a13e6812..48bf9625e2 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -858,9 +858,6 @@ int arch_domain_create(struct domain *d, if ( (rc = init_domain_irq_mapping(d)) != 0 ) goto fail; - if ( (rc = iommu_domain_init(d, config->iommu_opts)) != 0 ) - goto fail; - psr_domain_init(d); if ( is_hvm_domain(d) ) @@ -879,6 +876,9 @@ int arch_domain_create(struct domain *d, else ASSERT_UNREACHABLE(); /* Not HVM and not PV? */ + if ( (rc = iommu_domain_init(d, config->iommu_opts)) != 0 ) + goto fail; + if ( (rc = tsc_set_info(d, XEN_CPUID_TSC_MODE_DEFAULT, 0, 0, 0)) != 0 ) { ASSERT_UNREACHABLE();