Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp565699imw; Wed, 13 Jul 2022 04:04:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tRiOzVN/aI5sqp/KEGPG0bpCBet/H1uLVHmevePHcDWTj7f6dEibv2b3v3PZG5muepiGl7 X-Received: by 2002:a05:6402:35d1:b0:43a:cb5b:208b with SMTP id z17-20020a05640235d100b0043acb5b208bmr4048986edc.275.1657710254710; Wed, 13 Jul 2022 04:04:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657710254; cv=none; d=google.com; s=arc-20160816; b=FApA9UlDgP5oooXemhLpw/7cIeZ3iC3Txens3fQWXPw3nV6nr0NfIEpQHCbeIYhlae HzhGQgzaVkzUUdIvbhudma+Xdkhu00sfPtGlN6z/byjiZEoGi7ewrohiDTKTjJSSQbdz PaYWzXObY9i+zGl6JKjrI4hS//s1DOUn7lPVcxH4nIstYeiZCBDkYYlXD9w2OBdxLZHX Kb5/sYqEkfENupcvGlAYkaoN7tU3AOe4XbihpWUWH1qwNPvKychadgcF7aNP65ZEOt57 OIIYbULdU33DkNDSd4eZiR7qOmHIZ0GEgI5GYxrmbc5gIApTYIjPzX7GgiETmAd0KwYy lZkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=bcFCgWVIUW9amxOoI8+mULltAd1ICY+H1IdB2D9RXqw=; b=fuK+SjkTmCQoh8D+wUtAJL5BHIFIFoFGI2xNKD7tJSGi3F0SZx7eZWi9/xTtS7ZPRP JuEFjCLcvK05f1QpThZStDMxfWWnezzhbPH8qlkKu9iRoVw3y8QOn2E0Dpcq/4CjJu9P ezByWkI03ZJu9TtI1HU+SbqGjRX3epdWXh7YsmNFRTYf/BU4Y0iFGmUdCIRH+CaFsLho HqeP5URY/e6RemWz48fnT94nNdB5VE9A/R83tDMad1NrfHoVg35TY4GZ9Pk0+1UF5/U6 VJ1qUERLYIxdjicHBpQObzABToyv9mTasefNYInoNpP0A4Lzw4Xy06nhz9FS9GdCqekg oXww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aiw10JWV; 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=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sa21-20020a1709076d1500b0072b8cd4ca77si4846713ejc.274.2022.07.13.04.03.34; Wed, 13 Jul 2022 04:04:14 -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=@intel.com header.s=Intel header.b=aiw10JWV; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235899AbiGMKli (ORCPT + 99 others); Wed, 13 Jul 2022 06:41:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbiGMKlh (ORCPT ); Wed, 13 Jul 2022 06:41:37 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04061FD538; Wed, 13 Jul 2022 03:41:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657708897; x=1689244897; h=message-id:subject:from:to:cc:date:in-reply-to: references:content-transfer-encoding:mime-version; bh=PwD9TFImE+PjxaSsdW4DYoJEIRrFNbRZl2lEnpZjWJw=; b=aiw10JWVvQ+fEoWt4pFNIuQgW3JMgbCp/8Rnq197IkzDJKal2jWhu0Uh hSZfl/PuaEKwrFTy9O0aTKTpqxggoThKl1zCzqUPUB3PPKWRIfAg4mRSc pbCDEW5e757m/tl5hPCqJrRIdK0wJ+UUBc1Obabu62E8xwyyIS6K3T1E5 G74jrJAyhADCdxbeGB3D/uIGmjK2UIUIHsGgMzSeTofr+lsGwl+N//cle K8CLx7lTF2bjnZwodZVenaYAQtqZNmHpOplYpdoND8jbNOxxRb0z8ofKI H886PLmiOIPjCkyGf8WRKOHzKIHw22/Suwx4EAm2R3vZbYReezrzLubw8 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10406"; a="283930597" X-IronPort-AV: E=Sophos;i="5.92,267,1650956400"; d="scan'208";a="283930597" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2022 03:41:36 -0700 X-IronPort-AV: E=Sophos;i="5.92,267,1650956400"; d="scan'208";a="841712353" Received: from ifatima-mobl1.amr.corp.intel.com (HELO khuang2-desk.gar.corp.intel.com) ([10.212.1.196]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2022 03:41:35 -0700 Message-ID: Subject: Re: [PATCH v7 033/102] KVM: x86/mmu: Add address conversion functions for TDX shared bits From: Kai Huang To: Isaku Yamahata Cc: isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Paolo Bonzini , Rick Edgecombe Date: Wed, 13 Jul 2022 22:41:33 +1200 In-Reply-To: <20220713045225.GP1379820@ls.amr.corp.intel.com> References: <69f4b4942d5f17fad40a8d08556488b8e4b7954d.1656366338.git.isaku.yamahata@intel.com> <6cc36b662dffaf0aa2a2f389f073daa2d63a530b.camel@intel.com> <20220713045225.GP1379820@ls.amr.corp.intel.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.3 (3.44.3-1.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,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 > >=20 > > And by applying this patch, nothing will prevent you to turn on INTEL_T= DX_HOST > > and KVM_INTEL, which also turns on KVM_MMU_PRIVATE. > >=20 > > So 'kvm_arch::gfn_shared_mask' is guaranteed to be 0? If not, can lega= l > > (shared) GFN for normal VM be potentially treated as private? > >=20 > > If yes, perhaps explicitly call out in changelog so people don't need t= o worry > > about? >=20 > struct kvm that includes struct kvm_arch is guaranteed to be zero. >=20 > Here is the updated commit message. >=20 > Author: Isaku Yamahata > Date: Tue Jul 12 00:10:13 2022 -0700 >=20 > KVM: x86/mmu: Add address conversion functions for TDX shared bit of = GPA > =20 > 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? --=20 Thanks, -Kai