From nobody Mon Feb 9 02:55:16 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 1670301294966858.9396658358113; Mon, 5 Dec 2022 20:34:54 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.454333.711866 (Exim 4.92) (envelope-from ) id 1p2Pf2-0005cy-9Z; Tue, 06 Dec 2022 04:34:28 +0000 Received: by outflank-mailman (output) from mailman id 454333.711866; Tue, 06 Dec 2022 04:34:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p2Pf2-0005cp-4k; Tue, 06 Dec 2022 04:34:28 +0000 Received: by outflank-mailman (input) for mailman id 454333; Tue, 06 Dec 2022 04:34:27 +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 1p2Pf0-0005MV-W5 for xen-devel@lists.xenproject.org; Tue, 06 Dec 2022 04:34:26 +0000 Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 40728b0f-751f-11ed-91b6-6bf2151ebd3b; Tue, 06 Dec 2022 05:34:24 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 33F2132009EC; Mon, 5 Dec 2022 23:34:19 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 05 Dec 2022 23:34:20 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 5 Dec 2022 23:34:17 -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: 40728b0f-751f-11ed-91b6-6bf2151ebd3b 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= 1670301258; x=1670387658; bh=zlnhba+jqrzVDvS+quM/AmBMchrjFNcXxGL gLEattQI=; b=nFaQ5l1IWz9DxPJTn5JP8Hs7JoaTE5YO3TXoSVCvC8kG+CsxIkG UH3MIXlrob/dE4Xn2XJBxBntU1fjUY/Rbb/z2txaMCl05jN2fzVCSX2CEmgWrYAk 0dWL02Ab/Z4ZyyjT0MB/vjl6lj9g7DGiTIiep5FROjfAXU8RXot8XY5pB65u7ozP EkBburedsDc8qX7V1P+cvQrQDhIzlHKIsC3U3y6ExOaidYlGsdQUrEE/u5qqOtvz tDAFc+5/4SmWqOiIJJiTOSrs5cT2KK8/Eg4FBdotBFubRH8Kc0J5GbxlswqXh5b7 mBgT23P4t+Tmy8rz8jsqecevI7bPUpywgIQ== 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=1670301258; x=1670387658; bh=zlnhba+jqrzVD vS+quM/AmBMchrjFNcXxGLgLEattQI=; b=F7rEKa4oJCZrWhn1UuwJRc9zBEMau f3sCGZjh+OHA/9Butny+yuM6ja+V2/AuUNKdvtrkDISlL3jrASJgmXcfIF66mpZP Wcrf5V+gd4gc0pao8wIPki8YrD6yuWzWK5bEqvdGHZJGgPzlMzLx1qpNcw6P81Fu hF7feGcuSvSHqlE/kcXbyTUwGPcR4VB76WcyblwKWy+pCKnILahukNg2WVmc/gY6 laO6xCod7gOP+dhwiVVNlRUBawbZeC/3PS2J6JXGySEDHOWXvRV6+7Kvw2p4FBdL GelVc4POd3JjfLUveOdrg676UfH6EpCxjmyvzbi4TMFyrrR6sI6tO/LwQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudehgdejgecutefuodetggdotefrodftvf 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 1/8] x86/mm: Avoid hard-coding PAT in get_page_from_l1e() Date: Mon, 5 Dec 2022 23:33:30 -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: 1670301296564100003 Content-Type: text/plain; charset="utf-8" This still hard-codes the assumption that the two spare values are mapped to UC. Removing this assumption would require a more complex patch. Signed-off-by: Demi Marie Obenour Reviewed-by: Andrew Cooper --- xen/arch/x86/mm.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 78b1972e4170cacccc9c37c6e64e76e66a7da87f..5d05399c3a841bf03991a3bed63= df9a815c1e891 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -961,13 +961,10 @@ get_page_from_l1e( =20 switch ( l1f & PAGE_CACHE_ATTRS ) { - case 0: /* WB */ - flip |=3D _PAGE_PWT | _PAGE_PCD; - break; - case _PAGE_PWT: /* WT */ - case _PAGE_PWT | _PAGE_PAT: /* WP */ - flip |=3D _PAGE_PCD | (l1f & _PAGE_PAT); - break; + case _PAGE_WB: + case _PAGE_WT: + case _PAGE_WP: + flip |=3D (l1f & PAGE_CACHE_ATTRS) ^ _PAGE_UC; } =20 return flip; --=20 Sincerely, Demi Marie Obenour (she/her/hers) Invisible Things Lab