Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1348636imw; Sat, 16 Jul 2022 04:49:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sNCIDx2dgW7GLle1b2XOXqM5sI7kTPRVtdrL1fQBpl2L77JcV2IiyllkbWkT2jIwIHRjE7 X-Received: by 2002:a17:907:7355:b0:72b:4a31:ba39 with SMTP id dq21-20020a170907735500b0072b4a31ba39mr17511891ejc.490.1657972151443; Sat, 16 Jul 2022 04:49:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657972151; cv=none; d=google.com; s=arc-20160816; b=KZtqW6cNYQVgpfg/VDZUlXW6+PnoK+EX/Za1QneUk3srdfR/dVRG+CXB6MOwEN+Yub TGkWfjGRoKxU1fPwReTu+xG1ZWHf//YMkAv96erqI1b4JRp5ufwAwOvdiApkhT3FdLnI wBXwySXO+xtF7iOA81wQEMmWG457KGIpXZiyEgdkpQ9NFwao0knI0LhbBvkvVK1BpFmi xYUXGmh9c7mDh4JwAcMEfCJ4paLTQdJyl5AkDq7gztuP6vUkzDmQPMQMSpFB7gtH5W84 A6LTPL5TY93blmRjdJK79k6c3XHM8iMxPR2mbKhSRBvjo0naOigCaDRU4lEAeQSlu563 9Ggg== 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:dkim-signature; bh=LEI6S1S45c0ysUsshBMGHEIFmmv3MJEhsY6+MP0Z5zs=; b=eIifznJhDP+w6wjpSKPlwvGk0CDX5/OdKBH7rpUTBbWF+DzDvvwGeWhZK10BaUcYuh qMPOR6/454FRaGsPjA69YZwdoEQ3atoIs2/R3XcQ9di+RpwSTX2smEcNiIZiX35MLttH Da2fPF/fukNOTmKNwG1AhnW+wyHUMtXYMPq/ReZnP17iXXgYI9YTofdt0HwjLKDf9ITm MnuBPjGbP/2VbyAAHDSwqJ6OsGgNZ30OXqssggltEkVej9J1y/C2tjs1bzpmyw74+yE+ iiydX6sF0QBPbJmwCNRB9G5zuF8gCKNGb+f4Q1nweviKkd4qrYNrZhHv3jT69drmUn8A rhDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netscape.net header.s=a2048 header.b=Aj3lS59Q; 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 a3-20020a17090640c300b006e7fe1e4eb4si7857752ejk.847.2022.07.16.04.48.46; Sat, 16 Jul 2022 04:49:11 -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=Aj3lS59Q; 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 S230231AbiGPLev (ORCPT + 99 others); Sat, 16 Jul 2022 07:34:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229961AbiGPLeu (ORCPT ); Sat, 16 Jul 2022 07:34:50 -0400 Received: from sonic308-33.consmr.mail.gq1.yahoo.com (sonic308-33.consmr.mail.gq1.yahoo.com [98.137.68.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D90B11F2F5 for ; Sat, 16 Jul 2022 04:34:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netscape.net; s=a2048; t=1657971288; bh=LEI6S1S45c0ysUsshBMGHEIFmmv3MJEhsY6+MP0Z5zs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=Aj3lS59QpKn7iZ0gu1MOr37rgo48nRFJsUSPgOf5ll1wdJegWI54r58e6bjdfzeGzt0m/e7Lcd0zi979wv7CyjMku0ttz6bSDS4tA33g7SF0t6ENkgNJ+rtIr81NNBSpJlnIQkeeiulUlgWLV//1+UlzcPdEw7YwDxzeffC8fxjTRgb0+L+5lDzUv+F9kasQA/pazxPZQTqzdpJqN31keotHeqnQlOMHeH/trlmfpMkrSQJmQlHS84l+cDH9PocyG+6dgZvLfQNESObZNT9FFRjDsaeeXSNIRxlYZrlt7/B3ViIMYvzPntiM/RNOgvXkHklrL+97pNvWQaJoZuyv/g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1657971288; bh=P+xRlcqAf7oAGWwcEzcEHvfoMpdDoaZHpquMHbj+jBb=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=pxa7gcl/n4iqc/++FiDk5cpDKdfp451G2HdLmOZINMA9OAVzDWQKEwc2Js924ahR8kyRfIg456poTplfiqC96N6cjOxOJKABHhGVoytu1NKK4DOZjuh36X/DekITU+dMfKXRJOqHk3r7Rkh68cVSUFj+YxM1Jt6KBYmfeQI5ISSNWUvLGAqhW1y2oEVkj34QX819MB3ks2nOFm2IqeS+OepWxaVQUt4Wx5WxNVqF6BVY5Gs3vtB4VLq9aSjt4NPQrPLQBPKu0LDaX61qJBw4GTwD1/yUzsd8xknW5/2BVowLJq/mWOZLoNpeqq6/Z7sAI5tL4H3qoapRDi21AukPHw== X-YMail-OSG: 5v5_HrEVM1lgnRTJCZlWRbByKxEcIclSxi2uREnsMN7EUy9Ha3Mry9KtjmJWRfk umPMoBMmcW5SmJ9Wwde2GtauvclJVmOvWDLgfAfPEg7rAp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YIhtx.AwVJHChO ybFblTUzWbzGxnXObLfaX7yBlkG9qZA-- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.gq1.yahoo.com with HTTP; Sat, 16 Jul 2022 11:34:48 +0000 Received: by hermes--production-ne1-7864dcfd54-hwfdm (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 624a151775341492620246c559b32b79; Sat, 16 Jul 2022 11:32:46 +0000 (UTC) Message-ID: <7bf307c7-0b05-781b-a2a3-19b47589eb8a@netscape.net> Date: Sat, 16 Jul 2022 07:32:46 -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 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> From: Chuck Zmudzinski In-Reply-To: <20220715142549.25223-1-jgross@suse.com> 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/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: https://lore.kernel.org/regressions/YnHK1Z3o99eMXsVK@mail-itl/ I am experiencing that regression and could test this patch on my system. Can you confirm that with this patch series you are trying to fix that regression? Chuck