Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4040237rwb; Tue, 8 Nov 2022 11:14:35 -0800 (PST) X-Google-Smtp-Source: AMsMyM6sP8C3d7xIXXT+evShXZs6sWoZ7fGGdbjiVTrPIb4rUf40VdFn4sC5uPZmcbpTfYaazXfx X-Received: by 2002:a17:907:a04c:b0:7ae:2eb5:8bd1 with SMTP id gz12-20020a170907a04c00b007ae2eb58bd1mr22823414ejc.571.1667934875686; Tue, 08 Nov 2022 11:14:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667934875; cv=none; d=google.com; s=arc-20160816; b=RJgk2gW4ChvsMZXMkRJUIToqF4ck67c2UM4pVufRELA30FR5OglPCBy2gCxxcE4Nq1 9QEbD3nvKNhRrNYPpCWdPNuf3mvXVZPFe3QYPMLP8pNITvFI8w7Iq0mFTgesGV49hhAN RHNfDB9FD/qVdBvlzECWe84n6ua28L7c/N8DB24tbraHSOp9D57h4TX1f2nsm2B801HC ZcIJNsw3AQ646HpUw4okIPrZ4rfCX77uojznj3Zb73h7YJInmfseGnvQwCTwfcRSc/RJ xMH0qbeHhZIdmIkgR/d+lwGYiprhdxkES2+XWBC7kSIsu8wm0mT14TmyUCHdWK1U75cm jfzQ== 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=1L5kOZNHYfCA3IRYVLUmKIQqOspk+Yz3BJ9Q+3CIhRs=; b=T6qMOraVzNmFnWN6IKRcnIYelsZ/E01tI8nD3bFaSjLppnF9ZrlaTwEo7tbiCFv/Hj QErG4i6ob1M9NMapb7gUf6sSjq2lMN1RmYzO/EDmVRVXDTG5cu5QPhX5P34iaqglRGbZ inys1RRunjn5dM4RhxtmN1mEwMNojShbCPDm9IeRy017tdgT4ANG6iWBATeq7ZHdTNLu UN/k/KJhAspd+RocyoMYlkvEPiGRykxao63Di5E0hH9tUsMt66+hmxO83w2a9dfdzta1 KiRWUtRwmHCzAqUwoc/bqST0bxuxbdFnCvZC2NtniRJNJeESccIu35vxZknrG1ZfQJah AvIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=W78BfCdz; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dn10-20020a17090794ca00b007a45e4f4ff0si14506260ejc.885.2022.11.08.11.14.13; Tue, 08 Nov 2022 11:14:35 -0800 (PST) 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=@google.com header.s=20210112 header.b=W78BfCdz; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229593AbiKHSuI (ORCPT + 91 others); Tue, 8 Nov 2022 13:50:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229511AbiKHSts (ORCPT ); Tue, 8 Nov 2022 13:49:48 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1DE568284 for ; Tue, 8 Nov 2022 10:48:50 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id f63so14160889pgc.2 for ; Tue, 08 Nov 2022 10:48:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=1L5kOZNHYfCA3IRYVLUmKIQqOspk+Yz3BJ9Q+3CIhRs=; b=W78BfCdzW3rFNxBBa9CJ99fIOIknqSWEHZQpGE4CP0gnNR+4VJ+1rYb8sEs0NBsASe K4rEBjnnoCJk0a33aTy3cf9rfMp4VkUTZPwynhqWc6xUvWZh5c7hCT/NquaGP8tWiAmk hcNg7xenoISlUZ3pmp4wYxBJpQOoNNtgg3hIJ2CWRKxb7/HZIa1PVdjWFm4ksV+cIxq8 YrF3aINsofbWuXc8co8smgqZQglTdPK9ATlmu723Lc7vcDYFsIrqGa+4SDMwuJYOSwOW VL0XN5QRJNpA74ovJB+2axjmbYlMF5U+hQWpwC53WgZLq2bVPa2W9STH+x/xfs2jlapp IPrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1L5kOZNHYfCA3IRYVLUmKIQqOspk+Yz3BJ9Q+3CIhRs=; b=mz5nvYRSkoD7sHNS55pyOX7CYLBmeXiauClBl+nRYQZzJSyZP/oPD8rAr0zBpC1dvm dprh42bmmKeDodb8WNZvltW7i2PL39RcIjchbJ7NW42dUtNe2Tws/OOAlQm4pCPMpjXj b2k4aOwpJE2dwTKjzetadi9zUP9cT1sq8R9kTBDExoA12qVhc3VvOtTz8ndfo7ZUgbQB rriAbTKLT23xLZ1olXS32JNdT0KXmZfBIu9Hkqn3O/eA7s0agcEIEz/1n+MtEXUHCOpq Qz5/eH62ko4lFz2gNR8qWkwOdeC9LTRxxO/l5zBvU7outMxyf4/Q3FO7SYtV7n4g3cK2 9h5Q== X-Gm-Message-State: ACrzQf1aNDctDF4xgw1rGsIt9ImdmRWWlqKLdufo6KKymgUJzh9Mm2oo kY9DTRAAZ2el/NpS2iGpf0riRg== X-Received: by 2002:a05:6a00:1a44:b0:528:6af7:ff4a with SMTP id h4-20020a056a001a4400b005286af7ff4amr57736839pfv.78.1667933330266; Tue, 08 Nov 2022 10:48:50 -0800 (PST) Received: from google.com (7.104.168.34.bc.googleusercontent.com. [34.168.104.7]) by smtp.gmail.com with ESMTPSA id e13-20020a17090301cd00b0018855a22ccfsm7325722plh.91.2022.11.08.10.48.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Nov 2022 10:48:49 -0800 (PST) Date: Tue, 8 Nov 2022 18:48:46 +0000 From: Sean Christopherson To: "Huang, Kai" Cc: "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Yamahata, Isaku" , "pbonzini@redhat.com" , "Shahar, Sagi" , "Aktas, Erdem" , "isaku.yamahata@gmail.com" , "dmatlack@google.com" Subject: Re: [PATCH v10 005/108] KVM: TDX: Initialize the TDX module when loading the KVM intel kernel module Message-ID: References: <99e5fcf2a7127347816982355fd4141ee1038a54.1667110240.git.isaku.yamahata@intel.com> <0feaa13fa5bf45258f2ebb8407eaefadf5c48976.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0feaa13fa5bf45258f2ebb8407eaefadf5c48976.camel@intel.com> X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 Tue, Nov 08, 2022, Huang, Kai wrote: > > +int __init tdx_hardware_setup(struct kvm_x86_ops *x86_ops) > > +{ > > + int r; > > + > > + if (!enable_ept) { > > + pr_warn("Cannot enable TDX with EPT disabled\n"); > > + return -EINVAL; > > + } > > + > > + /* MOVDIR64B instruction is needed. */ > > + if (!static_cpu_has(X86_FEATURE_MOVDIR64B)) { Nit unrelated to Kai's comments: use boot_cpu_has(), not static_cpu_has(). This is run-once code that's not a hot path so there's zero reason to trigger patching. > > + pr_warn("Cannot enable TDX with MOVDIR64B supported "); > ^ > without > > + return -ENODEV; > > + } > > I think you should explain why MOVDIR64B is required, otherwise this just comes > out of blue. > > Btw, is this absolutely required? TDX also supports Li-mode, which doesn't have > integrity check. So theoretically with Li-mode, normal zeroing is also OK but > doesn't need to use MOVDIR64B. > > That being said, do we have a way to tell whether TDX works in Ci or Li mode? > > >