Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2434imw; Wed, 13 Jul 2022 17:36:17 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s8uuBtFJ3czNDmAyDrL9eVUHFXZA5WZNb4i66OgTi971orqF7IConU5nxtH61wBsqwK/zp X-Received: by 2002:a05:6a00:1da9:b0:52a:c339:c520 with SMTP id z41-20020a056a001da900b0052ac339c520mr5764125pfw.70.1657758976933; Wed, 13 Jul 2022 17:36:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657758976; cv=none; d=google.com; s=arc-20160816; b=DAlVrq6oerpBoLcZK5Rrp2jAk5b8c7UkXUztWZboSIpXZVUEcRKNS4wYRzxoxbk08h 10aK7obNE3PmggIBJLiJTtbbGRsGBTrwRh4GUqb4/u1Eypt8cWXMZwvXkprcxJzHnLa7 6kzyULqJ8dKeBPo8C+CdWRGD+WZer1Sl/dsZW06hQW6zBJGmeayT1GG7HEcgnIxUnPpG K3Cp/KSctdte+7+bEGtSoOKnpCY4Gb3c4ZaIPagkstfhDvAsIkNEt5Ro5+x5F+xvBtfx sa2PzBzx64elRPUfDepCaWm1dfvRuknFpgq4C+9vOPGh27s8o/rELa4mu2XD6Iis0GG5 fXnQ== 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=Ii6n5f/fOOUgR7/Y+drLs3iaf97b0TdLdk/emGlXIF8=; b=Ww0ZLOuB5CsLkXlz5co/VqRcGhV4S82zOD6vq6xTCtMJJthRryCCo9i7InPvoaS+NQ Es17diVY4BeXdGzn1bBQb40EYv0qNCb6yS3QnwpicRX5PRjdmymJInHNImnq6/i03ckI qgZhaG05TRhDEO4SztWLw0BBzsoeDbJ973xIzmBUV0uVfRcCPVo/wf2Rctybr5ziWCaU XWMjS2KDEKDNZVIkKydB+qSZhRE7h6W8BoXMSgaxRunF6U8HjY928nUPaVKE/xBvuAmo qF63nuKj1lKW9a069hWBGmMHes5XoNB7Rmb1EL8b9ia5OI045BYjiz0TYRFz/857Up0N gTCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ozPeQ7X1; 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 s22-20020a056a00195600b0052b18386fcbsi460836pfk.265.2022.07.13.17.36.04; Wed, 13 Jul 2022 17:36:16 -0700 (PDT) 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=ozPeQ7X1; 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 S232382AbiGNAO4 (ORCPT + 99 others); Wed, 13 Jul 2022 20:14:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231814AbiGNAOu (ORCPT ); Wed, 13 Jul 2022 20:14:50 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E31D11C22; Wed, 13 Jul 2022 17:14:49 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id s21so715889pjq.4; Wed, 13 Jul 2022 17:14:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=Ii6n5f/fOOUgR7/Y+drLs3iaf97b0TdLdk/emGlXIF8=; b=ozPeQ7X1kcTmBBScHFKnFfyDyNw/sFsnuWoQBn24wlNUkRMey86RifvZVHAeWEWRAJ AD7u1b6TakJrQk0gpILsEdOdG6RiLTMvbWfI7mDeAa8h6H0IbzUTovEQHdXFicZLuufl s+lPFRm9tWVjFjzG45N7F+OFl7AOui5juvhYJzN1J+o/GusFi50xdTieNjUPo0eT3i8n OiZfWIXO2tfXWEO4XSCB4zNc7KGzDQqzPRHTVxx3UplO4QaiYJoQFRMFI80hnWRozODj hxObSEk7cmBmnqb8oATNr/Uo+gYGBmukMQrXmAQ/ot7dk7KKegxqEor5uLPL7weLA5JQ Z9/Q== 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=Ii6n5f/fOOUgR7/Y+drLs3iaf97b0TdLdk/emGlXIF8=; b=orRJSemPEgTkEJmG2hL9N+dfePCHpJIZMWAAwxZqk0x2CErZuQ3bOMBUYsw7smPOXM GLZSQ9WTTLltJJm962Wvda9dSf38s+cv9PVENOD5U77qKmdp89SE+jeTcisviE64lKGj bbGfZ166F+BR7DxOZnRVOWkMT0+a3sHCAjhiz6m9wxTWammt4WPq9JMKBPKhWIumDcyh /pYKIGsFd2/zwyGdwFZSX2ysS66Co45pOrf1Xw91ydJbm3pk8WfFnwrMX3C8WBUYbGzH xy8XPG93Lw18aTCj1SSLVSMZHAQ0iMMrc3p48PoTkHS1chMzC1oHk4dj2GMoTCnBo4RA DMHQ== X-Gm-Message-State: AJIora/n8U03yC2Eoe7436jABbKG3a5VUEU13fCq5vI+Skmo0D/5mzzT CWwSvbCINHT4vXb3CjMBHGI= X-Received: by 2002:a17:903:32c1:b0:16c:35b2:18c3 with SMTP id i1-20020a17090332c100b0016c35b218c3mr5599782plr.126.1657757688598; Wed, 13 Jul 2022 17:14:48 -0700 (PDT) Received: from localhost (fmdmzpr02-ext.fm.intel.com. [192.55.54.37]) by smtp.gmail.com with ESMTPSA id c14-20020a170902c2ce00b0016c84677aa2sm28094pla.9.2022.07.13.17.14.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jul 2022 17:14:48 -0700 (PDT) Date: Wed, 13 Jul 2022 17:14:46 -0700 From: Isaku Yamahata To: Kai Huang Cc: Isaku Yamahata , isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini , Rick Edgecombe Subject: Re: [PATCH v7 033/102] KVM: x86/mmu: Add address conversion functions for TDX shared bits Message-ID: <20220714001446.GR1379820@ls.amr.corp.intel.com> References: <69f4b4942d5f17fad40a8d08556488b8e4b7954d.1656366338.git.isaku.yamahata@intel.com> <6cc36b662dffaf0aa2a2f389f073daa2d63a530b.camel@intel.com> <20220713045225.GP1379820@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,T_SCC_BODY_TEXT_LINE 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 Wed, Jul 13, 2022 at 10:41:33PM +1200, Kai Huang wrote: > > > > > > > And by applying this patch, nothing will prevent you to turn on INTEL_TDX_HOST > > > and KVM_INTEL, which also turns on KVM_MMU_PRIVATE. > > > > > > So 'kvm_arch::gfn_shared_mask' is guaranteed to be 0? If not, can legal > > > (shared) GFN for normal VM be potentially treated as private? > > > > > > If yes, perhaps explicitly call out in changelog so people don't need to worry > > > about? > > > > struct kvm that includes struct kvm_arch is guaranteed to be zero. > > > > Here is the updated commit message. > > > > Author: Isaku Yamahata > > Date: Tue Jul 12 00:10:13 2022 -0700 > > > > KVM: x86/mmu: Add address conversion functions for TDX shared bit of GPA > > > > TDX repurposes one GPA bit (51 bit or 47 bit based on configuration) to > > indicate the GPA is private(if cleared) or shared (if set) with VMM. If > > GPA.shared is set, GPA is converted existing conventional EPT pointed by > > EPTP. If GPA.shared bit is cleared, GPA is converted by TDX module. > > VMM has to issue SEAMCALLs to operate. > > Sorry what does "GPA is converted ..." mean? Oops. typo. I meant GPA is covered by ... -- Isaku Yamahata