From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web11.3609.1632201368474243429 for ; Mon, 20 Sep 2021 22:16:08 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GtvVuu9a; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632201367; 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=07yAVD+wX4r9N/brUAIvavrdyePqU4IL3zKkBqvg2Rs=; b=GtvVuu9aN4kvtV3TSR74I6idcvIbgNVwOP4hiX35xOOwzEp1GkOPDhpVoXQwhKI/RnR3Ya Onz21tBJHjtBIM8jIf1HxlZVdmYcac8iHuYGtte57rpZvSrKeVb47LgGGoZK62xuPskqWW 281/K+Up0WPBRNhcuCtxEqXqQ89PHpI= 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-236-6PFHY7tRMNSc3_cQMuM7ig-1; Tue, 21 Sep 2021 01:16:04 -0400 X-MC-Unique: 6PFHY7tRMNSc3_cQMuM7ig-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 A2A52180830C; Tue, 21 Sep 2021 05:16:02 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E968560C17; Tue, 21 Sep 2021 05:16:01 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7630B18000B5; Tue, 21 Sep 2021 07:16:00 +0200 (CEST) Date: Tue, 21 Sep 2021 07:16:00 +0200 From: "Gerd Hoffmann" To: "Xu, Min M" Cc: "devel@edk2.groups.io" , Ard Biesheuvel , "Justen, Jordan L" , Brijesh Singh , Erdem Aktas , James Bottomley , "Yao, Jiewen" , Tom Lendacky Subject: Re: [PATCH V6 1/1] OvmfPkg: Enable TDX in ResetVector Message-ID: <20210921051600.q73rd2bq2zj2juc3@sirius.home.kraxel.org> References: <20210916075456.ymddpwrguipziq2f@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 > + gUefiCpuPkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr|0|UINT64|0 > + x60000017 > +typedef enum { > + /* The guest is running with memory encryption disabled. */ > + CCAttrNotEncrypted = 0, > + > + /* The guest is running with AMD SEV memory encryption enabled. */ > + CCAttrAmdSev = 0x100, > + CCAttrAmdSevEs = 0x101, > + CCAttrAmdSevSnp = 0x102, > + > + /* The guest is running with Intel TDX memory encryption enabled. */ > + CCAttrIntelTdx = 0x200, > +} CONFIDENTIAL_COMPUTING_GUEST_ATTR; > ConfidentialComputingGuestAttr is a 64-bit PCD, the byte[1] indicates the Guest type, byte[0] seems the sub type of the guest. > > And in the current definition of CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER: > typedef struct _CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER { > UINT8 GuestType; > UINT8 Reserved1[3]; > } CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER; > Byte[0] is the Guest type. > > I am not sure what you mean: > > we should use the same approach (and the same enum) we are planing to use > > for the ConfidentialComputing PCD (see discussion in the other patch series). > > Shall we update CONFIDENTIAL_COMPUTING_WORK_AREA_HEADER so that byte[0] is sub type, and byte[1] indicates the Guest type? The idea is to make GuestType larger (UINT16 is probably enough), then use the CONFIDENTIAL_COMPUTING_GUEST_ATTR enum for GuestType too, so we don't have two different confidential computing guest type enumeration systems in edk2. So, yes, effectively that would make byte[1] the type (sev/tdx/none) and byte[0] the sub-type thanks to little endian byte ordering. take care, Gerd