From patchwork Fri Oct 13 08:56:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Roger_Pau_Monn=C3=A9?= X-Patchwork-Id: 13420537 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 CCD3BCDB482 for ; Fri, 13 Oct 2023 08:57:32 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.616325.958233 (Exim 4.92) (envelope-from ) id 1qrDyu-0005bI-KR; Fri, 13 Oct 2023 08:57:16 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 616325.958233; Fri, 13 Oct 2023 08:57:16 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qrDyu-0005bB-HI; Fri, 13 Oct 2023 08:57:16 +0000 Received: by outflank-mailman (input) for mailman id 616325; Fri, 13 Oct 2023 08:57:15 +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 1qrDyt-0005b5-8U for xen-devel@lists.xenproject.org; Fri, 13 Oct 2023 08:57:15 +0000 Received: from esa4.hc3370-68.iphmx.com (esa4.hc3370-68.iphmx.com [216.71.155.144]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7f0eb601-69a6-11ee-9b0e-b553b5be7939; Fri, 13 Oct 2023 10:57:12 +0200 (CEST) Received: from mail-mw2nam10lp2101.outbound.protection.outlook.com (HELO NAM10-MW2-obe.outbound.protection.outlook.com) ([104.47.55.101]) by ob1.hc3370-68.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 13 Oct 2023 04:57:06 -0400 Received: from SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21) by CH0PR03MB5970.namprd03.prod.outlook.com (2603:10b6:610:e1::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.45; Fri, 13 Oct 2023 08:57:04 +0000 Received: from SJ0PR03MB6423.namprd03.prod.outlook.com ([fe80::66ca:3a42:baeb:9ecf]) by SJ0PR03MB6423.namprd03.prod.outlook.com ([fe80::66ca:3a42:baeb:9ecf%7]) with mapi id 15.20.6863.043; Fri, 13 Oct 2023 08:57:03 +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: 7f0eb601-69a6-11ee-9b0e-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1697187432; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=HqiBDSscAtbX7em/2LYRc1zJfCQxg7kOnvJ5vqf2WMc=; b=cdnM8bDv/ABVlf72VZkMen7Hbw+4ELNGq3FO8hnDur2zUVIDZflqRAmI Bwt9grqG77bjOL3CKuH9AAlmCYb3Oy5WAX6aNDGPW4DdmzN0/F+YxMPFX wE8ecyBre/CfF1hWjFDEqPaHsmrUsrXIwbg45ZustlYkKoAp3BEijHdTo A=; X-CSE-ConnectionGUID: DzJK9zZkQl+obUYfq8EnUg== X-CSE-MsgGUID: oB7MF9gbRdqPYE7nMI1oiw== X-IronPort-RemoteIP: 104.47.55.101 X-IronPort-MID: 128235519 X-IronPort-Reputation: None X-IronPort-Listener: OutboundMail X-IronPort-SenderGroup: RELAY_O365 X-IronPort-MailFlowPolicy: $RELAYED X-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5PySiHjaYrRQuaj+gd3Y+ZagvglQoBlRGttdBmxCajpzfHcGNzWuMaBJYa Z0q/A36gaISDAyVICWF3MFV+/Mq5nik4/nWwcPA1od5AyHnVqTmfbH+0zz5GZkbxp/hZMZtU TVmQ3w4auu99uhzAXH6mPV55NK3PP819pqHqW3+4ooAwSprjztSJVqWrWEsjxwivqo8kwWnN 7FpAplF9hv6knWYnq+rXLWqkrdOQ4VmjrfIGKj8DreSI3CNXwH4vN69M1km87imgodVNIV6t MD44vWjesSMfr6plWK2zH5bWAfqqOKmwtUrQcytQ0VbWJMUs4akWVYxjIYLL4wWBjX0aZiON VCLPyZxNs+SzKnRkGchEVX5piSUm8oHhGAK3JthuWQ1TVroFBVpnFotvAiog== X-Talos-CUID: 9a23:KH5FBG/JrFNOY7g+n1iVv2IGOON0YE/e9XOTJEWFOGhwGJCTdFDFrQ== X-Talos-MUID: 9a23:50dcWQ92G9yN4MhTvGku99eQf8BCvIGAWU8Hq5kfg/ipaipVGm6ajSviFw== X-IronPort-AV: E=Sophos;i="6.03,221,1694750400"; d="scan'208";a="128235519" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ExXT0f3HhqY6N3d0cStUI15nSwrEDLEcYLfsmD3lcFM23S6UTKDXbIv72+C4kM7biVISVJcrk8Ab5S2vaAgJjuGJZ/yK48vgf7nlmwxWl2g5VrsFSwNIwjtmLJDeUxsfJQWFAsc6cN60YLBJkrSV0ila4fMyugdOCYg3kqQvEgmtQ2sDO4lsshfvuYMlXhgTAXPg8a26rzrn3j1FzqKLQSjgR9LB1deiuUyzEgTBos1ri3ol5H1rR7Mbl8t8Zf0oW6UCv05c0jSWifM1axDy3SOkjBX4HeHqJoP6B79TToU4glh8Jp6crmPh6YU8a9/dGSBYdsPCsGP3EyfuGUToVA== 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=77H2C9EPKmrWnBk3ms8fMnbWqampqnWeb8VcPihyer8=; b=m95rohWxoq2JB30g/hl3SGyfHUfJYJ3zKy//bFJIjFQPoncvzfrqG47ujEDVQzQdhUbfdDY3ylI5m+wdbLMHF0CquLBNq9/pUtFxRf+7Ubeprp8/hQ1F8S0HpAZL7oCqOODzbVxrUrRCOw46efEotH+sXvdDmHMCEJVu66ej18NgSu50N3zyVSsVLaFGwsLoRhcC+BCZ5cnKZShRbnsdpfc6YktaiaseYlmcm3TXwfPQls3qRbtQQfx+UZuzDHAH41N0DX7E9oSeumcNz6FUPXfYUG5NID6X8NxiT7A84b/FaVV1XSjEY7Mer+v2Hn/0wt7vOdsZq82IbuwtOWKTHA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.onmicrosoft.com; s=selector2-citrix-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=77H2C9EPKmrWnBk3ms8fMnbWqampqnWeb8VcPihyer8=; b=u0BUMCVL6mComBW+WRNYaE09RsQIOD8+ZXQqtHaqyhAFDqa1UcKT5lS1Nn4XY6Qa16WIiyP6m6eHec/QCisn3row25MPCrPiqT2k/zuEeX7CeoXY240RK2i3501pYeZsQ3eTq4y6F2Wn6vXrt/RDt9FjYa1DmiVqQAxTpI9Re7s= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com; From: Roger Pau Monne To: xen-devel@lists.xenproject.org Cc: Henry Wang , Roger Pau Monne , Jan Beulich , Andrew Cooper , Wei Liu , Paul Durrant Subject: [PATCH for-4.18 v2] x86/pvh: fix identity mapping of low 1MB Date: Fri, 13 Oct 2023 10:56:54 +0200 Message-ID: <20231013085654.2789-1-roger.pau@citrix.com> X-Mailer: git-send-email 2.42.0 X-ClientProxiedBy: LO4P265CA0059.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2af::15) To SJ0PR03MB6423.namprd03.prod.outlook.com (2603:10b6:a03:38d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR03MB6423:EE_|CH0PR03MB5970:EE_ X-MS-Office365-Filtering-Correlation-Id: f1458f1c-0aa8-4a23-00ac-08dbcbca5eaa X-LD-Processed: 335836de-42ef-43a2-b145-348c2ee9ca5b,ExtAddr,ExtFwd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QtZYUbaEYpuPVtp0zEozLhmO3G+jvDhzuUc3gNpk+7Ez8IHqx+mL7TlMtAB3U9uKF16bAI4uEMAY8Wy77Z/4vBOfu7iJhxbnmNdMzmJBRAMgHQF3dADGfyo/FSWKHmUmNLMdlTSNQyhjF/sj8ae29906mllCZV73PqizXzJ3+pPTJAwLmkZmzppxEB0fe/RPCkIrNWuc8SpFmSBJHr8o5g6w9oEhPB4LrbWEgTfT/MM78Y8tbb5zFLvryRX2RoKmLO+Y3LfqDtzojIX6ZW5bFOQq1Dz74wmOLUN3t74maSFbX9x3JB5C3oUJQ9vj/tJUObuixMtXR34R2bO/O/HJUaGeCiLEW1XkaNFrZSNDefJqmf69yUir97IKrQEh09be+sLdHHaWLsVLMZOTKBcTeL+uxi2bN2MRLTbXjpdCfGhWT+b4HzIb/r57w9dkkQ8AHNf4Z1h4jFrOW0JGBTV9ifR7L1XDV3f9i0ktpyDQWajhiJS3kN1dz6VdGYO2dPOQavkRMp4nmwqIG+DEZEM15BnS8tAdOekfTZLRrE3HmU02p/8dNCnGRwVxsGi6eONQ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR03MB6423.namprd03.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(396003)(366004)(376002)(39860400002)(136003)(230922051799003)(186009)(64100799003)(451199024)(1800799009)(6506007)(83380400001)(26005)(82960400001)(38100700002)(6512007)(86362001)(4326008)(2906002)(6486002)(5660300002)(8936002)(8676002)(66476007)(6666004)(6916009)(316002)(66946007)(54906003)(66556008)(41300700001)(36756003)(1076003)(2616005)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?k+rZ6hKSeD4UFV5oORMA89qjYU9I?= =?utf-8?q?vpDnpSMiL/keXAj7sprPHarXFcNi8fW8yJD06DzAUFGY/KAIxvyO0dusCCkph3/Yk?= =?utf-8?q?wpa4Ng8gKl8A3tGmj9vVaZFzf3ZeHAtiJEyGVQpgnOzf92Xdj74bVzGxHuiUEMNnJ?= =?utf-8?q?YvEmsrMGLdbx3e6WHfB0yRuKQwGmMNm5q2Zj9ezMWd4K1vyVpgDjGf2Tzit/Bg9iq?= =?utf-8?q?zePz69DfFazFegpUwSNFvYbNDCasnE2+rCUfvmZTdJvy+rg22TGfyszwqs6LTuwTh?= =?utf-8?q?KOpVugbaFQv2bvNqpbw722sLKO36CJZl59p+V9urmvJsVWr1exskGvMRaJHYLFAIq?= =?utf-8?q?FswBtXcDY4kinCtXDG/EEtPYt6LEKJ2bFg/jMto49QVcCutTCwcDJHsBXh0UKShdN?= =?utf-8?q?OXtkqBu0Nt+PHsKkgPFBvfgnJcPHxOWaLt/0xyReTpdaUugHjIUJeTe3+K9donqWG?= =?utf-8?q?j/NUBfTyeN/H5Gu0cFS+6S/0OHhq4KVK/UA3jZiMcqugmaC3vfnanX4go/dkhG1Dm?= =?utf-8?q?YM4/AsEM1kWl8rnXI9BOLyhni0WWf5R9lvwFeDwohinRjLdDYTFH9dUoaEw4K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=?utf-8?q?bGiSr3jALVO1iCXP9xoIOz2LvqVxUKrPu49XTjRw4tt9VpLK1wpbxCzBQ36cSyZr3?= =?utf-8?q?EbSc5YHYNe0j?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ISyTFgXJqgS5cg2RUbLZeXyDAV0D7SCtY4vjILZ4oeeFFL07TWYcNZhFFRDhEexOJ5R9tjd6CKVaA99gYhnAxWnQYmjlA6peBVkIW7TLNDX12EgtHPuX4brOpkPCi2EBtxcNAt4uyVjr5dTyc+OAHOy0X99G4SSfpd0HyrXLmCYTfPQV4Ad6W31EgFzGl5jpL330nh2250btqKDc/roNkpgsWpCchmqzKAKjqYRwtyPUludNQNbrylQd7+ft5pVEdwT4K287zzRtO5yewqzJXBjWZqBU+UJ3M+9B7AHlg04vzlucIFTobkudvFpJOhGCMNIuDEHP4wYDWh5QjZ5tfIsgstAIvqBLbFSPLRkknEp2moagT6X8yuHkNayPZ9fDl50eOScBuS+li2VuFqHTjuFbBHzrQyZyLMGHCpHuUPeIeB3MCRiwuCshmVy/jBSGu7h5BJ4YOnOhbtg8/VsLL3KjmI+9MUaKsBxnBuylOBRO04ndj417KIX1gU9DDVarWnUIIv2tmWmK9ApajEZVbuXlUN4t2BIX+EgL0wNbLjWpAchjbXEQDPg4v6cMsCo07gobF0VUaaVzC8ELhvjwYYK/Q/i/Lk+2LrPSUMjjEcuIgHsDfHnd8QPEDE1YQH2D+HS2xI6lQW7HP7lNARsZ+aQuvTtgFj30l5gnrUj8QKOfvTiKaympK+kD6rne9hZQNXfBy9FNflWGsLgeyvgikS8t4q9FtGG1hEmHCRJrUYYGWySCWqnc/J1foD1E+kOpLd8sp5qYYWF5mSM1Xjvq0aRMnwHuEmdcJYfQVk7QsguvRKKaDto/O1rs292LqcBYFAk0uxwZB6OS3KgNndRsG1PzvmVWzbsdDsRmterWAXs= X-OriginatorOrg: citrix.com X-MS-Exchange-CrossTenant-Network-Message-Id: f1458f1c-0aa8-4a23-00ac-08dbcbca5eaa X-MS-Exchange-CrossTenant-AuthSource: SJ0PR03MB6423.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Oct 2023 08:57:03.7471 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335836de-42ef-43a2-b145-348c2ee9ca5b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: twb3HFOhyuGqCy677Oe9vkfHRL8UKDN1zeb69EtjaaMnkTwZN+nlZ+PyKhAvGLWon3foWGj+y2W1q8T3htNpSw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR03MB5970 The mapping of memory regions below the 1MB mark was all done by the PVH dom0 builder code, causing the region to be avoided by the arch specific IOMMU hardware domain initialization code. That lead to the IOMMU being enabled without reserved regions in the low 1MB identity mapped in the p2m for PVH hardware domains. Firmware which happens to be missing RMRR/IVMD ranges describing E820 reserved regions in the low 1MB would transiently trigger IOMMU faults until the p2m is populated by the PVH dom0 builder: AMD-Vi: IO_PAGE_FAULT: 0000:00:13.1 d0 addr 00000000000eb380 flags 0x20 RW AMD-Vi: IO_PAGE_FAULT: 0000:00:13.1 d0 addr 00000000000eb340 flags 0 AMD-Vi: IO_PAGE_FAULT: 0000:00:13.2 d0 addr 00000000000ea1c0 flags 0 AMD-Vi: IO_PAGE_FAULT: 0000:00:14.5 d0 addr 00000000000eb480 flags 0x20 RW AMD-Vi: IO_PAGE_FAULT: 0000:00:12.0 d0 addr 00000000000eb080 flags 0x20 RW AMD-Vi: IO_PAGE_FAULT: 0000:00:14.5 d0 addr 00000000000eb400 flags 0 AMD-Vi: IO_PAGE_FAULT: 0000:00:12.0 d0 addr 00000000000eb040 flags 0 Those errors have been observed on the osstest pinot{0,1} boxes (AMD Fam15h Opteron(tm) Processor 3350 HE). Mostly remove the special handling of the low 1MB done by the PVH dom0 builder, leaving just the data copy between RAM regions. Otherwise rely on the IOMMU arch init code to create any identity mappings for reserved regions in that range (like it already does for reserved regions elsewhere). Note there's a small difference in behavior, as holes in the low 1MB will no longer be identity mapped to the p2m. Fixes: 6b4f6a31ace1 ('x86/PVH: de-duplicate mappings for first Mb of Dom0 memory') Signed-off-by: Roger Pau Monné --- Changes since v1: - Reword commit message. --- xen/arch/x86/hvm/dom0_build.c | 22 ---------------------- xen/drivers/passthrough/x86/iommu.c | 8 +------- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c index bc0e290db612..979db7d1ec4d 100644 --- a/xen/arch/x86/hvm/dom0_build.c +++ b/xen/arch/x86/hvm/dom0_build.c @@ -449,28 +449,6 @@ static int __init pvh_populate_p2m(struct domain *d) } } - /* Non-RAM regions of space below 1MB get identity mapped. */ - for ( i = rc = 0; i < MB1_PAGES; ++i ) - { - p2m_type_t p2mt; - mfn_t mfn = get_gfn_query(d, i, &p2mt); - - if ( mfn_eq(mfn, INVALID_MFN) ) - rc = set_mmio_p2m_entry(d, _gfn(i), _mfn(i), PAGE_ORDER_4K); - else - /* - * If the p2m entry is already set it must belong to a RMRR and - * already be identity mapped, or be a RAM region. - */ - ASSERT(p2mt == p2m_ram_rw || mfn_eq(mfn, _mfn(i))); - put_gfn(d, i); - if ( rc ) - { - printk("Failed to identity map PFN %x: %d\n", i, rc); - return rc; - } - } - if ( cpu_has_vmx && paging_mode_hap(d) && !vmx_unrestricted_guest(v) ) { /* diff --git a/xen/drivers/passthrough/x86/iommu.c b/xen/drivers/passthrough/x86/iommu.c index c85549ccad6e..857dccb6a465 100644 --- a/xen/drivers/passthrough/x86/iommu.c +++ b/xen/drivers/passthrough/x86/iommu.c @@ -400,13 +400,7 @@ void __hwdom_init arch_iommu_hwdom_init(struct domain *d) max_pfn = (GB(4) >> PAGE_SHIFT) - 1; top = max(max_pdx, pfn_to_pdx(max_pfn) + 1); - /* - * First Mb will get mapped in one go by pvh_populate_p2m(). Avoid - * setting up potentially conflicting mappings here. - */ - start = paging_mode_translate(d) ? PFN_DOWN(MB(1)) : 0; - - for ( i = pfn_to_pdx(start), count = 0; i < top; ) + for ( i = 0, start = 0, count = 0; i < top; ) { unsigned long pfn = pdx_to_pfn(i); unsigned int perms = hwdom_iommu_map(d, pfn, max_pfn);