Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp11482ioo; Fri, 20 May 2022 12:32:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvrAM2LgWCFOUPzZf8mOpsEIcCTo0e05TOo/EUzcwbPT4J5sxHKfF69RwvG+VqREslJesj X-Received: by 2002:a63:f545:0:b0:3c2:8620:af6b with SMTP id e5-20020a63f545000000b003c28620af6bmr9603094pgk.569.1653075174076; Fri, 20 May 2022 12:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653075174; cv=none; d=google.com; s=arc-20160816; b=Rn/C8zXqC85XXgm39Y6AROE5AIKqGNcfN20aKIqGzUk0qb3X7uTD5d/h4qg16KiYCM lVhga5VZApK8eIUQfpul6D1xeHZUMgnq2qOZACi3lsLl3k56B3r08SJ9w5etFehZM9UP 6nFLxrTUZ5tk/Gwd7UiK36wrXkSt/AKRlOVhfMfP7b3GcsqngO8po7isv3zgi5Q12i0D VDVe3dJfbC9fGMnnLHHy61j5XqHJK0B4BahMN74i10/W/vvX9siP4vpGiPafiWycQ8If E5/0xcugT+2tf3YTlhyilclV8Te+RtkfjHHSKsJmcEI33piUXI9VRwsnLMeCXBy8GcZg wfkA== 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=WuvwqA1c8r2r+p12+b/hUYdMq9rnRGTuBcxt58to+Ao=; b=hXHM25G5i6roijj+JHvRZjeRlahYn7f46P8guhLABVIS5LArVxBr0qAd+zedaFNo6P R/9mSquE7nlQFGO+/3GGIbmVuqAJKCgIau4pKQekgVGwpAX1Z0HnA3hvDJTbC+T1pBrg 1cZoYnoEOq8iWx8vYGgqOMI+xuiq+eYJHkzMXbPnq9rCDkfyRgHSnUNfThKY6amu9QQI gqpwSc0bHnpDHC8ztZsTKSCB0drUnVGkVrjMzwvCPVQnthvOa8MqLYHBxSjX9sA0ZxNE ZwEGXv3xB/kQPDQyTVqwVBwzIhNHd3a0Ah/H4cAAv5FF+6b/CYizAnz16g5rvlkET+Fb MXPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netscape.net header.s=a2048 header.b=HF4w2B3L; 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 bm28-20020a656e9c000000b003990b9576f5si373753pgb.425.2022.05.20.12.32.41; Fri, 20 May 2022 12:32:54 -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=HF4w2B3L; 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 S230186AbiETIbn (ORCPT + 99 others); Fri, 20 May 2022 04:31:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347183AbiETIbD (ORCPT ); Fri, 20 May 2022 04:31:03 -0400 Received: from sonic314-21.consmr.mail.gq1.yahoo.com (sonic314-21.consmr.mail.gq1.yahoo.com [98.137.69.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4735237A34 for ; Fri, 20 May 2022 01:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netscape.net; s=a2048; t=1653035460; bh=WuvwqA1c8r2r+p12+b/hUYdMq9rnRGTuBcxt58to+Ao=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From:Subject:Reply-To; b=HF4w2B3LXxAzsPu0cKlClPAp4lIFCVFZUlM+pPQk/ux+ANH+hXbKsjrMjPSA0fZJ7bFN0k3vBmgockcp65NFWPRjltp/uZX8m6/CHBdr+bCznj5y10gd4DlD8HEzG69uE3tqaVbbHsoRnvclRrccUySMDf9kJ1C9NXsVBlCML8dQT9W9zbLw+22y3mNNGSaq/bL8pBTiaCsZ1FW4aFBOwyR2iMix+qtlmTAh2VK/hzqEyMo/dLfJQtZdgFZQeyxm8X+8RTOo9VhypjdtEObCOc6lZPTBSUTACmWdnQ142+D1X8U3FscLu7nqk75T10eZHlh/FT9c4xcPNXHZtL9fMw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1653035460; bh=O145fJvMYEd44wHYCOcQPm3BRaty1a+efZ4N8LUkQQr=; h=X-Sonic-MF:Date:Subject:From:To:From:Subject; b=KTMMx1J1l42zBLEuD7iEYrVpRZ7tenDIzhJP+FNinhG3SjIyDMVzw5N0pDNVL2N2MQ9pb94qH7dr01GJOCOZcXNtF8TViexLW79zwv6ynfIDVQKFpS6XcgMAsXtYpnghDDtVAALwjd1vB81Lt0374U4JDN08+xNpIlCqrxBcoc75xbCbKUwYizkkDqgLilGxLfiRDz8S0S9Gxn5MU4glFMXNaQAKCF1dwkGi1+k+TdJPi7eidZEKU7fihPGPg7vII2CW9XcWkjQ1lU6CFTr5srzCOHQVtMq9U0EeZOeKGy8AtuFKfsD9VLMOg512Kzby6gny/gOQ4gHLvwbJklvxvw== X-YMail-OSG: 7CjV_foVM1l0tGFHgoKRE.wnpkoqWeJCUCM8L4Pwg7EBf4yx.s.aoDJ2z8Y4XF5 nkBd3hXNBdVVi6K__NDC5IxyqplLijiN9NeZ4cFpS.V3YLTiqBnHc6oRK5Z8EqCF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Khq Dgy1f X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.gq1.yahoo.com with HTTP; Fri, 20 May 2022 08:31:00 +0000 Received: by hermes--canary-production-bf1-5d4b57496-wjd85 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID b6f8f6a30f469bee93e26cb01475724b; Fri, 20 May 2022 08:30:57 +0000 (UTC) Message-ID: Date: Fri, 20 May 2022 04:30:55 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH 2/2] x86/pat: add functions to query specific cache mode availability Content-Language: en-US From: Chuck Zmudzinski To: Jan Beulich Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , xen-devel@lists.xenproject.org, x86@kernel.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Juergen Gross References: <20220503132207.17234-1-jgross@suse.com> <20220503132207.17234-3-jgross@suse.com> <1d86d8ff-6878-5488-e8c4-cbe8a5e8f624@suse.com> <0dcb05d0-108f-6252-e768-f75b393a7f5c@suse.com> <77255e5b-12bf-5390-6910-dafbaff18e96@netscape.net> <8b1ebea5-7820-69c4-2e2b-9866d55bc180@netscape.net> In-Reply-To: <8b1ebea5-7820-69c4-2e2b-9866d55bc180@netscape.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailer: WebService/1.1.20225 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.aol X-Spam-Status: No, score=-2.2 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=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 5/20/2022 2:59 AM, Chuck Zmudzinski wrote: > On 5/20/2022 2:05 AM, Jan Beulich wrote: >> On 20.05.2022 06:43, Chuck Zmudzinski wrote: >>> On 5/4/22 5:14 AM, Juergen Gross wrote: >>>> On 04.05.22 10:31, Jan Beulich wrote: >>>>> On 03.05.2022 15:22, Juergen Gross wrote: >>>>> >>>>> ... these uses there are several more. You say nothing on why >>>>> those want >>>>> leaving unaltered. When preparing my earlier patch I did inspect them >>>>> and came to the conclusion that these all would also better >>>>> observe the >>>>> adjusted behavior (or else I couldn't have left pat_enabled() as the >>>>> only predicate). In fact, as said in the description of my earlier >>>>> patch, in >>>>> my debugging I did find the use in i915_gem_object_pin_map() to be >>>>> the >>>>> problematic one, which you leave alone. >>>> Oh, I missed that one, sorry. >>> That is why your patch would not fix my Haswell unless >>> it also touches i915_gem_object_pin_map() in >>> drivers/gpu/drm/i915/gem/i915_gem_pages.c >>> >>>> I wanted to be rather defensive in my changes, but I agree at least >>>> the >>>> case in arch_phys_wc_add() might want to be changed, too. >>> I think your approach needs to be more aggressive so it will fix >>> all the known false negatives introduced by bdd8b6c98239 >>> such as the one in i915_gem_object_pin_map(). >>> >>> I looked at Jan's approach and I think it would fix the issue >>> with my Haswell as long as I don't use the nopat option. I >>> really don't have a strong opinion on that question, but I >>> think the nopat option as a Linux kernel option, as opposed >>> to a hypervisor option, should only affect the kernel, and >>> if the hypervisor provides the pat feature, then the kernel >>> should not override that, >> Hmm, why would the kernel not be allowed to override that? Such >> an override would affect only the single domain where the >> kernel runs; other domains could take their own decisions. >> >> Also, for the sake of completeness: "nopat" used when running on >> bare metal has the same bad effect on system boot, so there >> pretty clearly is an error cleanup issue in the i915 driver. But >> that's orthogonal, and I expect the maintainers may not even care >> (but tell us "don't do that then"). Actually I just did a test with the last official Debian kernel build of Linux 5.16, that is, a kernel before bdd8b6c98239 was applied. In fact, the nopat option does *not* break the i915 driver in 5.16. That is, with the nopat option, the i915 driver loads normally on both the bare metal and on the Xen hypervisor. That means your presumption (and the presumption of the author of bdd8b6c98239) that the "nopat" option was being observed by the i915 driver is incorrect. Setting "nopat" had no effect on my system with Linux 5.16. So after doing these tests, I am against the aggressive approach of breaking the i915 driver with the "nopat" option because prior to bdd8b6c98239, nopat did not break the i915 driver. Why break it now? Prior to bdd8b6c98239, the i915 driver used static_cpu_has(X86_FEATURE_PAT) to test for the PAT feature, and apparently this returns true even if nopat is set, but the new test, pat_enabled(), returns false on the Xen hypervisor even if nopat is not set. That is the only problem I see. The question of nopat should be irrelevant to the i915 driver. It was unfortunate that the author of bdd8b6c98239 mentioned nopat in the commit message when in fact nopat was never intended to be used to break the i915 driver. The i915 driver should ignore the nopat option and decide what to do based solely on the capability of the cpu, firmware, and the compiled options of the Linux kernel. That is how it behaved before bdd8b6c98239, and that behavior is what needs to be restored with a patch. Chuck