Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1372991imw; Sat, 16 Jul 2022 05:18:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uh+r5DRN4it+r+f1Ah3aZOVkclvgIsTBnMSL1BXrotc2ntbpVWVHXjWrMf0UeP31ISmz7U X-Received: by 2002:a17:907:97d1:b0:72e:5ee:2ea8 with SMTP id js17-20020a17090797d100b0072e05ee2ea8mr15012910ejc.592.1657973899388; Sat, 16 Jul 2022 05:18:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657973899; cv=none; d=google.com; s=arc-20160816; b=R+KXghuFDZJSt9CxpofCkM2a7PDA6QwZz4GgIK4NskOZ5QBC1ZxK8o2icEZPM/149A Dtcluha2aDalMYRO1cFHyaFjByiTrcaGOP48BRuL4yqeAtIkbyrwgYEKrdj4LSwfc1We MYawdCQ7WANN/EGqfT42zECkoz5NPLCigQgH92OXhM1pZw95xIY5xZm8ypd66Ko9nt8a UL/ron0RJLwtcXDBoYutWsIlSF3hji0QvtBv2W+slw2aXfA2FcPeQ+EAp/GcrCCRLRfq XcSQLWDlpuTmYfaatJGrSq0pohPYfn+0uQXueCkcKeQ2+/bIPHEki2jMSpHZCaflWA4C K+vg== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=DAM/bEP7xnNDHYTVl67GsU8rgaN43Xl0MJMznYJcJ8k=; b=EVat/puk626Srur5tujiGzN4mDRWKH/5xsiF4PP0kFm9UXEEIrrxE+KKQR0YhWRUR3 GOKRVUFj6CF86KWwNHR2wtDW7iYTx50mCqD8PL837LmlW85O80Gts57hynW4fYPEw/5c gb9ljGvCV8GWu+3QwRaCMIahsVS5jBT2uY57vEsdrVUi6T/egBgao1mwZgrJO1OZuPn/ JUWM3xEo/fPDJhrKY2eNKfvwP4rY3t6pNfJzJ4tvk5741fkQ0C+czkXRWhbIwFxDlB02 jW9833kh/wKYGcjEdt3OGlMC875vgmLwYxAYkAZEgCxMDw8BqfwYP1rNUeO8jEU5zidG t6Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netscape.net header.s=a2048 header.b=NP41fgjA; 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 m12-20020a056402510c00b0043ae850a263si11234016edd.189.2022.07.16.05.17.55; Sat, 16 Jul 2022 05:18:19 -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=NP41fgjA; 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 S231366AbiGPMDb (ORCPT + 99 others); Sat, 16 Jul 2022 08:03:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230273AbiGPMD3 (ORCPT ); Sat, 16 Jul 2022 08:03:29 -0400 Received: from sonic304-51.consmr.mail.gq1.yahoo.com (sonic304-51.consmr.mail.gq1.yahoo.com [98.137.68.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D45A24085 for ; Sat, 16 Jul 2022 05:03:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netscape.net; s=a2048; t=1657973005; bh=DAM/bEP7xnNDHYTVl67GsU8rgaN43Xl0MJMznYJcJ8k=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From:Subject:Reply-To; b=NP41fgjAshEYihUjHn3vCQb5C01OBhdiioWHeY+5uv9KuLa77wA7bT4hLSKPulU9KLcAuP8QA/fWGSI/yZJA1J53tBLGn2vbgKWXokQTnrcbThcmY51hB54mvG7ddAD0Wnpot/g0gSYer8FzyjqSPTryrZeVmZn1hX0f/lg0TroTzRgwBPluhI7HciiC40Day7CFXrIGeYs65PK4bH93MSmaFjMgNs+UzoohkjzYIGCc3wlzqGYn3x+erVkcQerCs5WN6pTr53KiTbZ6J6PgqpoXcMC+xxdIJCiGDKBMLr7Dp9J4G09dumyL6/8978uBPTD3hoKxiQZPGsDtKO3tNQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1657973005; bh=+hW1DQW7YFURSc4bkniM2nFGuTDWQjmcm2vfVIrE9Y4=; h=X-Sonic-MF:Date:Subject:From:To:From:Subject; b=Q6+0mwXVEJtGc2uIcAK2YSoWUszCUKu85XQX8U7hqhjlvxPOQRVEwEsrLx+6kSqiaoRGpbJZDkjYx5teYXBtqd39zPFyESjBxiMIIAoxyYY/P/sg5EsLND0AMHNKLb1hGvUvdbqGzYGuBbNQBjGcLbRdcyIz9yXF/gMSJBkg+n1NKsk1WjfKJcQN5YdZ7qfJCKqceeA2LhRmJlfOz6IiFoGup9N8FQrO4e9qyAq1StQPeRKPtFq1bkyYS6Vw/gxh/SOK5FEBq9FSYYXeK+L2sADzU4HxpjBm/yE//2mb/TQoame8aHGwjG4AJAcuo7MLPB/S79SHpr9tbDBBLgn9hw== X-YMail-OSG: UyYPEY8VM1knZXXCuCD9X7SMCCLHmK47it_NQ7T3OD6p35j98RQWU0OArQdTxwE Tv5lMIOAFO6E2gQX.W6NBOoIY59Fn9QsdL0WKVOpcQqcUkJM3Yzp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PIbM x9HwiLw7xhm4AIwJ4Xh.Op5rnDa2W1MPm X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Sat, 16 Jul 2022 12:03:25 +0000 Received: by hermes--production-bf1-58957fb66f-qrtmg (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 15342210b74ec2b3efb792f6ae39851b; Sat, 16 Jul 2022 12:01:22 +0000 (UTC) Message-ID: Date: Sat, 16 Jul 2022 08:01:22 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 0/3] x86: make pat and mtrr independent from each other Content-Language: en-US From: Chuck Zmudzinski To: Juergen Gross , xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Thorsten Leemhuis Cc: jbeulich@suse.com, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , "# 5 . 17" , "Rafael J. Wysocki" , Pavel Machek , Andy Lutomirski , Peter Zijlstra , Boris Ostrovsky References: <20220715142549.25223-1-jgross@suse.com> <7bf307c7-0b05-781b-a2a3-19b47589eb8a@netscape.net> In-Reply-To: <7bf307c7-0b05-781b-a2a3-19b47589eb8a@netscape.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailer: WebService/1.1.20407 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 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/16/2022 7:32 AM, Chuck Zmudzinski wrote: > On 7/15/2022 10:25 AM, Juergen Gross wrote: > > Today PAT can't be used without MTRR being available, unless MTRR is at > > least configured via CONFIG_MTRR and the system is running as Xen PV > > guest. In this case PAT is automatically available via the hypervisor, > > but the PAT MSR can't be modified by the kernel and MTRR is disabled. > > > > As an additional complexity the availability of PAT can't be queried > > via pat_enabled() in the Xen PV case, as the lack of MTRR will set PAT > > to be disabled. This leads to some drivers believing that not all cache > > modes are available, resulting in failures or degraded functionality. > > > > The same applies to a kernel built with no MTRR support: it won't > > allow to use the PAT MSR, even if there is no technical reason for > > that, other than setting up PAT on all cpus the same way (which is a > > requirement of the processor's cache management) is relying on some > > MTRR specific code. > > > > Fix all of that by: > > > > - moving the function needed by PAT from MTRR specific code one level > > up > > - adding a PAT indirection layer supporting the 3 cases "no or disabled > > PAT", "PAT under kernel control", and "PAT under Xen control" > > - removing the dependency of PAT on MTRR > > > > Juergen Gross (3): > > x86: move some code out of arch/x86/kernel/cpu/mtrr > > x86: add wrapper functions for mtrr functions handling also pat > > x86: decouple pat and mtrr handling > > > > arch/x86/include/asm/memtype.h | 13 ++- > > arch/x86/include/asm/mtrr.h | 27 ++++-- > > arch/x86/include/asm/processor.h | 10 +++ > > arch/x86/kernel/cpu/common.c | 123 +++++++++++++++++++++++++++- > > arch/x86/kernel/cpu/mtrr/generic.c | 90 ++------------------ > > arch/x86/kernel/cpu/mtrr/mtrr.c | 58 ++++--------- > > arch/x86/kernel/cpu/mtrr/mtrr.h | 1 - > > arch/x86/kernel/setup.c | 12 +-- > > arch/x86/kernel/smpboot.c | 8 +- > > arch/x86/mm/pat/memtype.c | 127 +++++++++++++++++++++-------- > > arch/x86/power/cpu.c | 2 +- > > arch/x86/xen/enlighten_pv.c | 4 + > > 12 files changed, 289 insertions(+), 186 deletions(-) > > > > This patch series seems related to the regression reported > here on May 5, 2022: I'm sorry, the date of that report was May 4, 2022, not May 5, 2022 - just to avoid any doubt about which regression I am referring to. Chuck > > https://lore.kernel.org/regressions/YnHK1Z3o99eMXsVK@mail-itl/ > > I am experiencing that regression or a very similar regression that is caused by the same commit: bdd8b6c98239cad ("drm/i915: replace X86_FEATURE_PAT with pat_enabled()") > and could test this patch > on my system. > > Can you confirm that with this patch series you are trying > to fix that regression? > > Chuck Chuck