Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4441418ioa; Wed, 27 Apr 2022 04:04:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwK28t7XTJl2xpEcmehSAp7sGPNNz21Y1mdhPkFxqEP6hBSksxv1ucxJgzrUlA5va2NXjCE X-Received: by 2002:a17:90a:8b8b:b0:1ca:6007:36e5 with SMTP id z11-20020a17090a8b8b00b001ca600736e5mr32339965pjn.128.1651057494104; Wed, 27 Apr 2022 04:04:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651057494; cv=none; d=google.com; s=arc-20160816; b=vSHjEIESkh5lxrryX+QjIjPjxirvLb6JmDtOMuoYKYK1BmbUv7p3RjYWMMr47+N0i+ mSaTZbz1Iw6DiJ2TSzoPqmNM6xJIJoOt4j+C537vJKjDWW6JbEYsj1bCpIp2JHV/yPLo RdoJ6/sKLKly6+KJcC+oG4KerjtShbeANM3Qxip4IBdAXPV8NV4RBmBy9TL6IByZdZUy aAwuMuUTPF8VeBycOQzNDDp1fJ/cO9Pz63SFuWr4vXnDwZt1NgVnYnXE1zFKsgts6U90 nHoIH3mcSUNwROtDdcoA8m4X5/xeEbktZ82mCAY0BsmTG6AXg7f/vWFtBqzVG46F8Ost bLNQ== 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=9ewLJKlH5zy14vPQwt03lQTFufmxKgCiHNQV6gaoQdc=; b=EOXh0nACeRXfEP6W1yYa7LAv1nmaQrnxFM+GqBRE07asO0AJ8wLdWS+F4qYI3dAHTD nP1r9vNX80IQLktOSWBgLy/Xk1EJDbIZzXFG+i0T0p5PpO7esbH0Pqus35x9n5cdtZWZ dtkD0VwjeiUca1RS888umSSik+AjI4u2S+PfI636uS7xedh1L6AtYMlKIskO8XiXNgXy KS1/7GeAU16qehQHDLzB1mgb7tB496gyXdL9TqsI6NUxZjP1yUygSBMc5k0gHYlsIbOz jjMcLHlxPalpJVtCJeFMEvr4+c5fTrgvPnA7Ah6ETMGEdeNzk/cfANXfKVbpjHBS6HcI 3HJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Zp0fAJXP; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h192-20020a636cc9000000b0039d76139daasi1087228pgc.432.2022.04.27.04.04.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 04:04:54 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=Zp0fAJXP; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 37D60470861; Wed, 27 Apr 2022 03:15:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356381AbiD0AZv (ORCPT + 99 others); Tue, 26 Apr 2022 20:25:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356375AbiD0AZs (ORCPT ); Tue, 26 Apr 2022 20:25:48 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F3BC4EDC0 for ; Tue, 26 Apr 2022 17:22:39 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id h12so201873plf.12 for ; Tue, 26 Apr 2022 17:22:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9ewLJKlH5zy14vPQwt03lQTFufmxKgCiHNQV6gaoQdc=; b=Zp0fAJXPYfQHtfD/574b5Ctm9LKGBHi6SdFtrrS9nbSK0rnjaNH/ZflGxIlKAEpgQ7 fCuqLnT8AdInvq79GrOlL7DhzsSnaJyUI0+tLN6mhM/u5qdyJ1xXaAEcLGmV2ETDTUBK 1Kq/p8KqfaUcSJ9BtggMPh82WeHPIySE6tv7z4Jniso6L38NOwhnpOteHLqBZ00xCX49 dJ7z8PE0nrmjDH/VuuPHZoym+WxS/RT0BuniPVSuzrtBmW/75pV+vfYOtgCtDrVlb3Ga UOOwRQZPQN0piq9ySZtanVROVE8/WKq2eTu8+qkzxQdOoJYnZ1r6X/T7Gda0bUuZPfYA 8kpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9ewLJKlH5zy14vPQwt03lQTFufmxKgCiHNQV6gaoQdc=; b=6rTZe3fHjZVJLn5KS8yBTxT3XiGXai9yHvMRnRYsjKasJRzP9PdpkU1e2H2GiXvpbo 5E/JJypShAJ6XmTUxvP7FOeWej1IdYZ1PceVakQ2/P+9WCG3SXtIjSS71jis25wDq/0W rd2ivEgomGTivJz8r56mCqr+nr8eaQY75+a42JNPdc8RC9NKkViAw90uexEZzlMD6uSP SG2UDmP5vW8T/HNu/KHrDV197dCGYYdI8zoYwkEQpKbCrWL92i7EmzE78DOS5AIZ4fOa Ct2mrjnqorT3Umoy3MpdiptLJyzYph0i/Mfv5TbUhBxPgNk5hbfhlPSPEomfaMrHNMVA smaA== X-Gm-Message-State: AOAM533vZZa65S/3vup4Ufvltdde58uLDqyogcHtr25CS4qQsxamZQLz ZHWeCFM62k1SPFnBmDQW780veA== X-Received: by 2002:a17:90a:488c:b0:1c7:b62e:8e8c with SMTP id b12-20020a17090a488c00b001c7b62e8e8cmr40228125pjh.157.1651018958588; Tue, 26 Apr 2022 17:22:38 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id s4-20020a056a00194400b004fb358ffe84sm16589662pfk.104.2022.04.26.17.22.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Apr 2022 17:22:38 -0700 (PDT) Date: Wed, 27 Apr 2022 00:22:34 +0000 From: Sean Christopherson To: Kai Huang Cc: Dave Hansen , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, pbonzini@redhat.com, len.brown@intel.com, tony.luck@intel.com, rafael.j.wysocki@intel.com, reinette.chatre@intel.com, dan.j.williams@intel.com, peterz@infradead.org, ak@linux.intel.com, kirill.shutemov@linux.intel.com, sathyanarayanan.kuppuswamy@linux.intel.com, isaku.yamahata@intel.com Subject: Re: [PATCH v3 01/21] x86/virt/tdx: Detect SEAM Message-ID: References: <334c4b90-52c4-cffc-f3e2-4bd6a987eb69@intel.com> <15b34b16-b0e9-b1de-4de8-d243834caf9a@intel.com> <79ad9dd9373d1d4064e28d3a25bfe0f9e8e55558.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <79ad9dd9373d1d4064e28d3a25bfe0f9e8e55558.camel@intel.com> X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,USER_IN_DEF_DKIM_WL autolearn=no 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, Apr 27, 2022, Kai Huang wrote: > On Tue, 2022-04-26 at 16:28 -0700, Dave Hansen wrote: > > On 4/26/22 16:12, Kai Huang wrote: > > > Hi Dave, > > > > > > Thanks for review! > > > > > > On Tue, 2022-04-26 at 13:21 -0700, Dave Hansen wrote: > > > > > +config INTEL_TDX_HOST > > > > > + bool "Intel Trust Domain Extensions (TDX) host support" > > > > > + default n > > > > > + depends on CPU_SUP_INTEL > > > > > + depends on X86_64 > > > > > + help > > > > > + Intel Trust Domain Extensions (TDX) protects guest VMs from > > > > > malicious > > > > > + host and certain physical attacks. This option enables necessary > > > > > TDX > > > > > + support in host kernel to run protected VMs. > > > > > + > > > > > + If unsure, say N. > > > > > > > > Nothing about KVM? > > > > > > I'll add KVM into the context. How about below? > > > > > > "Intel Trust Domain Extensions (TDX) protects guest VMs from malicious > > > host and certain physical attacks. This option enables necessary TDX > > > support in host kernel to allow KVM to run protected VMs called Trust > > > Domains (TD)." > > > > What about a dependency? Isn't this dead code without CONFIG_KVM=y/m? > > Conceptually, KVM is one user of the TDX module, so it doesn't seem correct to > make CONFIG_INTEL_TDX_HOST depend on CONFIG_KVM. But so far KVM is the only > user of TDX, so in practice the code is dead w/o KVM. > > What's your opinion? Take a dependency on CONFIG_KVM_INTEL, there's already precedence for this specific case of a feature that can't possibly have an in-kernel user. See arch/x86/kernel/cpu/feat_ctl.c, which in the (very) unlikely event IA32_FEATURE_CONTROL is left unlocked by BIOS, will deliberately disable VMX if CONFIG_KVM_INTEL=n.