Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp904545pxy; Wed, 5 May 2021 17:34:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqlM47385OYKAu/9RKzlqGAByTyHk55S9f4x0OW3QoZMzWxLHu9gJs1SPyLlnGvDUz7EAO X-Received: by 2002:aa7:c1d6:: with SMTP id d22mr1782776edp.180.1620261246981; Wed, 05 May 2021 17:34:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620261246; cv=none; d=google.com; s=arc-20160816; b=Ky9z2R2YLfD+78u97b+dja/zKacVtMePYzd/OjUsT9i4813a8Qxfr1zmTRsfhq0HmE fGnfAKWiDaoovC7eYwZ1yX2JM/wyRaQztSNlYN//nfOCgrvt5NGrhQTiNEVZF74wkbIQ 913gaddh2exAOOm/bggvtbQqyj/Kj6lA7V4zXgfS7Qt4/lYu0MlYaqro/2C/Rc+tMwHk 15aODJEeqYRdCduMmwjDg3N7KwXIU83vl5qlSPAep5EvVRztXOe4XeWVcrR1+ZBmCtLi qzljRZYyJxWwUe2Xug8mHEgfXTbvd7UpcVaXswqblvIYODiGTzJRDSr+It1qQMxHp/tu EjsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=xnfqTVpkKf7ej6M0FYImeMSn260QIHa5CC7l4EjkmFg=; b=cprE6cE9zRaIaHHsyMSgQAMT2+TlEI/eGEUUtmaeM+4I38MoD72hwOYYfyHA2rlPuq ZkPausNo/6Ak2YNHZv8ddr9Son+5vGG3z/W0FOv/o5uLOFuPrZ4nPmgXldUooa+7A5yC 1WxvO4ST6Q6yv6OkDLVyIcVMfHCIYqTfS/bms8VDoCR1dytuN5iTZSPbgtUcHgxaayK5 OcJ8p73cPaMeNs1uysB+TNRPiE0IccwFIkPn1524HYhApLeWP09AfCF1Zwn4ItaPUYOw AFr/PJ0R7440crwZuTfMAJZAS9jDDivLPOJ0HqQ1ymsQA1a2jzdsIAXRxSLMuWdN3jqj ACCQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cr15si1046068ejc.676.2021.05.05.17.33.43; Wed, 05 May 2021 17:34:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230048AbhEFABh (ORCPT + 99 others); Wed, 5 May 2021 20:01:37 -0400 Received: from mga07.intel.com ([134.134.136.100]:25037 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229717AbhEFABh (ORCPT ); Wed, 5 May 2021 20:01:37 -0400 IronPort-SDR: jVqDgodxt+kIVk8/aK+SZ/Bwlr/MeetGs2Y94KzKfQoi9AasHDmc5iQ8DNqaccOoEmVFjqm/pw 7twHrQN0E8xg== X-IronPort-AV: E=McAfee;i="6200,9189,9975"; a="262275319" X-IronPort-AV: E=Sophos;i="5.82,276,1613462400"; d="scan'208";a="262275319" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2021 17:00:13 -0700 IronPort-SDR: MiDK5L27NDfnkfqXtcDSsGy9F7Qhs4bjmOfsa/ErInC4zma1y9qyA9ODJsTla/3FvmBKW0Hy6q GDYgAOEtWbKw== X-IronPort-AV: E=Sophos;i="5.82,276,1613462400"; d="scan'208";a="430179714" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2021 17:00:13 -0700 Date: Wed, 5 May 2021 17:00:13 -0700 From: Ira Weiny To: Kees Cook Cc: Rick Edgecombe , dave.hansen@intel.com, luto@kernel.org, peterz@infradead.org, linux-mm@kvack.org, x86@kernel.org, akpm@linux-foundation.org, linux-hardening@vger.kernel.org, kernel-hardening@lists.openwall.com, rppt@kernel.org, dan.j.williams@intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC 0/9] PKS write protected page tables Message-ID: <20210506000013.GE1068722@iweiny-DESK2.sc.intel.com> References: <20210505003032.489164-1-rick.p.edgecombe@intel.com> <202105042253.ECBBF6B6@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202105042253.ECBBF6B6@keescook> User-Agent: Mutt/1.11.1 (2018-12-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 04, 2021 at 11:25:31PM -0700, Kees Cook wrote: > On Tue, May 04, 2021 at 05:30:23PM -0700, Rick Edgecombe wrote: > > > Performance impacts > > =================== > > Setting direct map permissions on whatever random page gets allocated for a > > page table would result in a lot of kernel range shootdowns and direct map > > large page shattering. So the way the PKS page table memory is created is > > similar to this module page clustering series[2], where a cache of pages is > > replenished from 2MB pages such that the direct map permissions and associated > > breakage is localized on the direct map. In the PKS page tables case, a PKS > > key is pre-applied to the direct map for pages in the cache. > > > > There would be some costs of memory overhead in order to protect the direct > > map page tables. There would also be some extra kernel range shootdowns to > > replenish the cache on occasion, from setting the PKS key on the direct map of > > the new pages. I don’t have any actual performance data yet. > > What CPU models are expected to have PKS? Supervisor Memory Protection Keys (PKS) is a feature which is found on Intel’s Sapphire Rapids (and later) “Scalable Processor” Server CPUs. It will also be available in future non-server Intel parts. Also qemu has some support as well. https://www.qemu.org/2021/04/30/qemu-6-0-0/ Ira