Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1973246rwb; Wed, 5 Oct 2022 07:25:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6QRPbk+06C1Tp2wsrcPiivdG0+c+oaxDxbhjXKsROarLG4DMOcKrkp1PPFDjK0fpEBE9ju X-Received: by 2002:a05:6402:540d:b0:450:bda7:f76e with SMTP id ev13-20020a056402540d00b00450bda7f76emr28786101edb.249.1664979958498; Wed, 05 Oct 2022 07:25:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664979958; cv=none; d=google.com; s=arc-20160816; b=wE5M7vdw0Lgfb1fHaaSDzxRQEi5JVSWvte9BtRJpLjLP1w6qwPHvF8qE918K/LO+Ww TLASX2ccJ22WM7OasF0V5/zZ6CQ9zbVn6jGMhUUKDoQ7PcB1Rn1jxZwwOzgVP//riQwq r+MeqEVwp/BhjeB6DP1HLFRR8rzKAH2XBJgJWgo5d2eckKsVndqHc1oKzPEIQlUdBzHq VDkcnzKKkkx6dsWHxbLjEl4blYzeeyqs+lkpMOxTKslur1A8zF5RjW1AykP3bxoLPnLd 1cUYEEXoc/wDpULKbJEeDHpW278HAcV74KioqGpl/sgcUwmP0UZfi6ZX6v1ZNQC7BWmq 5fbA== 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:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=U6rQ+V8s4Ma2dnDA8dcILWuzvd0kekdLDV4R3adXWW8=; b=jfBdSfqnkPfpUMVR/4vlwEWP/s3ciPYJyBJif9IropivHlNBw3Bov/nTg0XCXQayVg vhJIt3T2AeXBwmEfgN1KFYKj7e0GHV0P1OKHMHib8JbepISystYJEIM76o3o9nmvFdRc EH+e8ousI2zj7Lm0sHQ1nIbhf3RONyj0EyGSdZRUtdNRYxRuaAIQvS0ZKXvtTpPnlrk0 XdXC5UyXSIoEdHuX1LNKAjwo1SZxpUXPmF46MoRiCfZY+B8NDIW33U5lSzF3/QDNCjV5 QvioOjLoBVsqlMXb/vknlvtsQvGSHGvf/We9K5VApuR39s1AvHvIvhHid+L6bDheiMbd dl5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XcTwy1mM; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg18-20020a170907a41200b0073ffabc3352si15759020ejc.836.2022.10.05.07.25.32; Wed, 05 Oct 2022 07:25:58 -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=@intel.com header.s=Intel header.b=XcTwy1mM; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230232AbiJEOIV (ORCPT + 99 others); Wed, 5 Oct 2022 10:08:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230221AbiJEOIT (ORCPT ); Wed, 5 Oct 2022 10:08:19 -0400 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AFD978220; Wed, 5 Oct 2022 07:08:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664978898; x=1696514898; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=x4Mh62nAwfxY8Pita2q5xFpK6rXI3Y7xCTC5ET9xbaw=; b=XcTwy1mMYhYXdFfO2Qgg+9lKnVqZndVhZ18vjTduP9uH7FtsHn98Cg6L GnaTrTqb6cMAgsAZauttLwNoWrDtmNGZc7EjN1Oo9R0+DGamG75tnG8Il U31OTZ5GQiag9xEgMmehLNK8WCmur0jMQPlpfP/wRqs5SZa4jFkh09S7S wTyerpFd0n8nJbwpKwCPdLOa+xcOJtNyoiWLEF3upOn2hPi4XxkZ0r6QK yrMsXJBO8alhlXpT3/nUKnHVp6kJs0uWTumOcov9a88Rmk4XaXCilcmus Hc78CZ6+XJd+Pg3G0xUraWPRjKf8ap+aIYdnmF4yCMt/ZILl+0CPKlq2g A==; X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="389454804" X-IronPort-AV: E=Sophos;i="5.95,159,1661842800"; d="scan'208";a="389454804" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2022 07:08:17 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10490"; a="602018913" X-IronPort-AV: E=Sophos;i="5.95,159,1661842800"; d="scan'208";a="602018913" Received: from mghender-mobl.amr.corp.intel.com (HELO [10.209.6.185]) ([10.209.6.185]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Oct 2022 07:08:16 -0700 Message-ID: <715095e6-6c4e-62dd-6631-b096db2cd92c@intel.com> Date: Wed, 5 Oct 2022 07:08:15 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v2 10/39] x86/mm: Introduce _PAGE_COW Content-Language: en-US To: Andrew Cooper , 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 , Peter Zijlstra , 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" Cc: Yu-cheng Yu References: <20220929222936.14584-1-rick.p.edgecombe@intel.com> <20220929222936.14584-11-rick.p.edgecombe@intel.com> <54cdad9f-b810-7966-5928-9320d970a43d@citrix.com> From: Dave Hansen In-Reply-To: <54cdad9f-b810-7966-5928-9320d970a43d@citrix.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, 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 10/4/22 19:17, Andrew Cooper wrote: > On 29/09/2022 23:29, Rick Edgecombe wrote: >> From: Yu-cheng Yu >> >> There is essentially no room left in the x86 hardware PTEs on some OSes >> (not Linux). That left the hardware architects looking for a way to >> represent a new memory type (shadow stack) within the existing bits. >> They chose to repurpose a lightly-used state: Write=0,Dirty=1. > How does "Some OSes have a greater dependence on software available bits > in PTEs than Linux" sound? > >> The reason it's lightly used is that Dirty=1 is normally set _before_ a >> write. A write with a Write=0 PTE would typically only generate a fault, >> not set Dirty=1. Hardware can (rarely) both set Write=1 *and* generate the >> fault, resulting in a Dirty=0,Write=1 PTE. Hardware which supports shadow >> stacks will no longer exhibit this oddity. > Again, an interesting anecdote but not salient information here. As much as I like the sound of my own voice (and anecdotes), I agree that this is a bit oblique for the patch. Maybe this anecdote should get banished elsewhere. The changelog here could definitely get to the point faster.