From patchwork Fri May 5 21:25:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= X-Patchwork-Id: 13233077 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 64BEEC77B7D for ; Fri, 5 May 2023 21:26:28 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.530650.826384 (Exim 4.92) (envelope-from ) id 1pv2wF-00077W-Mg; Fri, 05 May 2023 21:26:03 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 530650.826384; Fri, 05 May 2023 21:26:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pv2wF-00077P-Jo; Fri, 05 May 2023 21:26:03 +0000 Received: by outflank-mailman (input) for mailman id 530650; Fri, 05 May 2023 21:26:02 +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 1pv2wD-00077H-Vw for xen-devel@lists.xenproject.org; Fri, 05 May 2023 21:26:02 +0000 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6bd93315-eb8b-11ed-b226-6b7b168915f2; Fri, 05 May 2023 23:25:58 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 881393200A89; Fri, 5 May 2023 17:25:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 05 May 2023 17:25:54 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 5 May 2023 17:25:53 -0400 (EDT) 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: 6bd93315-eb8b-11ed-b226-6b7b168915f2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm3; t=1683321954; x=1683408354; bh=PDyU9NZ51sl5yKnOCnEilGWUm ShNFHrjw6ME6jDLwyk=; b=F3ywGpqE1Gk1X+Ee/uUhu90/cf6R3KNn8afKN0HBa Vh/JJObuRQqWhFRRvA2CWIN2vjjhBN3QRVo14OoD/8I3wzuWgDltg3G4CtzJFplY np+utE9vbQjoCNcjP9ekGQTx2suVusPWVo6PsJsDuDipymkukJBO0/S2dOCFoo5y zSVBL5udoao/1TXCOAqZh9pzvB3ic5ThSA39wUfS2pDBtP/cUn2zzlJ2P4ftzv1U FCDosrLmJnc6zoDK/x+REa6fu1lAHuQO1ZWbgq3GYC82GbxIAFTtUYhmApc98NsY +bmhpEtaiLb1c65nZOiP8MBb2LxJRnES98x1FtkJbRRLw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type: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=fm3; t=1683321954; x=1683408354; bh=P DyU9NZ51sl5yKnOCnEilGWUmShNFHrjw6ME6jDLwyk=; b=b42mZxKjd/kl2DIbQ EGglrWR82TZxRBPi7XubYm/Tn+g7zv+9NO4HzFmg591yDXE1nb+J+mf7TJDeSmtz OVIAnhynPSmnt0mM8NFmftIsNAEq4W2UT51B7X6VA+NTuIvh++ZAGhDmj3VoLKMj Qnc1PkcMaM4m1fBt8gxUsNVPffFXZ1cABtALf+t2EvMGjkMnncer0/a2PmYsC3Eq 4f4S8Lzsvj1ly1/AQHU1B9OD3KWDGagnxuP0I29DF0vPa9FEoMNnqGsKvSKZWoFK xlF5mc4fW2tT6xz5iQSoq1f9JSt3fAhqCGbe9kPtTxK6A6gAiOkVo6De0GUnJIv6 arKqQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeefvddgudeifecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefufffkofggtgfgsehtke ertdertdejnecuhfhrohhmpeforghrvghkucforghrtgiihihkohifshhkihdqifpkrhgv tghkihcuoehmrghrmhgrrhgvkhesihhnvhhishhisghlvghthhhinhhgshhlrggsrdgtoh hmqeenucggtffrrghtthgvrhhnpeelkefhudelteelleelteetveeffeetffekteetjeeh lefggeekleeghefhtdehvdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpehmrghrmhgrrhgvkhesihhnvhhishhisghlvghthhhinhhgshhlrggs rdgtohhm X-ME-Proxy: Feedback-ID: i1568416f:Fastmail From: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= To: xen-devel@lists.xenproject.org Cc: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= Subject: [PATCH v2 0/2] Add API for making parts of a MMIO page R/O and use it in XHCI console Date: Fri, 5 May 2023 23:25:34 +0200 Message-Id: X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 On older systems, XHCI xcap had a layout that no other (interesting) registers were placed on the same page as the debug capability, so Linux was fine with making the whole page R/O. But at least on Tiger Lake and Alder Lake, Linux needs to write to some other registers on the same page too. Add a generic API for making just parts of an MMIO page R/O and use it to fix USB3 console with share=yes or share=hwdom options. More details in commit messages. Marek Marczykowski-Górecki (2): x86/mm: add API for marking only part of a MMIO page read only drivers/char: Use sub-page ro API to make just xhci dbc cap RO xen/arch/x86/hvm/emulate.c | 2 +- xen/arch/x86/hvm/hvm.c | 8 +- xen/arch/x86/include/asm/mm.h | 15 ++- xen/arch/x86/mm.c | 253 +++++++++++++++++++++++++++++++++- xen/arch/x86/pv/ro-page-fault.c | 1 +- xen/drivers/char/xhci-dbc.c | 14 +-- 6 files changed, 284 insertions(+), 9 deletions(-) base-commit: 99a9c3d7141063ae3f357892c6181cfa3be8a280 Tested-by: Jason Andryuk