From patchwork Thu Dec 8 13:55:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= X-Patchwork-Id: 13068427 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 44372C4332F for ; Thu, 8 Dec 2022 13:55:24 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.457173.715036 (Exim 4.92) (envelope-from ) id 1p3HMn-0007OQ-Ta; Thu, 08 Dec 2022 13:55:13 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 457173.715036; Thu, 08 Dec 2022 13:55:13 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p3HMn-0007OJ-Qv; Thu, 08 Dec 2022 13:55:13 +0000 Received: by outflank-mailman (input) for mailman id 457173; Thu, 08 Dec 2022 13:55:12 +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 1p3HMm-0007Mg-4T for xen-devel@lists.xenproject.org; Thu, 08 Dec 2022 13:55:12 +0000 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id ec898c28-76ff-11ed-8fd2-01056ac49cbb; Thu, 08 Dec 2022 14:55:10 +0100 (CET) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 3E0CF5C0110; Thu, 8 Dec 2022 08:55:07 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 08 Dec 2022 08:55:07 -0500 Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 8 Dec 2022 08:55:05 -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: ec898c28-76ff-11ed-8fd2-01056ac49cbb DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= invisiblethingslab.com; h=cc:cc:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm1; t=1670507707; x=1670594107; bh=6GKpjudIqv TWDk1IikFFGhAigKJs3+rT6h11l7fzCp8=; b=mDFCuZoklYstfq7H4HG1qETEV0 W+f8FY8dt794xsufTS3A9fTJbGcI8BtMShglShqIzajIyq3HryDtYBJ9xWsp8Qd0 gBvtN1zxV9kD9U6eZ2c/koXQx7wAaqsYcMAZuGIa4bCBi84JH1+D1GY8F8O800aM TNe5J+I0t1RzJ8Wm9j/TCVmjCFYcFhmPBqn5O9Ewx+BnthtH2ydNQjr6uOLmwrDE b5GkYZZzHATWYUCKLYjlkoDEt3Vj7nHXYL3A1xSZMQCKqyAiWsurHV+apiw+CwB6 ZDl4w4Vx72tQnQriCXgzDu1weIRW3NmYPlGxHXdRjRtQisC4sGBppKK6AxLw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=1670507707; x= 1670594107; bh=6GKpjudIqvTWDk1IikFFGhAigKJs3+rT6h11l7fzCp8=; b=Z 8QOdcPshuupEpeJx3YgCY5X1eHI371vnP77kt4cV2hFIcgbQR1JFaw8kKt+d/aa2 t2/8fifmvU/wTioWS9W5TKkVB2MhOVmVL/DuwatHXv0gaChNl7PCSFntWoAQ7XyP J8AWur2GwgDhTV+/WWp8BltgFeMxCDIZBgQM9H6M7qtt7AIXmqooNzhsFhky/CqK VCk0/ii1AsQPeFFk05Cp9/zCKwO55KyiTwyoNh9OO/zjf16fkIkWyKvlt7DxEUCu QCvhH5LZ3pP+ImX8tYs0HzejELUt3v/b/bCgHVb0Y1aa55ih02EtUOPPHn49wCnm seDRlmlHeq4LbZkebWNYg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddtgdehjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvvefukfggtggusehgtderredttdejnecuhfhrohhmpeforghrvghkucfo rghrtgiihihkohifshhkihdqifpkrhgvtghkihcuoehmrghrmhgrrhgvkhesihhnvhhish hisghlvghthhhinhhgshhlrggsrdgtohhmqeenucggtffrrghtthgvrhhnpeehgfeuvdej keeikeeludelteevfeegffegteefffetheetffduudejuedugfdvteenucffohhmrghinh epqhhusggvshdqohhsrdhorhhgpdhgihhthhhusgdrtghomhenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrghrmhgrrhgvkhesihhnvhhish hisghlvghthhhinhhgshhlrggsrdgtohhm X-ME-Proxy: Feedback-ID: i1568416f:Fastmail Date: Thu, 8 Dec 2022 14:55:02 +0100 From: Marek =?utf-8?q?Marczykowski-G=C3=B3recki?= To: intel-gfx@lists.freedesktop.org Cc: xen-devel , "Demi M. Obenour" , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Matt Roper , Lucas De Marchi , =?utf-8?b?Sm9zw6k=?= Roberto de Souza Subject: i915 and PAT attributes on Xen PV Message-ID: MIME-Version: 1.0 Content-Disposition: inline Hi, There is an issue with i915 on Xen PV (dom0). The end result is a lot of glitches, like here: https://openqa.qubes-os.org/tests/54748#step/startup/8 (this one is on ADL, Linux 6.1-rc7 as a Xen PV dom0). It's using Xorg with "modesetting" driver. After some iterations of debugging, we narrowed it down to i915 handling caching. The main difference is that PAT is setup differently on Xen PV than on native Linux. Normally, Linux does have appropriate abstraction for that, but apparently something related to i915 doesn't play well with it. The specific difference is: native linux: x86/PAT: Configuration [0-7]: WB WC UC- UC WB WP UC- WT xen pv: x86/PAT: Configuration [0-7]: WB WT UC- UC WC WP UC UC ~~ ~~ ~~ ~~ The specific impact depends on kernel version and the hardware. The most severe issues I see on >=ADL, but some older hardware is affected too - sometimes only if composition is disabled in the window manager. Some more information is collected at https://github.com/QubesOS/qubes-issues/issues/4782 (and few linked duplicates...). Kind-of related commit is here: https://github.com/torvalds/linux/commit/bdd8b6c98239cad ("drm/i915: replace X86_FEATURE_PAT with pat_enabled()") - it is the place where i915 explicitly checks for PAT support, so I'm cc-ing people mentioned there too. Any ideas? The issue can be easily reproduced without Xen too, by adjusting PAT in Linux: -----8<----- -----8<----- diff --git a/arch/x86/mm/pat/memtype.c b/arch/x86/mm/pat/memtype.c index 66a209f7eb86..319ab60c8d8c 100644 --- a/arch/x86/mm/pat/memtype.c +++ b/arch/x86/mm/pat/memtype.c @@ -400,8 +400,8 @@ void pat_init(void) * The reserved slots are unused, but mapped to their * corresponding types in the presence of PAT errata. */ - pat = PAT(0, WB) | PAT(1, WC) | PAT(2, UC_MINUS) | PAT(3, UC) | - PAT(4, WB) | PAT(5, WP) | PAT(6, UC_MINUS) | PAT(7, WT); + pat = PAT(0, WB) | PAT(1, WT) | PAT(2, UC_MINUS) | PAT(3, UC) | + PAT(4, WC) | PAT(5, WP) | PAT(6, UC) | PAT(7, UC); } if (!pat_bp_initialized) {