Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1782542rwb; Wed, 5 Oct 2022 04:55:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM41xpaP89wJ/3K2W02g8RoNMFQlrOG28WNNB5VQq/rHv/JnV4k+zzrAD1v83mdMj7tiiD9o X-Received: by 2002:a17:907:785:b0:78d:250a:3725 with SMTP id xd5-20020a170907078500b0078d250a3725mr3513481ejb.588.1664970941607; Wed, 05 Oct 2022 04:55:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664970941; cv=none; d=google.com; s=arc-20160816; b=m1m/7kErRYhZ1w4lWQ3fSSXPDxdnYHPDeIfBl3qPnKBgu/EBKWmecj+od5jAVi9RvR h4kTce+gGD7JkYsinc0EgQXl8c9DC3C46tgZ/2U8k5v7PqcjD6crCkmhkscZHtAIASZy VmxMWohve+2mQYPzSF8Xc7bzNaJVu/gal3Imf5gFJq1MbAccKSMG/uHa4oW2rsCuhtb5 dsFRdtb4wOEA9z7SpXwPNclLxfcyp4tl7C6dD4Gu1szzFTNdGX8spQh5EBpfJxt/ixMb jq2sf3Rs5c4gh6TpedI9mUpTgH5GZ7ASjguENtegs4ZVxAX6bUkb7uQ9SBGEBn8HCLmN eKdA== 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=jlNnOtdLgWp1J9aNwcNLhyUtm43E+rBcw5a9tZw4tKM=; b=lyZP9AhAVFSDqfU3lTcUXoe5YOVY8ahvrG5T1r5gcGZCB+rZW3ZJ+ifVP49WXpDwPE elDomWvrokASduEe9X/KJv472KuyIdPjUb0KYnCvPAlgpRFsvfLV5EAnE42y8eAAB3Q6 2RjDLRORb8Exb/Nsi3PdKvSxwRSisIHHqSP/bs7BpsRHxfFb9G9x+bXwKHfrNQLDzgKG MulfMqUmFNpPMQG4P5yTJY5WYJr003sgwLt9+3HcxzXH+IxLbTEM1f4fk9C0ENft8bqH 4/EwTUcPMOXSG4eOoZlWUlYTagI6kuGoZfTdk+TaMw4kt/3iIfbIkBICZvWFT/k/+cKe JRIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=jdvZQ1JW; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m15-20020a056402430f00b00452ce356136si15450549edc.135.2022.10.05.04.55.15; Wed, 05 Oct 2022 04:55:41 -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=@infradead.org header.s=casper.20170209 header.b=jdvZQ1JW; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229824AbiJELQ6 (ORCPT + 99 others); Wed, 5 Oct 2022 07:16:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229769AbiJELQ4 (ORCPT ); Wed, 5 Oct 2022 07:16:56 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35EF65815A; Wed, 5 Oct 2022 04:16:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=jlNnOtdLgWp1J9aNwcNLhyUtm43E+rBcw5a9tZw4tKM=; b=jdvZQ1JWuioxO53YHfWyMIlwPO Crt4VyrM4DpQFGABM8ihqD6uCQ9lOmSnu6Vzh+FyURgi5JSApO0rWofMPZ+QiSuRPokJO+4lnLKKP w8oQ7pEDQ3kdIKkejORmZWIrpJAc5JfP6O+8uv9Dg0MZkd7ho74b7BbZ5ARN9R6EJenYFcapm2xiL yat+sxLvMINMLBWuQ7ATpDiS4Z1Kre/qrjly7jJFwPhZhXqksjDWGdEeOoOMcTKlt8HhLvBvmKcCs UC/aAdY8qrxzNlH1LwDNgOtOyOhiMQtjSaPc5HaBMx3+o46qEqgApTLVJs0DRLs/4h7TgkyMODVSv aGglGIUw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1og2Nl-000JVi-9O; Wed, 05 Oct 2022 11:16:09 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 8ED00300205; Wed, 5 Oct 2022 13:16:03 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 778D620C48C87; Wed, 5 Oct 2022 13:16:03 +0200 (CEST) Date: Wed, 5 Oct 2022 13:16:03 +0200 From: Peter Zijlstra To: Andrew Cooper Cc: Rick Edgecombe , "x86@kernel.org" , "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , "linux-kernel@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-mm@kvack.org" , "linux-arch@vger.kernel.org" , "linux-api@vger.kernel.org" , Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H . J . Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Randy Dunlap , "Ravi V . Shankar" , Weijiang Yang , "Kirill A . Shutemov" , "joao.moreira@intel.com" , John Allen , "kcc@google.com" , "eranian@google.com" , "rppt@kernel.org" , "jamorris@linux.microsoft.com" , "dethoma@microsoft.com" , Yu-cheng Yu , Christoph Hellwig Subject: Re: [PATCH v2 08/39] x86/mm: Remove _PAGE_DIRTY from kernel RO pages Message-ID: References: <20220929222936.14584-1-rick.p.edgecombe@intel.com> <20220929222936.14584-9-rick.p.edgecombe@intel.com> <8d58f57f-cece-c197-2a8b-dd02b4e405bc@citrix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8d58f57f-cece-c197-2a8b-dd02b4e405bc@citrix.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 Wed, Oct 05, 2022 at 01:31:28AM +0000, Andrew Cooper wrote: > On 29/09/2022 23:29, Rick Edgecombe wrote: > > From: Yu-cheng Yu > > > > Processors sometimes directly create Write=0,Dirty=1 PTEs. > > Do they? (Rhetorical) > > Yes, this is a relevant anecdote for why CET isn't available on pre-TGL > parts, but it one of the more wrong things to have as the first sentence > of this commit message. > > The point you want to express is that under the CET-SS spec, R/O+Dirty > has a new meaning as type=shstk, so stop using this bit combination for > existing mappings. > > I'm not even sure it's relevant to note that CET capable processors can > set D on a R/O mapping, because that depends on !CR0.WP which in turn > prohibits CR4.CET being enabled. Whilst I agree that the Changelog is 'suboptimal' -- I do think it might be good to mention how we ended up at the current state where we explicitly set this non-sensical W=0,D=1 state. Looking at the git history this seems to be a bit of a hysterical accident, not something done on purpose to 'optimize' for these weird CPUs.