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 84382C63706 for ; Tue, 6 Dec 2022 04:34:42 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.454331.711844 (Exim 4.92) (envelope-from ) id 1p2Peu-00055x-Q4; Tue, 06 Dec 2022 04:34:20 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 454331.711844; Tue, 06 Dec 2022 04:34:20 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p2Peu-00055p-LI; Tue, 06 Dec 2022 04:34:20 +0000 Received: by outflank-mailman (input) for mailman id 454331; Tue, 06 Dec 2022 04:34:19 +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 1p2Pet-00055j-6A for xen-devel@lists.xenproject.org; Tue, 06 Dec 2022 04:34:19 +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 3b4e7b0d-751f-11ed-8fd2-01056ac49cbb; Tue, 06 Dec 2022 05:34:17 +0100 (CET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 1C9EB32009F0; Mon, 5 Dec 2022 23:34:10 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 05 Dec 2022 23:34:10 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 5 Dec 2022 23:34: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: 3b4e7b0d-751f-11ed-8fd2-01056ac49cbb DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to; s=fm1; t= 1670301249; x=1670387649; bh=sDIVsyhTHVkyAU/+B/rKbDWZZDFGzrBj2hs PmB7MdLs=; b=PP7hXNbYj6YB8yBuOP8NB+PY5sWvCA8dpJM2CVRcfgkkxVitACS eGRTSvJTjHbNfDjJ2V8/iXRRWfmsZmfcXtCMsdB0rYzrpgXtMOPwmiSS59l6zUz0 9n3VUX/Ti+6Ki26pXjK0GjQwuiXhm0G8VDwVQ/YIL1xRGdo4dQv7KSAruGcWuY9D NV4l+s2sL5WUVppgyx+VspcIsGxFrHodCiXu63Lmh+lYUMG6bO48Mv4xp/imzC8Z +bgvL0AUFEjohEFofCgqod3xYaCm/YCA0fK8qbLnjzxsJUXS9+uWo4qkUp8ioLH/ Mw+D2WhHU5crKmLyjKPUKjGYOnzZ0zCbnRQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version: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=1670301249; x=1670387649; bh=sDIVsyhTHVkyA U/+B/rKbDWZZDFGzrBj2hsPmB7MdLs=; b=fyzY2ZDbdSaEeMsBUarpVQ7LLACtW YkcabzqBX/2pOnbjAVFDsmhlx9jl/A2o9U9934TeLi8iA1ztaybuwUy1msbhtN+W amSYEJyWtcloNMa55ZPbnD+40h02mF54k2F2Z/tAmjR5QCoV4eJ30plz/ITKcNFa Lh5gDBekc9avIS883WczmFZGwVz0NefUTF//BVkjbTlVmiptm+y85cscgOgsPTFP YWyzzFkt2Rb58/+rb6Unubvkz7wVc3cr6lZP6nPpmtTKCp7D+QLpxf6Jh6bbbw4z XJLbeOYgtQ1XHH+IMvzQyAveRnwDUXVj08NpuB4Kzlc2JhltjS7j1iVAQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudehgdejgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffogggtgfesthekredtredtjeenucfhrhhomhepffgvmhhiucfo rghrihgvucfqsggvnhhouhhruceouggvmhhisehinhhvihhsihgslhgvthhhihhnghhslh grsgdrtghomheqnecuggftrfgrthhtvghrnhephfeggfeiiedtieejgedutdekgfetgeeh heegteekvefhfefgudehtdevleegueegnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepuggvmhhisehinhhvihhsihgslhgvthhhihhnghhslhgr sgdrtghomh 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 0/8] Make PAT handling less brittle Date: Mon, 5 Dec 2022 23:33:29 -0500 Message-Id: X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While working on Qubes OS Marek found out that there were some PAT hacks in the Linux i915 driver. I decided to make Xen use Linux’s PAT to see if it solved the graphics glitches that were observed; it did. This required a substantial amount of preliminary work that is useful even without using Linux’s PAT. Patches 1 through 7 are the preliminary work and I would like them to be accepted into upstream Xen. Patch 7 does technically break ABI by rejecting the unused PAT entries in debug builds, but as release builds are not impacted I suspect it is not a serious concern. Patch 8 actually switches to Linux’s PAT and is NOT intended to be merged (at least for now) as it would at a minimum break migration of PV guests from hosts that do not have the patch. Demi Marie Obenour (8): x86/mm: Avoid hard-coding PAT in get_page_from_l1e() p2m-pt: Avoid hard-coding Xen's PAT x86/mm/shadow: avoid assuming a specific Xen PAT efi: Avoid hard-coding the various PAT constants x86/mm/shadow: do not open-code PAGE_CACHE_ATTRS x86: Derive XEN_MSR_PAT from its individual entries x86/mm: make code robust to future PAT changes Use Linux's PAT xen/arch/x86/include/asm/page.h | 4 +- xen/arch/x86/include/asm/processor.h | 22 +++++++++- xen/arch/x86/mm.c | 65 ++++++++++++++++++++++++---- xen/arch/x86/mm/p2m-pt.c | 6 +-- xen/arch/x86/mm/shadow/multi.c | 8 ++-- xen/common/efi/boot.c | 10 ++--- 6 files changed, 91 insertions(+), 24 deletions(-) -- Sincerely, Demi Marie Obenour (she/her/hers) Invisible Things Lab