Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2583546iog; Sun, 19 Jun 2022 23:22:00 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s9Tp5uuao/pEkhlhlJAU2hJeFNWsg/vI/OgysLitBeLhvHTW09N2/ERdk/hB6sYkr2fB+b X-Received: by 2002:a17:90a:17a6:b0:1ec:74e4:d7a3 with SMTP id q35-20020a17090a17a600b001ec74e4d7a3mr17795248pja.115.1655706120752; Sun, 19 Jun 2022 23:22:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655706120; cv=none; d=google.com; s=arc-20160816; b=umB/CYpC/7PG9Uduz9lG7/9K2Sfn/mni2bBgbuybJnLwPRQcx8jvNevI61xdvjXDs/ fQawg8euy6+KmFz0jS2eWYkr4wmn1SBLco1XRd7y239NR0LbpmTL8K5QetJl0Tic2Tcy bVwzBpsnk46YwR9g4OJyNuEhkAfqGBA1zjhmr1+AK8Jc5NZIpO6/MAx4nH0k2I6uHX8q 3ysoJhjC7ylYBASSdLVCGsFtKWjhtabR2YrG3cKTNgJGLr1aspfz25xBt3YzA6Uxw6Hm BdlyviNM1eJCHGKv6LZZPcniEWq1qowP6wTgbrB/BEcyP5H8BUHCC/OKmwDFV9vfHYZh kNTA== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=1NQoloVhxLFm7LKwL6+8e+oxnySe/3dn0af95hulw7w=; b=PE/N6LhA1eAgWCXEQ0GEbrex7sJxUFkYOBueGnpMZ8k+p91/qG1naWxZ246XhL/FV0 6NJ/Ea/KX+Z2Q7XDKnzif4rsEADXbC4XLVoXGGK1YVsX7PU6ikh12dvQRSpBgRv6eCpY ffm+r5Z+22FuH3dz9C2GjK0XGfZSUTOS6zhj+8TnrTombrG49RArL9Dh+1NpovEpIUFL wV9q0RNy+DN0l7bwCGFkMKP73m/ffulseyF7SXqzqn6FYWTCJhxXzUW/P2XwLwR29AHG bEogK0oBcLKiIrRR83gGO6Ffb/oJbR8oOg7XVweNoIQTBIB/otjgh0UKvXzJg9KNLrV8 lzOg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 83-20020a630456000000b003fe36012904si14092839pge.145.2022.06.19.23.21.49; Sun, 19 Jun 2022 23:22:00 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238194AbiFTGPw (ORCPT + 99 others); Mon, 20 Jun 2022 02:15:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233453AbiFTGPu (ORCPT ); Mon, 20 Jun 2022 02:15:50 -0400 Received: from wp530.webpack.hosteurope.de (wp530.webpack.hosteurope.de [IPv6:2a01:488:42:1000:50ed:8234::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C2D263BC for ; Sun, 19 Jun 2022 23:15:49 -0700 (PDT) Received: from [2a02:8108:963f:de38:eca4:7d19:f9a2:22c5]; authenticated by wp530.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1o3AhO-0007Pt-KS; Mon, 20 Jun 2022 08:15:46 +0200 Message-ID: Date: Mon, 20 Jun 2022 08:15:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 1/2] x86/pat: fix x86_has_pat_wp() Content-Language: en-US To: Juergen Gross , xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Dave Hansen , Borislav Petkov Cc: jbeulich@suse.com, Andy Lutomirski , Peter Zijlstra , "H. Peter Anvin" References: <20220503132207.17234-1-jgross@suse.com> <20220503132207.17234-2-jgross@suse.com> From: Thorsten Leemhuis In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-bounce-key: webpack.hosteurope.de;regressions@leemhuis.info;1655705749;385cc5f6; X-HE-SMSGID: 1o3AhO-0007Pt-KS X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org On 20.06.22 07:30, Juergen Gross wrote: > On 20.06.22 07:22, Thorsten Leemhuis wrote: >> On 14.06.22 17:09, Juergen Gross wrote: >>> On 03.05.22 15:22, Juergen Gross wrote: >>>> x86_has_pat_wp() is using a wrong test, as it relies on the normal >>>> PAT configuration used by the kernel. In case the PAT MSR has been >>>> setup by another entity (e.g. BIOS or Xen hypervisor) it might return >>>> false even if the PAT configuration is allowing WP mappings. >>>> >>>> Fixes: 1f6f655e01ad ("x86/mm: Add a x86_has_pat_wp() helper") >>>> Signed-off-by: Juergen Gross >>>> --- >>>>    arch/x86/mm/init.c | 3 ++- >>>>    1 file changed, 2 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c >>>> index d8cfce221275..71e182ebced3 100644 >>>> --- a/arch/x86/mm/init.c >>>> +++ b/arch/x86/mm/init.c >>>> @@ -80,7 +80,8 @@ static uint8_t __pte2cachemode_tbl[8] = { >>>>    /* Check that the write-protect PAT entry is set for >>>> write-protect */ >>>>    bool x86_has_pat_wp(void) >>>>    { >>>> -    return __pte2cachemode_tbl[_PAGE_CACHE_MODE_WP] == >>>> _PAGE_CACHE_MODE_WP; >>>> +    return >>>> __pte2cachemode_tbl[__cachemode2pte_tbl[_PAGE_CACHE_MODE_WP]] == >>>> +           _PAGE_CACHE_MODE_WP; >>>>    } >>>>      enum page_cache_mode pgprot2cachemode(pgprot_t pgprot) >>> >>> x86 maintainers, please consider taking this patch, as it is fixing >>> a real bug. Patch 2 of this series can be dropped IMO. >> >> Juergen, can you help me out here please. Patch 2 afaics was supposed to >> fix this regression I'm tracking: >> https://lore.kernel.org/regressions/YnHK1Z3o99eMXsVK@mail-itl/ > No, patch 2 wasn't covering all needed cases. Ahh, happens. Thx for the info. >> Is Patch 1 alone enough to fix it? Or is there a different fix for it? > Patch 1 is fixing a different issue (it is lacking any maintainer > feedback, though). > > This patch of Jan should do the job, but it seems to be stuck, too: > https://lore.kernel.org/lkml/9385fa60-fa5d-f559-a137-6608408f88b0@suse.com/ Ahh. Fun fact: that was on my list of things to prod, too. >> Or is there some other solution to finally fix that regressions that >> ideally should have been fixed weeks ago already? > > I agree it should have been fixed quite some time now, but the x86 > maintainers don't seem to be interested in those stuck patches. :-( > > Maybe I should take a different approach: > > x86 maintainers, please speak up if you NAK (or Ack) any of above two > patches. > In case you don't NAK or take the patches, I'm inclined to carry them via > the Xen tree to get the issues fixed. Yeah, I'd be really glad if we could find a solution for this situation and get it finally fixed in mainline and backported to stable. Ciao, Thorsten