Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2250186iob; Thu, 5 May 2022 20:39:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx31IyXnC+tJBqyfWpEwUfQ3nBKjgIncBqPJx0N3pJPC7aNEmViIaIMb0IdCkAU0eyAtKb3 X-Received: by 2002:a05:6402:1107:b0:416:439a:6a9e with SMTP id u7-20020a056402110700b00416439a6a9emr1427361edv.382.1651808352228; Thu, 05 May 2022 20:39:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1651808352; cv=pass; d=google.com; s=arc-20160816; b=TpyWdvf5LcXs3parICciXvnOGGUrurtfidNxQKXV0+nXhIECGvVXVOfdQB8v9ICONt Q2F94VrHpVA6sIJ8PI1fNNeE1nASUdC8hl6AbPnCdJ5T/7T8zSdgPGy1CfqxnoJWc8lV /9jhx3Sim9ZMA49l4yWnRLSTKhDRWIPfwfQOMOSKKe2qn+EWQ1Fh2gtcwNQsf39mUH+H HP1he4et6M8oyqkTgrD949t+G48A778sWtB6v5u2ir9SHt3rDE11lxYRV9Cezh84aNIb PAztp5ACMNs/D/xUBlRegBOkU8S/uUwseWtsY5uGa7zjmWYmK/uLgCO/UzS0yPJKAx+k xxRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=uQfWNe1RxVIVhGw370YZzsDPbGmRCJ6APtQ7SkS5ucE=; b=zoMeJMIymWrA8PyhogN8bTzvAlg2pFH+eKzdn3XDEgTcwFzEaTcx8CTHRT599HVE4D YAlWojtU+xp9jUnnX76fFNWJTLEeke8I8dN4ESsoKvOjTcp3LQygxB4WasVE5l+ilE8f z26sd7UvuU5rpagxS6vVfaCfUkSfyjdbfeZVBNvqeVXmTMC5y3xBLS/G8Kj+e8ksjrMl M15dmQpwiCpSItCmMcUI8/Fw02SzVU9aBDQIYNBwd8oq/m31WJIrENb5c4cNnkDBnJc0 dGdn9Wd6Hpg7GOjnaEbnCtac4rEphd6FsJVIWexRv+wKasXS+EQ7nbPu+kr+XOg+r9Px KtiA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=mimecast20200619 header.b="NB6YhiN/"; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h10-20020a05640250ca00b00425d8c74949si4366720edb.417.2022.05.05.20.38.48; Thu, 05 May 2022 20:39:12 -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=@suse.com header.s=mimecast20200619 header.b="NB6YhiN/"; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345350AbiEDIfe (ORCPT + 99 others); Wed, 4 May 2022 04:35:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231852AbiEDIfa (ORCPT ); Wed, 4 May 2022 04:35:30 -0400 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.111.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3B91167EB for ; Wed, 4 May 2022 01:31:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1651653113; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uQfWNe1RxVIVhGw370YZzsDPbGmRCJ6APtQ7SkS5ucE=; b=NB6YhiN/+8skgvhBLERIkWG7icZp9Ecbz99Yrf2/ixULlDSMdnQ0hd8odoCNQhOer5n4qa l1EHGQ2ZP6LNeoNfs7rH2Mn3EM91/lKVpC9t9VE6xSiwbVunXvFf8imuP+JI7iLK9HZTZ7 jgSgKnFSo4DgowwapaCihTc4KkvObHQ= Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-am5eur03lp2053.outbound.protection.outlook.com [104.47.8.53]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-40-s03ChdGRMva8mRVmUNHg1Q-1; Wed, 04 May 2022 10:31:51 +0200 X-MC-Unique: s03ChdGRMva8mRVmUNHg1Q-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J/TcqT3FmKHLvjBoB2dTAf6qSEpSlXxnWt72lZgDZiAkI9tYIVrN/TMZ97c4y/V8yI78LutDPzRWxcmg1UJrgz9KA0VRaTkZFLFW0RNv83UrNA/oW59EGQRvDoy16Mdyh1VlRZeeijbPKMW3LAfX2jXocIGzzFWIaF8yrVWhgNdEUkP1Hjm7xtuQyASavG+hMlPcSml8DTlPrUWgZBEdWPF4WhzKdnRK679jX3rpCDgOy3LDFefGuhONH43yATAH2+3s0WMz83mvZRpn3j9U6HPs2J+1OK2Vht86oeQTX3STNcvMm7lTncPA3eB7iROCONua4/pv6WEC0CUv2l2ALQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uQfWNe1RxVIVhGw370YZzsDPbGmRCJ6APtQ7SkS5ucE=; b=O/MdNjN/vdEiSXOOv5aLaCtKv24zDcfASUE87VxaXEgPQKkbLQvP3Vv8mzBcP+UPSkGYiMSfawR2oP9hdRouktrHCaJjbMoFw7NLD301yyAi6491YzglTUj7Vs9f3UUu8Vu07gMAm6AAIroem+1EURPb63bd+afJDuf4ah/XP0KhZCJD0cCxBfIE9R87T5Or7YUVtAJeZZxxbYnWTRHqNQK0o87njqmybuWh3Tb1fe3fbY1WdOd3ue6N8NLs/39mRmVoR2tMRB3cra0mdkwohQlau0ZBp4Vq1bo/RLlVJkMkGNk4Ut2SqS+x26oFZATs8JPye6R+ii69xpG+p78r4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) by VI1PR04MB5437.eurprd04.prod.outlook.com (2603:10a6:803:d8::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24; Wed, 4 May 2022 08:31:49 +0000 Received: from DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::5cb0:5195:4203:7c2f]) by DU2PR04MB8616.eurprd04.prod.outlook.com ([fe80::5cb0:5195:4203:7c2f%8]) with mapi id 15.20.5206.013; Wed, 4 May 2022 08:31:49 +0000 Message-ID: <1d86d8ff-6878-5488-e8c4-cbe8a5e8f624@suse.com> Date: Wed, 4 May 2022 10:31:47 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH 2/2] x86/pat: add functions to query specific cache mode availability Content-Language: en-US To: Juergen Gross 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 References: <20220503132207.17234-1-jgross@suse.com> <20220503132207.17234-3-jgross@suse.com> From: Jan Beulich In-Reply-To: <20220503132207.17234-3-jgross@suse.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: AS9PR06CA0337.eurprd06.prod.outlook.com (2603:10a6:20b:466::13) To DU2PR04MB8616.eurprd04.prod.outlook.com (2603:10a6:10:2db::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d493a38e-8de6-4ab7-a9ef-08da2da8884e X-MS-TrafficTypeDiagnostic: VI1PR04MB5437:EE_ X-LD-Processed: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba,ExtFwd X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: q6/goCuOXLBGJE4xI9cnuLVbnU7uK3VKQx8/d04qTCC62JOqpYdNPb+52+pWQBOipselsPPIjc+xHk/FKvsuqCEzcymZ9m5mCZ5tjnE+nxjG/GFxTwIs5RmVecjJy74TzT0+a9ZsBXuiQMucoojzlKroFvM763LWfrZoQD1bkk3V55kifqIEt8F/Ez5UvYKkadFazg0TljMkRV4MMtID+fnOAwbqjhri9AiypnbvyvHHqW/5KXuhCMl0q7aXw1w8WwvVH3DJUkigdMX0STl9Yy6vGIHGMQhHCK85Zvd0zHGt4FbBqiHOr4Pw6oCazKAuxJ0mgUGmH9+O5dC5O6zl9mD1b8glBlAdxwwiBYhO9ysgeB3mVsWjmf7F1zM2RxN52dzMMR0Ssa5gbC2sJSCprrRsqC2aAOGgS5Lf645VU6Eyl9dSKQquHsf4yaZxszFcFx+Hc6gXDLRnqx7EnE/gznOJlXKei1zgEuVbCJX+pAIG8dPy3UWGbEsnBQUzeqNcimVajwyG7cNuot7MZdHRgTuc1/EM50CaM8KV/5+Mo5RkDd2sB0dNnaRTQd3nd68psAeOmZomeshxRW/hN917cqGuJMszTLSm02VV/QH9Z2Yaxd3w3KvoJvc5j9YZcHiyD7L58SilxC+xXdLStKwVnR/yozUtjoKmRoYPNbVtUQpF1UiV/1uGGIhPp9DGtllbtUwyZU6DojpKMnoYrGZ8mcal9mG9WCCWsauOWFsRWfKfptPL6gK5PevhmFT9yxVg X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR04MB8616.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(5660300002)(7416002)(53546011)(6862004)(66556008)(66476007)(508600001)(4326008)(66946007)(8936002)(8676002)(31686004)(37006003)(54906003)(6506007)(316002)(38100700002)(2906002)(6486002)(6636002)(26005)(83380400001)(6512007)(2616005)(36756003)(86362001)(186003)(31696002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?c1Z6S2RLYmZscWpIYTV3SzlMZ0RDVTl1R3VKTlA3cEUvQ2pYQkJuS3k3SzBm?= =?utf-8?B?endydmJ2Zm5sRnNSbnhYL282dU5ZV200czdBVjJBcUJkY29vd1ZQSG5TMUE0?= =?utf-8?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JDYTJlbmI3clI0Y3N4UVQr?= =?utf-8?B?MS9waUJpRTQ3ZVBWcWhqcld0UDJ2bmtlOGYvK2lEcmhzUEtIM091RzZzWHd6?= =?utf-8?B?a1BTNDZWemdNTU1jZnNDMzVncmgyU3l2MGRUN1YyM1Y1NGZNK2I1VkU5YkxI?= =?utf-8?B?c29DRWdYZXUwYmpTWlA3V0pqL081bHJlbGZDSXVGUDFlajZZL2VJSjNtcWY0?= =?utf-8?B?UHM3SDFPUHVCMlllcmdBMXFUMDlVTFc2dml6S2l4RmpZQVpzL3VoZE9lNHBO?= =?utf-8?B?RFRGNHF0YmJhclZSWUlISmdXQno5QmNpSWVNNUpzcWNNM3c3bHY3QVVhUlJj?= =?utf-8?B?WGhSeitqYTBiREJmWUFJaThMSkFIcVFBdzdqQ0lEWStEUmpKTVpVT0tobEIr?= =?utf-8?B?b1JHd1JiMktNVEhVdkJtRW9ZQjA3RklUeGdqUmpkWEJDZlpXTUxRUT09?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: d493a38e-8de6-4ab7-a9ef-08da2da8884e X-MS-Exchange-CrossTenant-AuthSource: DU2PR04MB8616.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2022 08:31:49.2208 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AhtRaIIfvZAc7TwDIZ0GnLdy5KNKjJI1rFZ3z2ZgAfSMQzvSpvcQBWpZmqGIssObKPMWhzvHPKsiXLbV90Ay3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5437 X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, 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 03.05.2022 15:22, Juergen Gross wrote: > Some drivers are using pat_enabled() in order to test availability of > special caching modes (WC and UC-). This will lead to false negatives > in case the system was booted e.g. with the "nopat" variant and the > BIOS did setup the PAT MSR supporting the queried mode, or if the > system is running as a Xen PV guest. While, as per my earlier patch, I agree with the Xen PV case, I'm not convinced "nopat" is supposed to honor firmware-provided settings. In fact in my patch I did arrange for "nopat" to also take effect under Xen PV. > Add test functions for those caching modes instead and use them at the > appropriate places. > > For symmetry reasons export the already existing x86_has_pat_wp() for > modules, too. > > Fixes: bdd8b6c98239 ("drm/i915: replace X86_FEATURE_PAT with pat_enabled()") > Fixes: ae749c7ab475 ("PCI: Add arch_can_pci_mmap_wc() macro") > Signed-off-by: Juergen Gross I think this wants a Reported-by as well. > --- a/arch/x86/include/asm/pci.h > +++ b/arch/x86/include/asm/pci.h > @@ -94,7 +94,7 @@ int pcibios_set_irq_routing(struct pci_dev *dev, int pin, int irq); > > > #define HAVE_PCI_MMAP > -#define arch_can_pci_mmap_wc() pat_enabled() > +#define arch_can_pci_mmap_wc() x86_has_pat_wc() Besides this and ... > --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c > +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c > @@ -76,7 +76,7 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data, > if (args->flags & ~(I915_MMAP_WC)) > return -EINVAL; > > - if (args->flags & I915_MMAP_WC && !pat_enabled()) > + if (args->flags & I915_MMAP_WC && !x86_has_pat_wc()) > return -ENODEV; > > obj = i915_gem_object_lookup(file, args->handle); > @@ -757,7 +757,7 @@ i915_gem_dumb_mmap_offset(struct drm_file *file, > > if (HAS_LMEM(to_i915(dev))) > mmap_type = I915_MMAP_TYPE_FIXED; > - else if (pat_enabled()) > + else if (x86_has_pat_wc()) > mmap_type = I915_MMAP_TYPE_WC; > else if (!i915_ggtt_has_aperture(to_gt(i915)->ggtt)) > return -ENODEV; > @@ -813,7 +813,7 @@ i915_gem_mmap_offset_ioctl(struct drm_device *dev, void *data, > break; > > case I915_MMAP_OFFSET_WC: > - if (!pat_enabled()) > + if (!x86_has_pat_wc()) > return -ENODEV; > type = I915_MMAP_TYPE_WC; > break; > @@ -823,7 +823,7 @@ i915_gem_mmap_offset_ioctl(struct drm_device *dev, void *data, > break; > > case I915_MMAP_OFFSET_UC: > - if (!pat_enabled()) > + if (!x86_has_pat_uc_minus()) > return -ENODEV; > type = I915_MMAP_TYPE_UC; > break; ... 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. Jan