From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5394BCA9EC6 for ; Wed, 30 Oct 2019 18:36:25 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 140F120856 for ; Wed, 30 Oct 2019 18:36:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="j9ShH8T6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 140F120856 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id AF6426B0005; Wed, 30 Oct 2019 14:36:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AA5A56B0007; Wed, 30 Oct 2019 14:36:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9461E6B0008; Wed, 30 Oct 2019 14:36:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0076.hostedemail.com [216.40.44.76]) by kanga.kvack.org (Postfix) with ESMTP id 6C3506B0005 for ; Wed, 30 Oct 2019 14:36:24 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 13D54181AEF0B for ; Wed, 30 Oct 2019 18:36:24 +0000 (UTC) X-FDA: 76101306288.16.watch18_54e6f2eb9755a X-HE-Tag: watch18_54e6f2eb9755a X-Filterd-Recvd-Size: 5486 Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by imf18.hostedemail.com (Postfix) with ESMTP for ; Wed, 30 Oct 2019 18:36:23 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id v4so2173046pff.6 for ; Wed, 30 Oct 2019 11:36:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ewz3zGoQ/oT5sufHB6AjuO7iLzPrn+V2j8p2b6vWOYM=; b=j9ShH8T6jz5E6OrGiP0hvGkLhPbya+dw5H60tZ92Gksg1qYjPxxq5wfrXbGL+ZiZeo btNWixMcREdlNj/24ebkecof9Hz2OdRon/7KFD02WdvlSP9H3u0+Q1DG+1JP5N8cRgLr 1WjV1UHgu3iE7sp7rbhafhaV+dGRci8vNX5K8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ewz3zGoQ/oT5sufHB6AjuO7iLzPrn+V2j8p2b6vWOYM=; b=Ae+B7BfcsJDQ0C2uIbEKQYfELzXYDJse0rg964PMMvsPXWJrl34qdoWMI8+roaFN0F Gd3Xr8w5t4J0WtO4c/SFq5qcCMvU4w7SkEd2S/cDeCz2NeP1CTEuxBEj6ETRcTi5p34y zbw6cYPeRdL2Zf3uZ6WNEK9JsMxdMSTJs6v7JleBgYTxZU/MKJL0RyKTZwMyuoHj3E7s ku2vn1CDgFe/1k8I5cq7UqiTo3vbP2GFC0ggVoNRE1ZCdD7Zd5o7urBi0AxM8ow0QZ2h DOB48gC1Wx/NKiLedCPr4BZ4OVne9j08OlN/8qLNUS/KcMvzPbRX9GX/2BsMyHpv8ZTq h42Q== X-Gm-Message-State: APjAAAUvQTZgSAWc0hFE5dxnXKgorUtVyOSwkYNIOM29NnVzM1UDIjvi EG7KDnB4CNTf/TwypjlFnYiROA== X-Google-Smtp-Source: APXvYqwEtldzCMnvxhg77NCeWsf2VanRztD/Ae5V4HsJ7lg7BT821TOwACbTkrdMpNcTlSy+1+dsBw== X-Received: by 2002:a17:90a:304:: with SMTP id 4mr878674pje.128.1572460582367; Wed, 30 Oct 2019 11:36:22 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id a8sm678123pff.5.2019.10.30.11.36.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2019 11:36:21 -0700 (PDT) Date: Wed, 30 Oct 2019 11:36:20 -0700 From: Kees Cook To: "Edgecombe, Rick P" Cc: "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "peterz@infradead.org" , "Dock, Deneen T" , "Christopherson, Sean J" , "linux-mm@kvack.org" , "x86@kernel.org" , "kristen@linux.intel.com" , "luto@kernel.org" , "pbonzini@redhat.com" , "Hansen, Dave" Subject: Re: [RFC PATCH 13/13] x86/Kconfig: Add Kconfig for KVM based XO Message-ID: <201910301135.BDC4C7696@keescook> References: <20191003212400.31130-1-rick.p.edgecombe@intel.com> <20191003212400.31130-14-rick.p.edgecombe@intel.com> <201910291634.7993D32374@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Oct 30, 2019 at 12:01:18AM +0000, Edgecombe, Rick P wrote: > On Tue, 2019-10-29 at 16:36 -0700, Kees Cook wrote: > > On Thu, Oct 03, 2019 at 02:24:00PM -0700, Rick Edgecombe wrote: > > > Add CONFIG_KVM_XO for supporting KVM based execute only memory. > > > > I would expect this config to be added earlier in the series so that the > > code being added that depends on it can be incrementally build tested... > > > > (Also, if this is default=y, why have a Kconfig for it at all? Guests > > need to know to use this already, yes?) > > > > -Kees > Hmm, good point. One reason could be that this requires SPARSEMEM_VMEMMAP due to > some pre-processor tricks that need a compile time known max physical address > size. So maybe someone could want KVM_GUEST and !SPARSEMEM_VMEMMAP. I'm not > sure. Good point about the combination of other CONFIGs. All the more reason to move it earlier, though. -Kees > > > > > > > Signed-off-by: Rick Edgecombe > > > --- > > > arch/x86/Kconfig | 13 +++++++++++++ > > > 1 file changed, 13 insertions(+) > > > > > > diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig > > > index 222855cc0158..3a3af2a456e8 100644 > > > --- a/arch/x86/Kconfig > > > +++ b/arch/x86/Kconfig > > > @@ -802,6 +802,19 @@ config KVM_GUEST > > > underlying device model, the host provides the guest with > > > timing infrastructure such as time of day, and system time > > > > > > +config KVM_XO > > > + bool "Support for KVM based execute only virtual memory permissions" > > > + select DYNAMIC_PHYSICAL_MASK > > > + select SPARSEMEM_VMEMMAP > > > + depends on KVM_GUEST && X86_64 > > > + default y > > > + help > > > + This option enables support for execute only memory for KVM guests. If > > > + support from the underlying VMM is not detected at boot, this > > > + capability will automatically disable. > > > + > > > + If you are unsure how to answer this question, answer Y. > > > + > > > config PVH > > > bool "Support for running PVH guests" > > > ---help--- > > > -- > > > 2.17.1 > > > > > > > -- Kees Cook