Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp852025rwb; Sat, 13 Aug 2022 10:06:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR5RnzcmSaeyAItn79lNo0s7Xz634BlxbHVcj1ESWXs9/RFF8L7da2JBJrlr8yZ9eRbLdDTw X-Received: by 2002:a63:5b61:0:b0:41d:3227:37b8 with SMTP id l33-20020a635b61000000b0041d322737b8mr7382205pgm.265.1660410418146; Sat, 13 Aug 2022 10:06:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660410418; cv=none; d=google.com; s=arc-20160816; b=En0zE66VhNFUnHRhVvY6h5MqfThshIqrGAyxv5Dh2dqoBYIrm+Wz8D+N95PeTOUENs VbAMDqhdPsX/DmlHhxQj1u5O6Mz0AijYQXewHo3O+a4Jyd+Vwb5f16vq7ebS4/knIEiV gkDXWZejNVwLV5p1/6xGM9ExCJBcyo3ZIgE76YoZgXy1u4UwK5bVtdDrpjGFUg+ULanz Fsld+OdMtvukfWKi2RtHqi6377WYpOGBZItRvbepawvYiw+QRUT8LSmdZCXZzU3VrzoN METnrYc8EuipXTeZnwj1LtzGgOE11rylC7pGK8N7swewtRSb8g6pxsoxefgoSfoI0Ka1 XJrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:cc:to:subject:from:user-agent :mime-version:date:message-id:dkim-signature; bh=QRQBPbaJj2JGJe+PhZxZ66B9bo7GJ0cjESR5eyJpCvU=; b=n6E62V0trM19ClzUuHHUfHaw+j1MoQyhuJYKUCj2odsLzv0ubfYPiX3al6Y39pQRwU 5vE5/Qh1XoSjYt55WFtwK+y2vZR3dbj/M6SwAo8AeNMF7W1zNReWLdiHAmfYyruergr+ AmdPfCzJBf1fZzKP7NRhlbXCFGCdQ5NopM3vXk1ehG3z9pz5TEwwGln0bLPhw24eslzN 7nF/HN2HBy2vXuR75HioPGv2P/0K9sQNdwmWa3H5rheCGgwQdJERjnDAko8dnrHNr5/0 ImePCXrZ3pdlNfC1cN+l+uwbowXTppZ+ZkbNDaYuC72Ptt/NnrKWJ8vjIhgFc3w2QlCM FwxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netscape.net header.s=a2048 header.b=hytzFYTp; 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=REJECT sp=REJECT dis=NONE) header.from=netscape.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r24-20020a6560d8000000b0041cfc9ef388si5985712pgv.159.2022.08.13.10.06.44; Sat, 13 Aug 2022 10:06:58 -0700 (PDT) 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=@netscape.net header.s=a2048 header.b=hytzFYTp; 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=REJECT sp=REJECT dis=NONE) header.from=netscape.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239731AbiHMQ4x (ORCPT + 99 others); Sat, 13 Aug 2022 12:56:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239810AbiHMQ4v (ORCPT ); Sat, 13 Aug 2022 12:56:51 -0400 Received: from sonic313-19.consmr.mail.gq1.yahoo.com (sonic313-19.consmr.mail.gq1.yahoo.com [98.137.65.82]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 334A82C67B for ; Sat, 13 Aug 2022 09:56:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netscape.net; s=a2048; t=1660409809; bh=QRQBPbaJj2JGJe+PhZxZ66B9bo7GJ0cjESR5eyJpCvU=; h=Date:From:Subject:To:Cc:References:In-Reply-To:From:Subject:Reply-To; b=hytzFYTpa9PgpMH6rZ9sGrwc/r7N0xW6ezurFyh5z9CrY3cimzqLcKCLaKjQyHy6G8Y3uiNkC+jJMEKq6Pq7YOaPy5Uo7dSXqIbvbFAel17Udl3HxZg7M0o1bbP6Soz65qeGl2PTp2WNF0e47KpkddlI1Srmh6lwF1sODjDdAwj++xA+yIFC+f13uSJJLbXErjpSUdGGz59RBXnWMdqJYsnfMvGFVrYVzTh7sSqHE/yViYcsNtbg7tYDykb2oTnKyXOWZmikKtqcrderry3CZP7Nlkc99STBcHlaa7gkMYItWfZpB350t1oQNHmRhQUss2dPW6c1eJsSEyD2di3fIg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1660409809; bh=yQZ3P0IsqeiiA0dZkrTD1G4Z78sLpvW9+sAwKLNlpvB=; h=X-Sonic-MF:Date:From:Subject:To:From:Subject; b=a5qeST9hBIrEJHEpCcI5wrk6ei/TujAmWFR98I8nTh14/LvpB4fLfCOVnv2H4rgiIUQxR5sXNjDaDT80+M8SpCuTimq8s5opyEQZmZWYeDC6wZLFQxUZ7jxQadr7K35YldC2GtOlqdl+6T5QbCQs+eUmYc/GbPb7TS1G4p2suMAtNl812eG988wICOKWH9VBlD+lLa6/D9xk2NAtJUSPkiVutsQPA7p1D/F+sUc8CmwaDThIyMNem8lBN52SOgCENgf29DT+D/zBcKwtoEZ31IoJiCDhxtahQnLaZUPkhTaOu/B1B2zls4TbmwCpvu+aNQO2Uj/AFAlpyMJgx+KkUQ== X-YMail-OSG: OQbhtbUVM1nOQ6jnLdzPWPN_bd55lZ6LHInmMNByAOaV9HSItHoQ4qvwJwUcttV e4nvHeMobRWrL6nfaT4j9cGFc3_RMhHDalf7g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3BOkpiV.UJvA4zsNhdIIxK BdBLb7UygVYN1O7h16PCUlwOmWC76Z9Lxvy8lMiXYbNhCwK1zOcQF9OLjW1OR9HcuATM8JJpSEF. 6._m8e4umqWdXYoBRCv3GesC5y7Rv1FTkjic- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.gq1.yahoo.com with HTTP; Sat, 13 Aug 2022 16:56:49 +0000 Received: by hermes--production-ne1-6649c47445-tz6bb (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 66f3ba59478f3bc107a9b6db1aef8ef8; Sat, 13 Aug 2022 16:56:46 +0000 (UTC) Message-ID: Date: Sat, 13 Aug 2022 12:56:44 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 From: Chuck Zmudzinski Subject: Re: PING [PATCH 3/3] x86: decouple pat and mtrr handling To: Borislav Petkov , Juergen Gross , Thorsten Leemhuis , Jan Beulich Cc: xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Dave Hansen , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Boris Ostrovsky , regressions@lists.linux.dev References: <20220715142549.25223-1-jgross@suse.com> <20220715142549.25223-4-jgross@suse.com> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailer: WebService/1.1.20531 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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: X-Mailing-List: linux-kernel@vger.kernel.org On 7/19/22 11:15 AM, Borislav Petkov wrote: > On Fri, Jul 15, 2022 at 04:25:49PM +0200, Juergen Gross wrote: > > Today PAT is usable only with MTRR being active, with some nasty tweaks > > to make PAT usable when running as Xen PV guest, which doesn't support > > MTRR. > > > > The reason for this coupling is, that both, PAT MSR changes and MTRR > > changes, require a similar sequence and so full PAT support was added > > using the already available MTRR handling. > > > > Xen PV PAT handling can work without MTRR, as it just needs to consume > > the PAT MSR setting done by the hypervisor without the ability and need > > to change it. This in turn has resulted in a convoluted initialization > > sequence and wrong decisions regarding cache mode availability due to > > misguiding PAT availability flags. > > > > Fix all of that by allowing to use PAT without MTRR and by adding an > > environment dependent PAT init function. > > Aha, there's the explanation I was looking for. > > > diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c > > index 0a1bd14f7966..3edfb779dab5 100644 > > --- a/arch/x86/kernel/cpu/common.c > > +++ b/arch/x86/kernel/cpu/common.c > > @@ -2408,8 +2408,8 @@ void __init cache_bp_init(void) > > { > > if (IS_ENABLED(CONFIG_MTRR)) > > mtrr_bp_init(); > > - else > > - pat_disable("PAT support disabled because CONFIG_MTRR is disabled in the kernel."); > > + > > + pat_cpu_init(); > > } > > > > void cache_ap_init(void) > > @@ -2417,7 +2417,8 @@ void cache_ap_init(void) > > if (cache_aps_delayed_init) > > return; > > > > - mtrr_ap_init(); > > + if (!mtrr_ap_init()) > > + pat_ap_init_nomtrr(); > > } > > So I'm reading this as: if it couldn't init AP's MTRRs, init its PAT. > > But currently, the code sets the MTRRs for the delayed case or when the > CPU is not online by doing ->set_all and in there it sets first MTRRs > and then PAT. > > I think the code above should simply try the two things, one after the > other, independently from one another. > > And I see you've added another stomp machine call for PAT only. > > Now, what I think the design of all this should be, is: > > you have a bunch of things you need to do at each point: > > * cache_ap_init > > * cache_aps_init > > * ... > > Now, in each those, you look at whether PAT or MTRR is supported and you > do only those which are supported. > > Also, the rendezvous handler should do: > > if MTRR: > do MTRR specific stuff > > if PAT: > do PAT specific stuff > > This way you have clean definitions of what needs to happen when and you > also do *only* the things that the platform supports, by keeping the > proper order of operations - I believe MTRRs first and then PAT. > > This way we'll get rid of that crazy maze of who calls what and when. > > But first we need to define those points where stuff needs to happen and > then for each point define what stuff needs to happen. > > How does that sound? > > Thx. > Hi Thorsten, IMHO, silence here is unacceptable given that this is supposed to be fixing a regression and not just adding a new feature or re-working the code in a case where there is no regression. The regression was first reported on May 4, 2022, now over three months ago: https://lore.kernel.org/regressions/YnHK1Z3o99eMXsVK@mail-itl/ Why has Juergen not at least responded in some way to the comments that Boris has made here? Why has Boris not pinged Juergen by now, which is almost four weeks after his comment and over three months from the first report of the regression? IMHO, both Juergen and Boris are not treating this with the priority of a regression fix. At the very least, they should reaffirm their commitment to fix the regression in a timely manner or explain what factors demand that the Linus regression rule be set aside in this case. There are valid reasons to delay a fix, but in all the discussion of the various patches that have been proposed to fix this regression, no maintainer has yet given a clear and reasonable explanation for why this is not getting a higher priority from the developers. Some developers, (Dave, Luto, and Peter) have ignored a fix proposed by Jan Beulich as you pointed out in an earlier message to Jan Beulich here: https://lore.kernel.org/lkml/4c8c9d4c-1c6b-8e9f-fa47-918a64898a28@leemhuis.info/ To his credit, Jan Beulich replied to your message in a reasonable manner but he also could not explain why Dave, Luto, and Peter ignored Jan's patch and remain silent in the discussion of the possible fixes for this regression. I note also that the original report of the regression identified a specific commit that also fixes the regression if that bad commit is reverted, and that commit is also mentioned in the aforementioned message to Jan about his proposed fix. It is a commit that lives in the i915 Intel GPU/DRM driver, commit bdd8b6c98239, and my testing confirms the regression can also be fixed by reverting bdd8b6c98239 instead of applying Jan Beulich's patch that was the subject of the aforementioned message from you to Jan Beulich where you also expressed your dissatisfaction with the silence of some developers (Dave, Lotu, and Peter) when there is a regression that needs fixing. Why their silence? In that same message, you pondered that it might be necessary to bring this matter to Linus' attention. The developers' silence makes me think this regression is a regression the developers do not want to fix. And that would be a clear violation of the Linux regression rule if it were true. So, Thorsten, I think it is time for you to elevate this to Linus if the developers do not clearly explain why they are ignoring this again. Best regards, Chuck