From nobody Mon Feb 9 09:43:07 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1670301294595403.194474924706; Mon, 5 Dec 2022 20:34:54 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.454335.711888 (Exim 4.92) (envelope-from ) id 1p2Pf5-0006BC-Qa; Tue, 06 Dec 2022 04:34:31 +0000 Received: by outflank-mailman (output) from mailman id 454335.711888; Tue, 06 Dec 2022 04:34:31 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p2Pf5-0006Aq-LL; Tue, 06 Dec 2022 04:34:31 +0000 Received: by outflank-mailman (input) for mailman id 454335; Tue, 06 Dec 2022 04:34:30 +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 1p2Pf4-00055j-Cj for xen-devel@lists.xenproject.org; Tue, 06 Dec 2022 04:34:30 +0000 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 44ebb0d0-751f-11ed-8fd2-01056ac49cbb; Tue, 06 Dec 2022 05:34:29 +0100 (CET) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 2C3A432009F5; Mon, 5 Dec 2022 23:34:27 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 05 Dec 2022 23:34:27 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 5 Dec 2022 23:34:25 -0500 (EST) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 44ebb0d0-751f-11ed-8fd2-01056ac49cbb DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1670301266; x=1670387666; bh=74iR55QTZEIoGrp/SIuOn2UKjLBB0nvCkho 9p4QDUpk=; b=kZHF3htozvEjILFcNmghVOiwiPahaARZZQnYB3OuQ/ch06nSado yG6NGCo0bVBBOkqFcYbDNuN8woNHVSIVoJAekDNpejUV4z+p7Tn0MuABYOOto9Lb ciobsBYRt1mrbiqR1gkqKwGWDkzPI6sYnKW2fxGz0YFjE1qYMg8R88hEMeO/qwYc RNegB14AdeJvY/h86+/ILyEPDew23GpOPKHi5l15r6F9KLUBruR0eSY8wkQIfDet eh6x1jJDztvZyR0WrDtoj02rTfehAZZH8MOuili0YEPJDsrT016eaYgpHRP3wXiw nE/IoM+hL/5GHy0wjENcpkvTaoViDzlYByA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1670301266; x=1670387666; bh=74iR55QTZEIoG rp/SIuOn2UKjLBB0nvCkho9p4QDUpk=; b=rzwdaqZhIFWzdkO3L3vAIMiVKkza+ PvpV0SK0/QZ98K6juLjx8KgH/WOj2E57lpPvOeMue8fyC4ffDDSo/FTU9je/7oJL 0ijXbB36LW+VT1evFWFQZX9hFxnqfJ3O+7mOHsC/z6kIISyqLb41ugTE5T7vt3Aj xKgKmZExEVbAyUDOOQuFfFPBIVJv3fXbanETr4FvE5AQN87g85O5abduXDCnzqfP vGHRDqpGD6m+Zp5vfXnb3VLmEOsBU3525KqxE+M5Uxd2uo1kGtAT063VzdlJY0eR QkwA6uRieCHnvo2fcpNMjDeowdQJcfWwVaqy+WpN4uFjzB+cMM+NmgcGg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudehgdejfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffvghmihcu ofgrrhhivgcuqfgsvghnohhurhcuoeguvghmihesihhnvhhishhisghlvghthhhinhhgsh hlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeejffejgffgueegudevvdejkefghefg hffhffejteekleeufeffteffhfdtudehteenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpeguvghmihesihhnvhhishhisghlvghthhhinhhgshhl rggsrdgtohhm X-ME-Proxy: Feedback-ID: iac594737:Fastmail From: Demi Marie Obenour To: xen-devel@lists.xenproject.org Cc: Demi Marie Obenour , =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Wei Liu , George Dunlap , Tim Deegan Subject: [PATCH 4/8] efi: Avoid hard-coding the various PAT constants Date: Mon, 5 Dec 2022 23:33:33 -0500 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZM-MESSAGEID: 1670301296801100011 Content-Type: text/plain; charset="utf-8" This makes the code much easier to understand, and avoids problems if Xen's PAT ever changes in the future. Signed-off-by: Demi Marie Obenour Reviewed-by: Jan Beulich --- xen/common/efi/boot.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index 8e880fe30c7541a202dec3e665300d6549953aa3..260997b251b09dae4b48c1b1db6= 65778e02d760a 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -1746,21 +1746,21 @@ void __init efi_init_memory(void) if ( desc->Attribute & EFI_MEMORY_WB ) /* nothing */; else if ( desc->Attribute & EFI_MEMORY_WT ) - prot |=3D _PAGE_PWT | MAP_SMALL_PAGES; + prot |=3D _PAGE_WT | MAP_SMALL_PAGES; else if ( desc->Attribute & EFI_MEMORY_WC ) - prot |=3D _PAGE_PAT | MAP_SMALL_PAGES; + prot |=3D _PAGE_WC | MAP_SMALL_PAGES; else if ( desc->Attribute & (EFI_MEMORY_UC | EFI_MEMORY_UCE) ) - prot |=3D _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES; + prot |=3D _PAGE_UC | MAP_SMALL_PAGES; else if ( efi_bs_revision >=3D EFI_REVISION(2, 5) && (desc->Attribute & EFI_MEMORY_WP) ) - prot |=3D _PAGE_PAT | _PAGE_PWT | MAP_SMALL_PAGES; + prot |=3D _PAGE_WP | MAP_SMALL_PAGES; else { printk(XENLOG_ERR "Unknown cachability for MFNs %#lx-%#lx%s\n", smfn, emfn - 1, efi_map_uc ? ", assuming UC" : ""); if ( !efi_map_uc ) continue; - prot |=3D _PAGE_PWT | _PAGE_PCD | MAP_SMALL_PAGES; + prot |=3D _PAGE_UC | MAP_SMALL_PAGES; } =20 if ( desc->Attribute & (efi_bs_revision < EFI_REVISION(2, 5) --=20 Sincerely, Demi Marie Obenour (she/her/hers) Invisible Things Lab