Message ID | 20230209072220.6836-6-jgross@suse.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp186780wrn; Wed, 8 Feb 2023 23:24:34 -0800 (PST) X-Google-Smtp-Source: AK7set/BnIAYgQLjFfoTJjTMFHKFsgiSM3+CFMPvqsFGJk1hvVpLq+Ale3j2mbFr70Qm3iiHCg+i X-Received: by 2002:a50:baa5:0:b0:4ab:2004:b82 with SMTP id x34-20020a50baa5000000b004ab20040b82mr258068ede.15.1675927474683; Wed, 08 Feb 2023 23:24:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675927474; cv=none; d=google.com; s=arc-20160816; b=xxT5215vWXR3nk0jPTzM8RfrH6eYepoyURdSKNqth8TidsiqXpYpDi7KlW+BnLgMJv k1+C/bgk87J5rqrqjMAcKCKCq2UAFhWcE59iPeRoU7KYYcaz/Ll2Mtg0lKmPF9gyZO2Z rcwL5oK/aZxNPuSpl1ktdeHc6LA2c7T0NwX3OcE6ofCYS8BUdKUojfsgBbku4fLNIbBR WyrWEH77Qi9WrYxltfBQFu1fYve7lZBTsOxeHWMt2DJcT80LKwwGiSUEUr+/gMQ90aTu RFnjbbE5qAY7qMx5zjrr/fftSalE20hOqohzlaO1gk5/v8WW8hzPPcgAR+DHvb1wzN6T z0NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=hQfuC28mlaLh9I0Auwhmi7p4E8oJ358WdbS83VTVrH4=; b=Fm4D4vigAqaqtudpB6upEQLcRQZ40TNUUj+6fZ6IYH9eNctgqaMfTwRfcbippW4tMn 8VeWzlnKwxj31nqpavfP0MZNgLllPMhSDjasp7eA8sGCsSHW+IaI2nZ30Yx7UEuPz1Ns R5bwDlRQu44sBmRsYbPiiFvskqsG8T25gGhSEBR0kbmL+FwLzImwTVsF1hxO+7aB5U5+ qD7LD3+vhtfmYt5tMGmDQIQfpCy1vksRswU3l5Cq56Nof/yDt8xX0dQotTtHzjCzd7ZP nqE3ybgCMqH2BjPf2Q60OUUFJDf2KqWKdcAZH+8Dw2uEkP9lkDZf9RRFh5Vk5sC81H9x ihFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=QVxkqyKw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y22-20020a50e616000000b0049f1f3402f4si1268729edm.87.2023.02.08.23.24.11; Wed, 08 Feb 2023 23:24:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=QVxkqyKw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229939AbjBIHXT (ORCPT <rfc822;ybw1215001957@gmail.com> + 99 others); Thu, 9 Feb 2023 02:23:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229612AbjBIHXK (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 9 Feb 2023 02:23:10 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A71231A8 for <linux-kernel@vger.kernel.org>; Wed, 8 Feb 2023 23:22:53 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 10FCE34DB5; Thu, 9 Feb 2023 07:22:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1675927372; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hQfuC28mlaLh9I0Auwhmi7p4E8oJ358WdbS83VTVrH4=; b=QVxkqyKwUppd9azMYiG9BFJQTC5IR16oq3ZSRSa5ll2tDuUvUQEZSA5ozX47EUsSPLIG6y ToGEeYD9z/oFBPo/Q6vY6TY6/65BfrKEW7DaMD4lYdrnjwUma9A17wnJuXZpVcSN1du3MF lAyMbOHODDDWWHlN19KY4AmQDLxB76g= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id A9F661339E; Thu, 9 Feb 2023 07:22:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id fa0+KEuf5GMJeQAAMHmgww (envelope-from <jgross@suse.com>); Thu, 09 Feb 2023 07:22:51 +0000 From: Juergen Gross <jgross@suse.com> To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: lists@nerdbynature.de, mikelley@microsoft.com, torvalds@linux-foundation.org, Juergen Gross <jgross@suse.com>, Dave Hansen <dave.hansen@linux.intel.com>, Andy Lutomirski <luto@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, "H. Peter Anvin" <hpa@zytor.com> Subject: [PATCH v2 5/8] x86/mtrr: revert commit 90b926e68f50 Date: Thu, 9 Feb 2023 08:22:17 +0100 Message-Id: <20230209072220.6836-6-jgross@suse.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230209072220.6836-1-jgross@suse.com> References: <20230209072220.6836-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757337327170022533?= X-GMAIL-MSGID: =?utf-8?q?1757337327170022533?= |
Series |
x86/mtrr: fix handling with PAT but without MTRR
|
|
Commit Message
Juergen Gross
Feb. 9, 2023, 7:22 a.m. UTC
Commit 90b926e68f50 ("x86/pat: Fix pat_x_mtrr_type() for MTRR disabled
case") has introduced a regression with Xen.
Revert the patch.
Signed-off-by: Juergen Gross <jgross@suse.com>
---
arch/x86/mm/pat/memtype.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
Comments
Linux regression tracking (Thorsten Leemhuis)
Feb. 10, 2023, 6:59 p.m. UTC |
#1
Addressed
Unaddressed
Hi, this is your Linux kernel regression tracker. On 09.02.23 08:22, Juergen Gross wrote: > Commit 90b926e68f50 ("x86/pat: Fix pat_x_mtrr_type() for MTRR disabled > case") has introduced a regression with Xen. > > Revert the patch. That regression you refer to is afaics one I'm tracking[1] that was introduced this cycle. That makes me wonder: could this patch be applied directly to fix the issue quickly? Or are patches 1 to 4 needed as well (or the whole series?) to avoid other problems? Ciao, Thorsten [1] https://lore.kernel.org/all/4fe9541e-4d4c-2b2a-f8c8-2d34a7284930@nerdbynature.de/ P.S.: BTW; let me tell regzbot to monitor this thread: #regzbot ^backmonitor: https://lore.kernel.org/all/4fe9541e-4d4c-2b2a-f8c8-2d34a7284930@nerdbynature.de/ > Signed-off-by: Juergen Gross <jgross@suse.com> > --- > arch/x86/mm/pat/memtype.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/arch/x86/mm/pat/memtype.c b/arch/x86/mm/pat/memtype.c > index fb4b1b5e0dea..46de9cf5c91d 100644 > --- a/arch/x86/mm/pat/memtype.c > +++ b/arch/x86/mm/pat/memtype.c > @@ -387,8 +387,7 @@ static unsigned long pat_x_mtrr_type(u64 start, u64 end, > u8 mtrr_type, uniform; > > mtrr_type = mtrr_type_lookup(start, end, &uniform); > - if (mtrr_type != MTRR_TYPE_WRBACK && > - mtrr_type != MTRR_TYPE_INVALID) > + if (mtrr_type != MTRR_TYPE_WRBACK) > return _PAGE_CACHE_MODE_UC_MINUS; > > return _PAGE_CACHE_MODE_WB;
On 10.02.23 19:59, Linux regression tracking (Thorsten Leemhuis) wrote: > Hi, this is your Linux kernel regression tracker. > > On 09.02.23 08:22, Juergen Gross wrote: >> Commit 90b926e68f50 ("x86/pat: Fix pat_x_mtrr_type() for MTRR disabled >> case") has introduced a regression with Xen. >> >> Revert the patch. > > That regression you refer to is afaics one I'm tracking[1] that was > introduced this cycle. That makes me wonder: could this patch be applied > directly to fix the issue quickly? Or are patches 1 to 4 needed as well > (or the whole series?) to avoid other problems? Patches 1-4 are needed, too, as otherwise the issue claimed to be fixed with patch 5 would show up again. I'm working on addressing the comments I've received. Juergen > > Ciao, Thorsten > > [1] > https://lore.kernel.org/all/4fe9541e-4d4c-2b2a-f8c8-2d34a7284930@nerdbynature.de/ > > P.S.: BTW; let me tell regzbot to monitor this thread: > > #regzbot ^backmonitor: > https://lore.kernel.org/all/4fe9541e-4d4c-2b2a-f8c8-2d34a7284930@nerdbynature.de/ > > >> Signed-off-by: Juergen Gross <jgross@suse.com> >> --- >> arch/x86/mm/pat/memtype.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/arch/x86/mm/pat/memtype.c b/arch/x86/mm/pat/memtype.c >> index fb4b1b5e0dea..46de9cf5c91d 100644 >> --- a/arch/x86/mm/pat/memtype.c >> +++ b/arch/x86/mm/pat/memtype.c >> @@ -387,8 +387,7 @@ static unsigned long pat_x_mtrr_type(u64 start, u64 end, >> u8 mtrr_type, uniform; >> >> mtrr_type = mtrr_type_lookup(start, end, &uniform); >> - if (mtrr_type != MTRR_TYPE_WRBACK && >> - mtrr_type != MTRR_TYPE_INVALID) >> + if (mtrr_type != MTRR_TYPE_WRBACK) >> return _PAGE_CACHE_MODE_UC_MINUS; >> >> return _PAGE_CACHE_MODE_WB;
On Mon, 13 Feb 2023, Juergen Gross wrote: > On 10.02.23 19:59, Linux regression tracking (Thorsten Leemhuis) wrote: > > Hi, this is your Linux kernel regression tracker. > > > > On 09.02.23 08:22, Juergen Gross wrote: > > > Commit 90b926e68f50 ("x86/pat: Fix pat_x_mtrr_type() for MTRR disabled > > > case") has introduced a regression with Xen. > > > > > > Revert the patch. > > > > That regression you refer to is afaics one I'm tracking[1] that was > > introduced this cycle. That makes me wonder: could this patch be applied > > directly to fix the issue quickly? Or are patches 1 to 4 needed as well > > (or the whole series?) to avoid other problems? > > Patches 1-4 are needed, too, as otherwise the issue claimed to be fixed > with patch 5 would show up again. The (last?) -rc8 version was released yesterday. Would it be possible to include at least (only) the revert in mainline so that 6.2 will be released with a working storage configuration under Xen? Otherwise one would have to carry around that single revert manually until this patch series has landed in mainline, or convince all the distributions to do so :-\ Anyway, thanks for fixing this problem, I did not expect this to be such a complicated issue when I reported that thing :-) Christian.
On 13.02.23 12:46, Christian Kujau wrote: > On Mon, 13 Feb 2023, Juergen Gross wrote: >> On 10.02.23 19:59, Linux regression tracking (Thorsten Leemhuis) wrote: >>> Hi, this is your Linux kernel regression tracker. >>> >>> On 09.02.23 08:22, Juergen Gross wrote: >>>> Commit 90b926e68f50 ("x86/pat: Fix pat_x_mtrr_type() for MTRR disabled >>>> case") has introduced a regression with Xen. >>>> >>>> Revert the patch. >>> >>> That regression you refer to is afaics one I'm tracking[1] that was >>> introduced this cycle. That makes me wonder: could this patch be applied >>> directly to fix the issue quickly? Or are patches 1 to 4 needed as well >>> (or the whole series?) to avoid other problems? >> >> Patches 1-4 are needed, too, as otherwise the issue claimed to be fixed >> with patch 5 would show up again. > > The (last?) -rc8 version was released yesterday. Would it be possible to > include at least (only) the revert in mainline so that 6.2 will be > released with a working storage configuration under Xen? Hmm, this would make Hyper-V SEV-SNP guests slow again. I'm not completely against it, but OTOH I'm a little bit biased as the maintainer of the Xen code. :-) Michael, would you see major problems with doing the revert before having the final patches for fixing your issue, too? > Otherwise one would have to carry around that single revert manually until > this patch series has landed in mainline, or convince all the > distributions to do so :-\ > > Anyway, thanks for fixing this problem, I did not expect this to be such a > complicated issue when I reported that thing :-) Yes, I have opened a can of worms with my MTRR/PAT disentangling. Juergen
From: Juergen Gross <jgross@suse.com> > > On 13.02.23 12:46, Christian Kujau wrote: > > On Mon, 13 Feb 2023, Juergen Gross wrote: > >> On 10.02.23 19:59, Linux regression tracking (Thorsten Leemhuis) wrote: > >>> Hi, this is your Linux kernel regression tracker. > >>> > >>> On 09.02.23 08:22, Juergen Gross wrote: > >>>> Commit 90b926e68f50 ("x86/pat: Fix pat_x_mtrr_type() for MTRR disabled > >>>> case") has introduced a regression with Xen. > >>>> > >>>> Revert the patch. > >>> > >>> That regression you refer to is afaics one I'm tracking[1] that was > >>> introduced this cycle. That makes me wonder: could this patch be applied > >>> directly to fix the issue quickly? Or are patches 1 to 4 needed as well > >>> (or the whole series?) to avoid other problems? > >> > >> Patches 1-4 are needed, too, as otherwise the issue claimed to be fixed > >> with patch 5 would show up again. > > > > The (last?) -rc8 version was released yesterday. Would it be possible to > > include at least (only) the revert in mainline so that 6.2 will be > > released with a working storage configuration under Xen? > > Hmm, this would make Hyper-V SEV-SNP guests slow again. > > I'm not completely against it, but OTOH I'm a little bit biased as the > maintainer of the Xen code. :-) > > Michael, would you see major problems with doing the revert before having > the final patches for fixing your issue, too? > I'm OK with doing the revert. It's probably the right tradeoff for the broader community because the Hyper-V use case is more narrow and requires more curation for other reasons. The use case is the Azure public cloud, and we can pretty much make sure that one of the solutions is applied to kernels used with SEV-SNP in that environment. Michael > > Otherwise one would have to carry around that single revert manually until > > this patch series has landed in mainline, or convince all the > > distributions to do so :-\ > > > > Anyway, thanks for fixing this problem, I did not expect this to be such a > > complicated issue when I reported that thing :-) > > Yes, I have opened a can of worms with my MTRR/PAT disentangling. > > > Juergen
On 13.02.23 18:01, Michael Kelley (LINUX) wrote: > From: Juergen Gross <jgross@suse.com> >> >> On 13.02.23 12:46, Christian Kujau wrote: >>> On Mon, 13 Feb 2023, Juergen Gross wrote: >>>> On 10.02.23 19:59, Linux regression tracking (Thorsten Leemhuis) wrote: >>>>> Hi, this is your Linux kernel regression tracker. >>>>> >>>>> On 09.02.23 08:22, Juergen Gross wrote: >>>>>> Commit 90b926e68f50 ("x86/pat: Fix pat_x_mtrr_type() for MTRR disabled >>>>>> case") has introduced a regression with Xen. >>>>>> >>>>>> Revert the patch. >>>>> >>>>> That regression you refer to is afaics one I'm tracking[1] that was >>>>> introduced this cycle. That makes me wonder: could this patch be applied >>>>> directly to fix the issue quickly? Or are patches 1 to 4 needed as well >>>>> (or the whole series?) to avoid other problems? >>>> >>>> Patches 1-4 are needed, too, as otherwise the issue claimed to be fixed >>>> with patch 5 would show up again. >>> >>> The (last?) -rc8 version was released yesterday. Would it be possible to >>> include at least (only) the revert in mainline so that 6.2 will be >>> released with a working storage configuration under Xen? >> >> Hmm, this would make Hyper-V SEV-SNP guests slow again. >> >> I'm not completely against it, but OTOH I'm a little bit biased as the >> maintainer of the Xen code. :-) >> >> Michael, would you see major problems with doing the revert before having >> the final patches for fixing your issue, too? >> > > I'm OK with doing the revert. It's probably the right tradeoff for the > broader community because the Hyper-V use case is more narrow and > requires more curation for other reasons. The use case is the Azure > public cloud, and we can pretty much make sure that one of the solutions > is applied to kernels used with SEV-SNP in that environment. Thanks. Boris, would you take the revert (patch 5 of my series) via x86/urgent, please? Juergen
On Mon, 13 Feb 2023, Juergen Gross wrote: > Hmm, this would make Hyper-V SEV-SNP guests slow again. > > I'm not completely against it, but OTOH I'm a little bit biased as the > maintainer of the Xen code. :-) Understood. I'm a bit puzzled why nobody else reports this, maybe Xen Dom0 and external USB enclosures are not that common. > Michael, would you see major problems with doing the revert before having > the final patches for fixing your issue, too? If that revert ends up in mainline, feel free to add: Tested-by: Christian Kujau <lists@nerdbynature.de> ...if that makes any difference. Thanks, Christian.
On 13.02.23 23:54, Christian Kujau wrote: > On Mon, 13 Feb 2023, Juergen Gross wrote: >> Hmm, this would make Hyper-V SEV-SNP guests slow again. >> >> I'm not completely against it, but OTOH I'm a little bit biased as the >> maintainer of the Xen code. :-) > > Understood. I'm a bit puzzled why nobody else reports this, maybe Xen Dom0 > and external USB enclosures are not that common. Not all USB drivers/interfaces have this problem. Your problems are with: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05) while a system I'm working with the following has no problems: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 04) The only difference seems to be the revision of your adapter. > >> Michael, would you see major problems with doing the revert before having >> the final patches for fixing your issue, too? > > If that revert ends up in mainline, feel free to add: > > Tested-by: Christian Kujau <lists@nerdbynature.de> Thanks, Juergen
diff --git a/arch/x86/mm/pat/memtype.c b/arch/x86/mm/pat/memtype.c index fb4b1b5e0dea..46de9cf5c91d 100644 --- a/arch/x86/mm/pat/memtype.c +++ b/arch/x86/mm/pat/memtype.c @@ -387,8 +387,7 @@ static unsigned long pat_x_mtrr_type(u64 start, u64 end, u8 mtrr_type, uniform; mtrr_type = mtrr_type_lookup(start, end, &uniform); - if (mtrr_type != MTRR_TYPE_WRBACK && - mtrr_type != MTRR_TYPE_INVALID) + if (mtrr_type != MTRR_TYPE_WRBACK) return _PAGE_CACHE_MODE_UC_MINUS; return _PAGE_CACHE_MODE_WB;