Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp197115ioo; Thu, 26 May 2022 01:21:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKz1LAaQNsqRMYN6SbhRrH5dUMlbWMS/iL1o7AGgU5BZcd9muFQiycHWtyGYE54hCuQqvz X-Received: by 2002:a05:6402:3705:b0:42a:ba63:18b7 with SMTP id ek5-20020a056402370500b0042aba6318b7mr38161954edb.296.1653553284578; Thu, 26 May 2022 01:21:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1653553284; cv=pass; d=google.com; s=arc-20160816; b=kValOk596GnvEsUnRzNdZjuhSU+7QE43trobBcwKFzp42dh1WNSAFSDbWMSSOU2QwA /ouxMjMM/2pCgGdiCBu+XYuI3CtSmFoLRCcQaV9ETCS7H5vNAqJEu706bLpVxKVpUHuV nMigNp0D/N/dPmdwlqL8XJskAMkYYoy9TVbqIO+0Cbb7zg1BUXS0zGVTViCyAFx/BqkE X1qEKUfl7v5Q7/SiSqi1H/SwL2t2rZAO3Gw96w1J5m+DZgdfVLWt7+68htFKJZA6Bt9v 7M/sdPpp5wlWF3WOI8B3QACOtR/0E+v8+qdWAl2NAoOJCCAk3Bw5KYmOhiPfzQ6VplFz ho+g== 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:references:cc:to:from:content-language:subject :user-agent:date:message-id:dkim-signature; bh=yTR9Yx/HbeSF5EVcNf6OID05W1togWox6q4GWfB34ks=; b=JIKLVPqjC4XBiBiDpt318EdXwMecsDzXdn0iqWLXoWAaZLBre1eC2M4UKGqwbRJdTQ 2X+yujxEaS+H/TTdsIACWR7Ecns9jFse+uOQ7+G7wf+ZWP4KYOQMMdu4FVnjjbQw1+eN kh17IZ8iQ+ep809Ke7zcfL1ev3Q2iX0ZoJXdxLwvPePBSB898BQKjoj/+Rs6mYr4VBoO ucj6nOYHDDRaw2jHm+eP4ZNMGY88ylnHwDceIHJCIkWT4gC+WLbctNKRt/iKGLcu4a18 7nrxaKlq5dxhzDo9zlWsKpwCXNkpkorj8Uc8S1cmR1/cwZHXqTW1qHY7pbvRvf7Och5f mYvg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=mimecast20200619 header.b=WpSEC9it; 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 r5-20020a1709062cc500b006fef1a9ef8esi848727ejr.324.2022.05.26.01.20.56; Thu, 26 May 2022 01:21:24 -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=WpSEC9it; 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 S235723AbiEYIzq (ORCPT + 99 others); Wed, 25 May 2022 04:55:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229546AbiEYIzn (ORCPT ); Wed, 25 May 2022 04:55:43 -0400 Received: from de-smtp-delivery-102.mimecast.com (de-smtp-delivery-102.mimecast.com [194.104.109.102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A044A6EC47 for ; Wed, 25 May 2022 01:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=mimecast20200619; t=1653468940; 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=yTR9Yx/HbeSF5EVcNf6OID05W1togWox6q4GWfB34ks=; b=WpSEC9ita79QjAzK/rqDRMbnyyBDz2Jnz1CySWuKlow03Ui5RkZRYwkpfi9/RNBXV9wIGQ NmW3utQcvD5r3Cx3AuhE8lDh56b3UD+aM9cHZg5cWspBYeAkhdkKaBSHJcGhDDWFskzcGE gWM/21d8HjvBQVWBWBw/RJ9qgY+fBHs= Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05lp2172.outbound.protection.outlook.com [104.47.17.172]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id de-mta-11-0tnFSb3aPIejMTwIfyS0Xw-1; Wed, 25 May 2022 10:55:39 +0200 X-MC-Unique: 0tnFSb3aPIejMTwIfyS0Xw-1 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KbAUAAaK87wjQJSEh8TQ+PhDvqKgZGWOzZqeIdYNCm/y4IfzlJgY4iDlJAjlaoT1s1SYQKeDCV7pi/V/Bap3LPGVDPPfnZb+gx/Kq5V8nlnKK241TeJRuHG4PFMYvuKOPzFLmJvk0hsOM34bZIolUng2O9VTJPxZbiqY/Tj5upkUouVomFREZxU0XJXYEmuwkzy9wjV7caxNnNcOFS/Xlxr5Eas/CislUPdk9T4/miSndqW/Jhf9mWbwkriZZKHTuJ2kt/Lm993oMWuOM1Mcvybaqx1gkFj7w5Ybm4Gcx++/A+ea3OOco9v5xOs7H+OByMUxX7jcStkZYnHDLmMZqA== 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=yTR9Yx/HbeSF5EVcNf6OID05W1togWox6q4GWfB34ks=; b=YHxXvqOxlA3/YSD3IMXG/nEAOX27ZGC5sPn/R6TsRUp9OWVUAeWobcill3xAOhqSOPZYJiFKY56BueaR4eUgaOdIOmmYZ2iEz/wGX7lb3LWlPznQc7L8YcDocLwhfLhkxG9wonnp6Wzcnneu+5D9HXalpECPTsF3PVAHBIvVaXJ2xtfxzIiY++IT5W8Wiss6c6F4wdvCa9k19Uie+wSxPKqi709h6mp+9tsstSmA3tQLlkfYOCO789qd+tZKHd24dl7Iy/84RKU9gZb+inhn9SNTI4WFf0GfNaRIsHdtOvjU+DNNnRNX8O/IA/Tb9BYqdplRGNyGh6vpCIQOGnnRkw== 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 VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by DBAPR04MB7382.eurprd04.prod.outlook.com (2603:10a6:10:1ab::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.13; Wed, 25 May 2022 08:55:37 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::dfa:a64a:432f:e26b]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::dfa:a64a:432f:e26b%7]) with mapi id 15.20.5293.013; Wed, 25 May 2022 08:55:37 +0000 Message-ID: Date: Wed, 25 May 2022 10:55:34 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Ping: [PATCH] x86/PAT: have pat_enabled() properly reflect state when running on e.g. Xen Content-Language: en-US From: Jan Beulich To: Andrew Lutomirski , "dave.hansen@linux.intel.com" , Peter Zijlstra Cc: lkml , "xen-devel@lists.xenproject.org" , Thorsten Leemhuis References: <9385fa60-fa5d-f559-a137-6608408f88b0@suse.com> In-Reply-To: <9385fa60-fa5d-f559-a137-6608408f88b0@suse.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: AS9PR04CA0050.eurprd04.prod.outlook.com (2603:10a6:20b:46a::35) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 980393e4-9679-43a8-3e59-08da3e2c5640 X-MS-TrafficTypeDiagnostic: DBAPR04MB7382:EE_ 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: fN6VQqSkdIO9q8AdEhJJoj7HsjnUN48LHgH/JnSEiF57ZDa8p12ZYXrPFL8Yfb1LmYx/XQLo46H8I+hzEKjeO9Ns6Fu9Lyi1LxB5DTnr1HkNvoLHHS6RXx3ENi52WfSHmmD8HYkVJqgL6sq8lQjx9G7U1xcWX9q6+6jkoAkG3LJv5hy+odp/7NrOrvaL+321np5VZwSYIaV2tZmR4s+vwLwSIUJaowU5IHO6vuzWzp40BTBArKL4193gPCWE9kBduKj2ZsUiqL7gLbWzFYL4A1+lew7btMufN/3OijPcGItXJ26MQTXeFIie/pJWvgghCas7hVDDlrG3xiYUZp2a34DyiXaL4242ixfBBCEK8jeJS+UhPJW2Ikxqfzvg9hFoelYdN/Usfy4qNP8OSmrDI0rQcRDGTyl4UwiUK7cobEMbyxRQupSlashf1E1KO0MiGk4JOJoaZZzJZhzfRvqY8fkmpUpl4hlKvaZHz/fhsxDMSUISrFk7UJl0+xrojfoc4uu6dJpuFTFCjPEdjexl17GVgCXRg3aiNwGMKrZt1zW8L7U+6s02QlGoPqlJY5iPwY5FQAVvRMfMhziRTGOdC7AYlzUL2aD/hpzf8W95FLy2wywL3CaWbOXpL2GB45giHI4fXdNoLP519tAx15pHiAh9s035uCxUr98VIl/l++QedZJRK6DsWQLFQr6ySbLqVoctDB+kjUPId4cqIEbI6emOwhuAypZMsH62DDSpaAHE+KHbDZrJ1aXBVhZu593I X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6560.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(2906002)(66476007)(186003)(66556008)(38100700002)(4326008)(66946007)(36756003)(8936002)(5660300002)(110136005)(6666004)(6506007)(54906003)(316002)(26005)(6486002)(6512007)(53546011)(31696002)(86362001)(508600001)(83380400001)(8676002)(2616005)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SUZIcDAwWUJUdytMK0FVbjA3a2w1NFJsSmF0eFNkNk9hcjVGVzJHUEU4Q2VC?= =?utf-8?B?ZStmcSs4eG00K2xuZGFlNktIWXZkT09hRlpxUG9GSmxuL001eVlhUVo3MUla?= =?utf-8?B?ZjVHNk5OOXVqenVQOFZZVlExeHJlcCt4WEpoUytjSXhlYk02OHNTL2JHdysz?= =?utf-8?B?SDI1ZkxUdmFpWm05UkpSTUJWeDI1SFpHSzRLOU1oelR6eE4vZ0YyWDV1a2FR?= =?utf-8?B?TldSQ09xMmtNTGVEL2xqMGdVVmtrdlBUWUMxRDM3UFJZdXJhT3NqdmRSY2NI?= =?utf-8?B?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d2NjeGhnbW92Zmd5bVFnM0xXZ0Yrdy83Vklz?= =?utf-8?B?YjRRVlZVdjdmcUZpME95WEgzZi81NVpFNW95T3dFd0tOZ0t1ZDViMWphYllj?= =?utf-8?B?clFpcjJTckc3T1BHMXJSelNpd1luTTdNUHg0a2kwR3VtbzFrcjhlRHhuMmdi?= =?utf-8?B?TVBtc2ZlbVAybmNkNmp5UGRlelR2U0Fad3J3UFhpWFk0ditDSGEwN2t3K1Q5?= =?utf-8?B?dXJVTEZyYk1sYURJMEJZcG9zbnJEV2ZEVm9aeXlmR0VjYnp6azQrZz09?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 980393e4-9679-43a8-3e59-08da3e2c5640 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 May 2022 08:55:37.4286 (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: Fj//y2YqhxQJpBwrApsy2m2MFexxJrHrY8cAKkLlMCgtUi/gJfs59yV1pSIbwMQIaMnYgjtjVF7OFZcV1nkf9w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR04MB7382 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 28.04.2022 16:50, Jan Beulich wrote: > The latest with commit bdd8b6c98239 ("drm/i915: replace X86_FEATURE_PAT > with pat_enabled()") pat_enabled() returning false (because of PAT > initialization being suppressed in the absence of MTRRs being announced > to be available) has become a problem: The i915 driver now fails to > initialize when running PV on Xen (i915_gem_object_pin_map() is where I > located the induced failure), and its error handling is flaky enough to > (at least sometimes) result in a hung system. > > Yet even beyond that problem the keying of the use of WC mappings to > pat_enabled() (see arch_can_pci_mmap_wc()) means that in particular > graphics frame buffer accesses would have been quite a bit less > performant than possible. > > Arrange for the function to return true in such environments, without > undermining the rest of PAT MSR management logic considering PAT to be > disabled: Specifically, no writes to the PAT MSR should occur. > > For the new boolean to live in .init.data, init_cache_modes() also needs > moving to .init.text (where it could/should have lived already before). > > Signed-off-by: Jan Beulich The Linux kernel regression tracker is pestering me because things are taking so long (effectively quoting him), and alternative proposals made so far look to have more severe downsides. Thanks, Jan