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 4A73EC3DA7A for ; Thu, 22 Dec 2022 22:32:18 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.468692.727862 (Exim 4.92) (envelope-from ) id 1p8U6b-00036z-6Q; Thu, 22 Dec 2022 22:32:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 468692.727862; Thu, 22 Dec 2022 22:32:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p8U6b-00036s-3p; Thu, 22 Dec 2022 22:32:01 +0000 Received: by outflank-mailman (input) for mailman id 468692; Thu, 22 Dec 2022 22:32:00 +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 1p8U6Z-00036m-Nf for xen-devel@lists.xenproject.org; Thu, 22 Dec 2022 22:31:59 +0000 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 707f292b-8248-11ed-91b6-6bf2151ebd3b; Thu, 22 Dec 2022 23:31:57 +0100 (CET) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 2ED535C005C; Thu, 22 Dec 2022 17:31:55 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 22 Dec 2022 17:31:55 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 22 Dec 2022 17:31:54 -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: 707f292b-8248-11ed-91b6-6bf2151ebd3b 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=fm2; t= 1671748315; x=1671834715; bh=Mgo9vyvq27x7kZrzIpUg0LyZtvhD7v1wK9V 7XY9I8bg=; b=CEg95zLGA8hlh1RlG8WAGCR/8RX89TgdQjBTl877IueDUMcrxz7 DDm2lPr2z2o8DU9XE2Ut8fcJV3iyquWD06ya94jIjm7kWEtnj2nmOdfQ1AKDQbzj nQit/rvyr+ysBz+HQ1HL7wrE5B4m4o7DDCFTyv7yvzh1LJT26w5GFeBWRGBA933q RapLzcTyNDRoQYGSHrw8HsiTWHlejVGfXXlDjll/3Q+E8Sf6wZZUfPV6S/RUwpjM RJwGmbb8pEGdJ1ZCkUOdKkLntlvm1yedagW5rt+uQiutaS7GD86RDhgf03gCdXIj q1eThSXPeFmov+8d3hFX3UJuWPWT+eOxhMQ== 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=fm2; t=1671748315; x=1671834715; bh=Mgo9vyvq27x7k ZrzIpUg0LyZtvhD7v1wK9V7XY9I8bg=; b=hilg0SZROLXbV3O45coTbqpU/7geg PYw/SctwTwIkieZyVWEK8q1VmsR0IE4gxEHUfUVeqkZE27uBOynaSHSsUlK5hTC5 1YEQVOqZ/2aV8GyJW7EQKVgS/RsmcXEXXTfKYn9n6Ig8Ob2Bb/BFqoqBibFsXRQq SGmchNljI5lvCLmAvwKptHYHh8hN2T+3lyj9TUYfEbO7Y6dyLgwC4XQAge3x6NtO SDmLadqQIib0iPcZGi53hq4Sdv/hFVaiAxi4ErdPCuTOc61Nqd3ZwqF20AS7UpF+ EJG8lCv1ou1X0uIGsQde9m/R+IfOVMweQVunYbZuiOeBfpqURomdZpxUg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrhedtgdduieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofggtgfgsehtkeertdertdejnecuhfhrohhmpeffvghmihcu ofgrrhhivgcuqfgsvghnohhurhcuoeguvghmihesihhnvhhishhisghlvghthhhinhhgsh hlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpefhgefgieeitdeijeeguddtkefgteeg heehgeetkeevhfefgfduhedtveelgeeugeenucevlhhushhtvghrufhiiigvpedtnecurf 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 , Tim Deegan , George Dunlap Subject: [PATCH v6 0/5] Make PAT handling less brittle Date: Thu, 22 Dec 2022 17:31:45 -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 i195 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 4 are the preliminary work and I would like them to be accepted into upstream Xen. Patch 4 does break ABI by rejecting the unused PAT entries, but this will only impact buggy PV guests and can be disabled with a Xen command-line option. Patch 5 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. Only patches 4 and 5 actually change Xen’s observable behavior. Patch 1 is a prerequisite that removes the last place where Xen hard-codes its current PAT value. Patch 2 is strictly cleanup. Patch 3 makes changing the PAT much less error-prone, as problems with the PAT or with the associated _PAGE_* constants will be detected at compile time. Demi Marie Obenour (5): x86/mm: Avoid hard-coding PAT in get_page_from_l1e() x86: Remove MEMORY_NUM_TYPES and NO_HARDCODE_MEM_TYPE x86/mm: make code robust to future PAT changes x86/mm: Reject invalid cacheability in PV guests by default x86: Use Linux's PAT docs/misc/xen-command-line.pandoc | 11 ++ xen/arch/x86/hvm/mtrr.c | 18 ++-- xen/arch/x86/include/asm/mtrr.h | 2 - xen/arch/x86/include/asm/page.h | 4 +- xen/arch/x86/include/asm/processor.h | 10 +- xen/arch/x86/mm.c | 146 ++++++++++++++++++++++++--- xen/arch/x86/mm/shadow/multi.c | 2 +- 7 files changed, 162 insertions(+), 31 deletions(-) -- Sincerely, Demi Marie Obenour (she/her/hers) Invisible Things Lab