Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4705817imw; Tue, 12 Jul 2022 12:44:59 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uGK2hyhOX7nrhcRddDgTTuUPOKSB0FYev8ukBv8OqF+Bv4ftD7xag98v5Vikcv/Tcrcwno X-Received: by 2002:a65:45c7:0:b0:412:6f4b:da12 with SMTP id m7-20020a6545c7000000b004126f4bda12mr22046016pgr.116.1657655099018; Tue, 12 Jul 2022 12:44:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657655099; cv=none; d=google.com; s=arc-20160816; b=s4py14o4b1cHAEUiu3Nxyx6pTUJurTAjsrTfmODuE8kLbp2KzUypz5ZBVNOhNXTUgt Y3xeIZLTqu1+wNsjbFbhhShsKRKZs7s360IlkbtTAMdoCGZoVDiy6LXLXheQuG3ofK6n uYkRVz3wOW03p2/FgAxx7L+M5/Nl2SvHkJodVaIQgZHbtv+g1d2QzyrkAoqFyQru6Hod sHnVM3/MjqO0PExXoWEnHaGKK6isxPtlu4zaNAoPLGec45bW6pZmljx4ftP/6zOKsqJ4 MuoBsUi/cWamx52FxPCcxmqfhXTZNJ4nSXu4G/WS+K5h5YfzS+v2Adw8IB/yACxGWhya pCOg== 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=LqsIYiuRO/rQshDsBrwWzPJZc3QmrOrPF5Mlw0dTQhI=; b=QVFUwwI9ZyaXNSNovckl+ND1HWFOO/SRyWnD/gkMKge5WZAFnh1S2OGaJsMjPw209Y 26zTx+zWWKh2ceqrtEP4txTw1PVNwDO4BlfDjJT4mwado68ihig2s2CLfEVWR3xhc37f yMq6NQ3wxq1uGm4SabjrJr/AshTL85A6zUO1EDVLVy+hH8syJWSojUuNGRv7cvFvr2Wn FZRd9ZzFG3lQTosndahMv4k9mvUSvZFOY1t1aHVwGntiCRwaE0dSxhLwGqy5IiiKA2Kg 2w12ED4DelpDP+JvRKAxNLXELjypIy0ZxexI5B1pVrVDgFNhRH1/xFBm6G0M+CnuRgKI YxBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netscape.net header.s=a2048 header.b=CGAjtpR5; 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 qe5-20020a17090b4f8500b001ef8d23ad9csi16795865pjb.182.2022.07.12.12.44.46; Tue, 12 Jul 2022 12:44:59 -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=CGAjtpR5; 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 S230191AbiGLTkb (ORCPT + 99 others); Tue, 12 Jul 2022 15:40:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229814AbiGLTkR (ORCPT ); Tue, 12 Jul 2022 15:40:17 -0400 Received: from sonic304-25.consmr.mail.gq1.yahoo.com (sonic304-25.consmr.mail.gq1.yahoo.com [98.137.68.206]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5698011CA31 for ; Tue, 12 Jul 2022 12:16:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netscape.net; s=a2048; t=1657653370; bh=LqsIYiuRO/rQshDsBrwWzPJZc3QmrOrPF5Mlw0dTQhI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=CGAjtpR5+C4HS4XQ2OvTYQ7qRlySax9XYLbliqAR29CfvkgIwl1RdUv2Gq/5w7tCk/YEPyImtAySVW2fLavPN7ALOFePf9c38I0R55eo7I9kTe9pgvAbK/7gWzEOQlF+/KkUZ7h8y40SM8wa/sErYdC7KL9HqsFtDlm5AukXsIAY2pxJFuWy5k/oSXssEd/YimB1E5mnEJUYdRHAYyRx38O68t2D7OeONT3dzW+35L5RAKK1NjACcVieKIQrmO/9eDxUggdb/1PAS6kio0CsqzsUflQITVZJLIZwhehNkPBRNjNj/Veyb9BG5A+qnPdZQ4vcppzYBq72sInOkUenJQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1657653370; bh=vzUhklzVTkk5kQMXp8RwJ4d116VwwqOH3IvqSm/1z/S=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=ZOxnEwzj99oX1FcCZKrIzFRVyzGKSo/eTTbzAlzhMluX+rosfpIIfAjsApnxXVs7loFbHvnSOI+bEWb02AGXfviau7YgwHQBykvurQX/gfE6qoEnNpOrW2vLUWHtj2m2G+JuuSFgyYZjBr0q27k3HVaJFHAOnMgDGB65hM5HCJ3gAKDRAqQWsq5Z6Bi8ZxHiLAyibPxRQLRY2koYnr/FvVOxEBmUvnBnVv4nQM+XA4A7q2pRXgGyuFiViCaSr8wsZwLG6FLowYfG22OAXx2/hViRR9p+mdz3F6L83ITwrZ6jdWtuByP3xozWI+VIBP8E3n60R08bh5eQ69/x4Y8KKg== X-YMail-OSG: zNFCnf0VM1mAICJ7S6iq30JGBNQGhtyv7Q_U.DPJjW6i5EJGwBBaz8vDAkB6f1n Lf.hiaTiHFLgYwqxKlUAmYERr9tr3YRBL6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Se8BV72p.uktB3m4Jq 5_8hW15w- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.gq1.yahoo.com with HTTP; Tue, 12 Jul 2022 19:16:10 +0000 Received: by hermes--production-bf1-58957fb66f-h8ftj (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID fc41fbffd72b8c63f02a9fec28369f25; Tue, 12 Jul 2022 19:16:04 +0000 (UTC) Message-ID: Date: Tue, 12 Jul 2022 15:16:01 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] x86/PAT: Report PAT on CPUs that support PAT without MTRR Content-Language: en-US To: Greg KH Cc: linux-kernel@vger.kernel.org, Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Dan Williams , "Kirill A. Shutemov" , Tom Lendacky , Brijesh Singh , Jane Chu , Tianyu Lan , Randy Dunlap , Sean Christopherson , Jan Beulich , Juergen Gross , xen-devel@lists.xenproject.org, stable@vger.kernel.org References: <2885cdcaccffd287ef69c7509056ddf183a38a0e.1657647656.git.brchuckz.ref@aol.com> <2885cdcaccffd287ef69c7509056ddf183a38a0e.1657647656.git.brchuckz@aol.com> From: Chuck Zmudzinski In-Reply-To: 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, RCVD_IN_MSPIKE_H2,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/12/22 2:36 PM, Greg KH wrote: > On Tue, Jul 12, 2022 at 02:20:37PM -0400, Chuck Zmudzinski wrote: > > The commit 99c13b8c8896d7bcb92753bf > > ("x86/mm/pat: Don't report PAT on CPUs that don't support it") > > incorrectly failed to account for the case in init_cache_modes() when > > CPUs do support PAT and falsely reported PAT to be disabled when in > > fact PAT is enabled. In some environments, notably in Xen PV domains, > > MTRR is disabled but PAT is still enabled, and that is the case > > that the aforementioned commit failed to account for. > > > > As an unfortunate consequnce, the pat_enabled() function currently does > > not correctly report that PAT is enabled in such environments. The fix > > is implemented in init_cache_modes() by setting pat_bp_enabled to true > > in init_cache_modes() for the case that commit 99c13b8c8896d7bcb92753bf > > ("x86/mm/pat: Don't report PAT on CPUs that don't support it") failed > > to account for. > > > > This patch fixes a regression that some users are experiencing with > > Linux as a Xen Dom0 driving particular Intel graphics devices by > > correctly reporting to the Intel i915 driver that PAT is enabled where > > previously it was falsely reporting that PAT is disabled. > > > > Fixes: 99c13b8c8896d7bcb92753bf ("x86/mm/pat: Don't report PAT on CPUs that don't support it") > > Cc: stable@vger.kernel.org > > Signed-off-by: Chuck Zmudzinski > > --- > > Reminder: This patch is a regression fix that is needed on stable > > versions 5.17 and later. > > Then why are you saying it fixes a commit that is in 4.4.y and newer? > > confused, > > greg k-h It is true the erroneous reporting of PAT goes back to 4.4.y. But it was not until 5.17.y when the i915 driver was patched with a commit that started using pat_enabled() instead of boot_cpu_has(X86_FEATURE_PAT) and that is when a regression that started annoying users appeared in the kernel. I presume that we only backport patches to stable that fix regressions that are really bothering users, so even though the problem dates to 4.4.y, there is no need to backport before 5.17.y which is when the problem manifested in a way that started bothering users. Chuck