From patchwork Mon Mar 27 10:09:14 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: 13188991 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 54BD4C76195 for ; Mon, 27 Mar 2023 10:09:58 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.515116.797673 (Exim 4.92) (envelope-from ) id 1pgjnH-000519-Pd; Mon, 27 Mar 2023 10:09:39 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 515116.797673; Mon, 27 Mar 2023 10:09:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pgjnH-000512-My; Mon, 27 Mar 2023 10:09:39 +0000 Received: by outflank-mailman (input) for mailman id 515116; Mon, 27 Mar 2023 10:09:38 +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 1pgjnG-00050r-5j for xen-devel@lists.xenproject.org; Mon, 27 Mar 2023 10:09:38 +0000 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 792e3073-cc87-11ed-85db-49a42c6b2330; Mon, 27 Mar 2023 12:09:36 +0200 (CEST) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 1CEC65C0115; Mon, 27 Mar 2023 06:09:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 27 Mar 2023 06:09:34 -0400 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 27 Mar 2023 06:09:33 -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: 792e3073-cc87-11ed-85db-49a42c6b2330 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=fm2; t=1679911774; x=1679998174; bh=i2KoAdD9DY5Zol0CwbwIgutC0 7FZ/Fg8VpoElu80es0=; b=mBu7ULvF5PW4izdS2uBLypZZYYeqsZdjEE5a89gWT tPb0mjVXd0mGTL+xTr1uACNes9M2QZiMxLZM6V7AMnUAZkYh0JM7/5cg5Aa/rB1X nYsWNXo242+9Rjw6EGj25R7OMdlqvGJ1FBqoED+3pQZnJejdJs8NjCiUWgL3u2fa Nr3Hdg6CT655LyFj/jDFJJo9lRIpjy0x7GLMe/NR6ijuaLsvfahaNxv/vh+X5FuE V+VJmneGF8VMlF6kbTUEDnrZxKtFImZKopC2+pSO74LHfD7j7qV2giGr2NlN2cjT zCxTc2lrqg/Yo8esJxLUVYhXEuvYNH6ekqgZ2bZ4rHm7w== 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=fm2; t=1679911774; x=1679998174; bh=i 2KoAdD9DY5Zol0CwbwIgutC07FZ/Fg8VpoElu80es0=; b=Tn7LpbV3tj0eQuudU s4vu9akC4u2Zf0J+8g+4ozqn4GHf6xjzRhrKtqo6FoqjS5nx9E1YScMSI7vy3fyu Y5Q6jsXEhpt8BZamXXp1bYHvxj4F8MfVIRbuvN1GgHaoA8mdR53vITMIeBeXIf3/ TjoLEutq5wfyKNI6Q3r6z0VPJxK/RmxU7EoX11Plcm2E/sCUI42FXwnazTV8o0fi /0IpqkybRW1QQM1vogp/lnZG0kcvNvNQ9TAQtsEhLNTqFi920Fb5Vck43oFXWBVQ VM1nU6+saDUR6I28qry2voZUoMX4Ih/31jNchYRArm15R+nqWBYdoWH+lwp2aAC4 VsQLw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdehvddgvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffogggtgfesthekre dtredtjeenucfhrhhomhepofgrrhgvkhcuofgrrhgtiiihkhhofihskhhiqdfikphrvggt khhiuceomhgrrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslhgrsgdrtghomh eqnecuggftrfgrthhtvghrnhepleekhfduleetleelleetteevfeefteffkeetteejheel gfegkeelgeehhfdthedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepmhgrrhhmrghrvghksehinhhvihhsihgslhgvthhhihhnghhslhgrsgdr tghomh 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 0/2] Add API for making parts of a MMIO page R/O and use it in XHCI console Date: Mon, 27 Mar 2023 12:09:14 +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 | 3 +- xen/arch/x86/include/asm/mm.h | 22 ++++- xen/arch/x86/mm.c | 181 +++++++++++++++++++++++++++++++++- xen/arch/x86/pv/ro-page-fault.c | 1 +- xen/drivers/char/xhci-dbc.c | 38 ++++++- 6 files changed, 243 insertions(+), 4 deletions(-) base-commit: b1f11273d5a774cc88a3685c96c2e7cf6385e3b6