Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2373403rwb; Thu, 17 Nov 2022 09:53:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf4CLh+rdKntbMPSritkP9BAnWwNeXNHswINaCjhjRkFu0UuQJQB7Zx1gI5o3eVC457/KCAk X-Received: by 2002:a17:906:3385:b0:7a2:b352:a0d3 with SMTP id v5-20020a170906338500b007a2b352a0d3mr2973267eja.399.1668707609707; Thu, 17 Nov 2022 09:53:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668707609; cv=none; d=google.com; s=arc-20160816; b=R3StdwW2jfzFkUSLByi3PAETSzb4+fUJTbVrf3JurAPlGE0AnRGd838Y8qvWQHuO8i TPgcAzxFkCQ+K2NjrlBj4NrSRWefzI4JAB3vB1x50IUOUb+0qSnvh/nJfd6CI98TRCcZ HD8lXWuELxC0Ylgo57fLpj+LUehu75XKlev+/LAor+Z1UO2lNrdvNXq7lta+zlENhdgM q+SqAMpI0gcXZzS7xDSBTPO7i+m3FmmU5b6X80mVp05S2c6tg6yGIhw6xtVT21eBF0O1 9X5pz7el+CM5WRh1wvt1BAaUyZAgZLLmij3LbmrUPEyExINuwq+JDju9rRuVliJlwtOS ovjw== 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=irBTpzdt3UKRDSaNb8P0V0IX9do/eaeR5wsA7XkY2ZM=; b=gYYFrkkeMv1bDLZc6mF8mxhDPzvo0cxD9ztLpVbJlfTSeVtLJETNrPs260nUyfY8wo 2QFjy20L9mjmJbiiSvjwUkQyVTKQLeVNN45i/NaDOXEbUZDUKM8HT+JTs6V1soM+rOF8 HG1VHTQtGDu7//0ssO6CcwT+QR2JHZBroz6kUeCes7ZEkqhzeFVp/sBZmFp5AFZIRcKf ii+K7QqMEprJo9CTJVb1J2JWcEIbz76i92rQMnAQKws0N8tmaNpfm4+Tpr+spnmh28pe Rov2ZvoiiaRK/JiCgkFSFjn9cYZSTxEybrgh+lsTS/RMTQa5CalY5Dn1mgbfTK9CdMju 36Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=he3HAFo1; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k9-20020a056402048900b004683ad010absi1130146edv.340.2022.11.17.09.53.04; Thu, 17 Nov 2022 09:53:29 -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=@gmail.com header.s=20210112 header.b=he3HAFo1; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240091AbiKQRdK (ORCPT + 93 others); Thu, 17 Nov 2022 12:33:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232427AbiKQRdG (ORCPT ); Thu, 17 Nov 2022 12:33:06 -0500 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 411BB79E16; Thu, 17 Nov 2022 09:33:06 -0800 (PST) Received: by mail-pf1-x42c.google.com with SMTP id d192so2479465pfd.0; Thu, 17 Nov 2022 09:33:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.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=irBTpzdt3UKRDSaNb8P0V0IX9do/eaeR5wsA7XkY2ZM=; b=he3HAFo1vLSohQ1GDMkdmyEQuAtzCtKtgHDZ9rpSjs/rlQYgBG2tiS79xmS9Or1e8X C2uBPXlyMuubFKL8UqsXYX0n27S5LwIYGhWJkkZe5qXRkrrRjpIezlltEoyKSIR166Rn dZ5HCa8vzD4epku1LfsNmvU8CLXTd/fKYF6ELgR8SE6XfL/ZRhDihUj3KpmndifWM4ur cj/o4R9gxWPfMwfmofXWxUFeJDhlw70mq2cV6+5ZEm7VszZOWHjadrcz5wM0iviLwCTH Y34E6E0Xlxc9S8nLc4UiwngYQINpmL8DdA0PhP6qHlz900Nfsb5unfx2oSKJR/JJwbak MugA== 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=irBTpzdt3UKRDSaNb8P0V0IX9do/eaeR5wsA7XkY2ZM=; b=bLAaxue1bEXUh5Zl/0FKUOFS1FvKvL4ue+tMjepImAfxlGhu/O2DhOKAuFihTbSLwQ IKNDlfg8/Nmw9fer4zdt8fQphAH2TcE7vDNbxVQmBDW+PG77/m6zuseR0e7It3sRKl9c 6/AjjzSOd9iUeok/lziR5dz+PL1TsiWoWQH5wv4yFH4mAy5QrpB+PIHWSFnnaH0QTpnk nU8SdpRlZ5i5yHsTgUf1IBmstl1y+xUwKdwtff/aUWKP6O2qg+BwmZVAQtrr23Yu3m0t vk0//iFI4kgnFd2ASY/6DlHEBrJxJNi0DXvFbuB3e7YZfE453gEhrLn7g80pSQruUPFq Thcw== X-Gm-Message-State: ANoB5pnHhOpXIT7OZt2QSPAuSCZ9ldGtxXYPP1y/DGLTgW3zz49ZsFqr Thsg924szY8OnIE1vZiENAey+5sotUo= X-Received: by 2002:a63:171e:0:b0:476:9983:b395 with SMTP id x30-20020a63171e000000b004769983b395mr2972617pgl.355.1668706385524; Thu, 17 Nov 2022 09:33:05 -0800 (PST) Received: from localhost ([192.55.54.55]) by smtp.gmail.com with ESMTPSA id 34-20020a631362000000b004597e92f99dsm1220728pgt.66.2022.11.17.09.33.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Nov 2022 09:33:04 -0800 (PST) Date: Thu, 17 Nov 2022 09:33:03 -0800 From: Isaku Yamahata To: Erdem Aktas Cc: Isaku Yamahata , "Huang, Kai" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Yamahata, Isaku" , "pbonzini@redhat.com" , "Shahar, Sagi" , "dmatlack@google.com" , "Christopherson,, Sean" Subject: Re: [PATCH v10 005/108] KVM: TDX: Initialize the TDX module when loading the KVM intel kernel module Message-ID: <20221117173303.GB2350331@ls.amr.corp.intel.com> References: <99e5fcf2a7127347816982355fd4141ee1038a54.1667110240.git.isaku.yamahata@intel.com> <0feaa13fa5bf45258f2ebb8407eaefadf5c48976.camel@intel.com> <20221114231835.GA2350331@ls.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 Tue, Nov 15, 2022 at 04:22:13AM -0800, Erdem Aktas wrote: > On Mon, Nov 14, 2022 at 3:18 PM Isaku Yamahata wrote: > > > 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? > > > > As long as I don't know. When clearing page, we can use > > if (featuremovdir64b) movdir64b else memset(0). > > -- sorry for resending the same email, for some reason my previous > email was not in plain text mode-- > As far as I know, Li mode and Ci mode both are working very similarly > and require movdir64b to clear any poison bit previously set. Why > would movdir64b is not supported in a tdx capable cpu? In practice, movdir64b can be safely assumed to be supported, I think. Strictly it's not guaranteed by SDM. There are two options. 1. Assume modir64b. If it's not supported, KVM refuses to enable TDX. + Don't care CI-mode or Li-mode - not strictly conforming to SDM. In practice, it won't matter. 2. Don't assume movdir64b. If movdir64b not supported, use memset(0). + strictly conforming to SDM - needs to care Ci-mode or Li-mode. So I'll choose option 1. -- Isaku Yamahata