Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4371imw; Tue, 12 Jul 2022 13:22:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v2zCoKfcHK5KJtbNgY9YBKSXGTfPKBLjLmLjIs9Of4oB6af4tsY3RvQVzFNb1Pn7EpuSlu X-Received: by 2002:a05:6402:3454:b0:43a:86c8:637 with SMTP id l20-20020a056402345400b0043a86c80637mr33984795edc.393.1657657343845; Tue, 12 Jul 2022 13:22:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657657343; cv=none; d=google.com; s=arc-20160816; b=H+Xb+4C5MgW60F/mUeAR72dW3YQPuMb+VzK7/H+W7bsKbyvqDt3CbB1cHZS6DEAESt tkMI4Wt+ZQ5ylIUv7fV0nFSj17KuYRgNeAL6ZDwLIAtWwY1AJ9R2xfoQ/mlh/DLnGNa5 hBEAwHtwhgYZVDj00mbtFQlbiDo6nIPKGIChTzgQnpqwsR5gqISBYnbRCk63HqIPiC4i 6oIJlOVHDzRhlOGbqYN0bRJv0KZePJiO5mQR3pDdj1LWxaqBUdv6h4QHkHjjGvmNeG74 57D8Nh+4hq5uk7odSx0l0bzUMLjp2K/j2lwGljwqMhCfhwN7wx4UB/+qdax7DPAQKNJG NSpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ud02zIOF0rqpqpNIIZ3Ez8/8xYqfLV0eoj9ArBG0Z/s=; b=rVtI2FTsZYsEGWwQ1GbmCfMwzgXAdqiUFzfxQGmD1qMzIobACwN50hK7qrRj6gQnkA mhsRDkVt4p2Z7kvB7HeCavWbNZkswOhaN/0RNz3s51C3Z2JmHX8C7UKN08ZuJYZN4XyY e6wn3MmpW0JSavVKYayDTSChXVSHa9gTAmA7D1l/oNz0B754E11e+MbvODq/hWpw4/TL H7dxNLmA+GIONzbXlDh/hoD6uGYVnF+g9yW6ONdHSizJYhcJfu/ETQacJblC0DUB24BP JRgwMvM/+nmLqKKgb5wDiUew1Yn5VUDTOctdJapqPdZzY2MzE0i10CU4V/HWgPgfkP0U 4/Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=C+JpUI7H; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z2-20020aa7d402000000b0042bd2c39f07si13769208edq.596.2022.07.12.13.21.59; Tue, 12 Jul 2022 13:22:23 -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=@linuxfoundation.org header.s=korg header.b=C+JpUI7H; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235161AbiGLToF (ORCPT + 99 others); Tue, 12 Jul 2022 15:44:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234930AbiGLTni (ORCPT ); Tue, 12 Jul 2022 15:43:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6CE9DF7F; Tue, 12 Jul 2022 12:26:14 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 52792615E4; Tue, 12 Jul 2022 19:26:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CA9DC3411C; Tue, 12 Jul 2022 19:26:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1657653973; bh=KofZy0gS7enXRLvK5w5s70pOuM52suAS0d4+pv9phsg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=C+JpUI7Hlc73b9zL/pC97stcYKxyVPA2NzaJTw5CDhNHAWTdGQPl4eSAY2DrMC4yZ 4w5E3PHJwulm6Ys1IlHBPmCC+2Opm/xQnuZWr6p5ofmoxTUPqlxmpimVKTnLXUxJwp P0Ur70+AdZXROv+Az3KlC8DmWNqTme9x8yRZX0c4= Date: Tue, 12 Jul 2022 21:26:10 +0200 From: Greg KH To: Chuck Zmudzinski 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 Subject: Re: [PATCH] x86/PAT: Report PAT on CPUs that support PAT without MTRR Message-ID: References: <2885cdcaccffd287ef69c7509056ddf183a38a0e.1657647656.git.brchuckz.ref@aol.com> <2885cdcaccffd287ef69c7509056ddf183a38a0e.1657647656.git.brchuckz@aol.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Tue, Jul 12, 2022 at 03:16:01PM -0400, Chuck Zmudzinski wrote: > 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. If it needs to go back to 4.9.y or so, let's take it all the way back to be consistent everywhere. thanks, greg k-h