From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.groups.io with SMTP id smtpd.web10.81308.1629441684911315091 for ; Thu, 19 Aug 2021 23:41:25 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=N7pAYbgX; spf=pass (domain: redhat.com, ip: 216.205.24.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629441684; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/gkoiVYIMkRMVPJm3uxbmc6qWLgemCQiGww1/4b4Vcw=; b=N7pAYbgXniFJJsBuzLKT35naF3D2O+lp9LCdQ/YxDz90+1a3ROf+25u+c5kbcwudoF4xIA AGHFJFyDAZNhjUGDtACZjzrUxth6yhjBvIbBj60MqVve0FJ0tUePxBYRLDeBEkVKyb8Hgf t/Sld8Hs9Ui8mvwH9pNEKe6VDc9CKqY= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-603-DYyvE9gDOYufnH7ijhpX1g-1; Fri, 20 Aug 2021 02:41:20 -0400 X-MC-Unique: DYyvE9gDOYufnH7ijhpX1g-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A2F10101C8A6; Fri, 20 Aug 2021 06:41:18 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.193.216]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BCB0D60C13; Fri, 20 Aug 2021 06:41:17 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6749818000A9; Fri, 20 Aug 2021 08:41:15 +0200 (CEST) Date: Fri, 20 Aug 2021 08:41:15 +0200 From: "Gerd Hoffmann" To: "Xu, Min M" Cc: "devel@edk2.groups.io" , "Kinney, Michael D" , Liming Gao , "Liu, Zhiguang" , Brijesh Singh , Erdem Aktas , James Bottomley , "Yao, Jiewen" , Tom Lendacky Subject: Re: [edk2-devel] [PATCH 07/23] MdePkg: Update BaseIoLibIntrinsicSev to support Tdx Message-ID: <20210820064115.4i27ufma2nymtskv@sirius.home.kraxel.org> References: <8f56e6f50477bf00d5121e6515388fe68525b1e2.1628767741.git.min.m.xu@intel.com> <20210817083822.vx2ts6twmm2fspqc@sirius.home.kraxel.org> <20210819063059.rabr2aoajtffftqq@sirius.home.kraxel.org> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kraxel@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, > > One more question: How does this align with the WorkArea changes posted > > yesterday? The WorkArea gets a mode field for SEV / TDX / normal, so I think > > you should be able to use that instead of invoking cpuid each time you need > > to know whenever tdx is active or not. > We don't want to make the TdxProbeLib depend on the WorkArea. Why? > CPUID(0x21) makes TdxProbeLib less dependency. For Intel TDX the > WorkArea is designed to be used in ResetVector phase. I don't see why the dependency is a problem. TDX-enabled builds need both TdxProbeLib / TdxLib and WorkArea anyway. Each cpuid instruction is a vmexit, and the code invokes cpuid twice for each io / mmio access. take care, Gerd