From mboxrd@z Thu Jan 1 00:00:00 1970 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 DA9FCC4332F for ; Tue, 13 Dec 2022 22:28:23 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.461281.719369 (Exim 4.92) (envelope-from ) id 1p5Dl0-0005d7-Ox; Tue, 13 Dec 2022 22:28:14 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 461281.719369; Tue, 13 Dec 2022 22:28:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p5Dl0-0005d0-Ls; Tue, 13 Dec 2022 22:28:14 +0000 Received: by outflank-mailman (input) for mailman id 461281; Tue, 13 Dec 2022 22:28:13 +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 1p5Dky-000519-Sc for xen-devel@lists.xenproject.org; Tue, 13 Dec 2022 22:28:12 +0000 Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 6cf983ca-7b35-11ed-8fd2-01056ac49cbb; Tue, 13 Dec 2022 23:28:12 +0100 (CET) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id CE2913200923; Tue, 13 Dec 2022 17:28:09 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 13 Dec 2022 17:28:10 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 13 Dec 2022 17:28:08 -0500 (EST) 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: 6cf983ca-7b35-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= 1670970489; x=1671056889; bh=yIAGImPg9jXiK1FiJVlbgF2FFk9SjFvShth ylTLb5D8=; b=KSjB2hZJlroU0Tb+vsnZA6+N0osPPqAF9TkObkaWyQOhRX1ZOaw u1M+32wlOa1G9zRAQjXfj6M5r2K5Oz+ab8mQGg+um/vHlLH8a6symEOuZx0WEdPb MxIT7lmyG6KAfAti0Vin0jx2TFQsOVSSmg/ntlrmdXjNq7EYOz+VlGR8PsciJHYS yNx56tlEalKpZTxfU+papOHxIe8Ie6Umz72KoltgSYYkyP1jIyV8yLV7ugQbtJQ1 2Cbn3LI7ZRPhpZmxkOIwPkUE0xm1XDVwD4BJaqqQZPUt0lPf0KqiQGY1yKgxMpdf b/8B7y5OrjbXJvRIXbyXBPOTN4FtL+PvSQA== 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=fm2; t=1670970489; x=1671056889; bh=yIAGImPg9jXiK 1FiJVlbgF2FFk9SjFvShthylTLb5D8=; b=jG0EH4aZeIxs3M+AbXeLey5OfkRaJ tOZAdcOb4Ajw/KuEgeKQaEeERjDmLpWRFEC7BLaomI07iGvvrFT+bv+5YCb2fr9R a++EqLuSlnnQVSfT6mCtA5zdVwM0wNntFiIZ+mIyHtZPndkiDE2eDHJx0blTcNrn xqH4fdq6Ncp0Z/MDEbe94VdOrbkXxMrFLulh+91tvw1kQk3/cZGo13hI/GdW2lJ0 VDcEXXLZhpPUKhihMJGIS0v7U7JUzT6IKbViLgrDhquROO1oJfhserq9FHKRKJOh EEc491PQPn6FuFD+MLz7EXK9qqc45momCEpoD1j6/sRI45zPwIZ3ccVmw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfedugdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffvghmihcu ofgrrhhivgcuqfgsvghnohhurhcuoeguvghmihesihhnvhhishhisghlvghthhhinhhgsh hlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeejffejgffgueegudevvdejkefghefg hffhffejteekleeufeffteffhfdtudehteenucevlhhushhtvghrufhiiigvpedunecurf 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 , Jun Nakajima , Kevin Tian , George Dunlap , Tim Deegan Subject: [PATCH v2 02/14] p2m-pt: Avoid hard-coding Xen's PAT Date: Tue, 13 Dec 2022 17:26:43 -0500 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: <71482430c20a701b1d577e87dc72e7c2661e69de.1670948141.git.demi@invisiblethingslab.com> References: <71482430c20a701b1d577e87dc72e7c2661e69de.1670948141.git.demi@invisiblethingslab.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This makes the code much easier to understand. No functional change intended. As per Andrew Cooper, the existing logic is incorrect, but this does not make it any worse. Signed-off-by: Demi Marie Obenour --- xen/arch/x86/mm/p2m-pt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c index eaba2b0fb4e6830f52b7d112fba8175dfe6d2770..cd1af33b6772ab1016e8d4c3284a6bc5d282869d 100644 --- a/xen/arch/x86/mm/p2m-pt.c +++ b/xen/arch/x86/mm/p2m-pt.c @@ -99,13 +99,13 @@ static unsigned long p2m_type_to_flags(const struct p2m_domain *p2m, return flags | P2M_BASE_FLAGS | _PAGE_RW | _PAGE_NX_BIT; case p2m_mmio_direct: if ( !rangeset_contains_singleton(mmio_ro_ranges, mfn_x(mfn)) ) - flags |= _PAGE_RW; + flags |= _PAGE_RW | _PAGE_UCM; else { - flags |= _PAGE_PWT; + flags |= _PAGE_UC; ASSERT(!level); } - return flags | P2M_BASE_FLAGS | _PAGE_PCD; + return flags | P2M_BASE_FLAGS; } } -- Sincerely, Demi Marie Obenour (she/her/hers) Invisible Things Lab