From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web12.15686.1655040810510766216 for ; Sun, 12 Jun 2022 06:33:34 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=jyfB6cPZ; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: jiewen.yao@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655040813; x=1686576813; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=IZFA6yIbttiLhGxTgk4dDmcNH3Oy5PVo8pz4k7q8BVU=; b=jyfB6cPZOmcagPuczbATNXEhMRyFAAdMyotCjsmVtAwdDUBxIuwOy+J8 brAQ/Gpu5LdzQakBqyMhwx4fz4UeXfdCDKrUpnZmOlI2dQDf8atBrNo2x /GntJFxjZWlau7K6GlgpZuihfGDtShyBpk65LMgitQ5mZRwNFTPSnFBFc Y+ZN6zezLZDmMu5Uyvg5JYWOR1QNjV4Y8rdWBX3iGyi4mtpujB06vYwJ9 18x7cW8S55knqCRteSpUJPeBlVuP4W8qaVJ/RSVamVihY9NID12Ka9mDn 154ia/bElaYIpa4MLfo33jZiMpNDH1vXzQEcSeOHr51UP0QQ2cGtKfXaa Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10376"; a="364374930" X-IronPort-AV: E=Sophos;i="5.91,294,1647327600"; d="scan'208";a="364374930" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2022 06:33:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,294,1647327600"; d="scan'208";a="711601524" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga004.jf.intel.com with ESMTP; 12 Jun 2022 06:33:33 -0700 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sun, 12 Jun 2022 06:33:32 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Sun, 12 Jun 2022 06:33:32 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.171) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Sun, 12 Jun 2022 06:33:32 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gnS4BHXmoeLvFaKLW6qdiGaGvz3R0qPJVuZv/q7HfSmujd9BwS80OOvd2NE+EnyR4kOQY58RXhR3S+YR2cTJ+C1b53EjoShBzl6dVHTMG+bErN0fTUsZ+oEqSkP/Rh7kiyBdb8/3ODOAdlvHtY8sdbw1Ob6oQrk/fCpWO04slxWBJPtYw8QcXBtXDQkONPmeAdG31pLvMVrNMTFrBW92Y7+fHF7GdFCRJK1p1Kzq152JYbFvm93u3PrMrF76PNd5JE56cbfbtlE3nvDrZE6rKynkVMW9QoBnxxEGCe5Mrwbs4ESItm1mHifJ3hG95HsXuh7qyQLVaM60Vl/Im638RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Klu/exc1LQbH5ke9Pg2jrVIoH/h1W3QoJ/8YO4cPRLs=; b=RaUTXL8AXRcroUBotnqjv6kUJ+h6cBKivA/Ti4TIGVBZ+Kb5qn98djBEFZMDReWF3CsBEW7k6OyZe4MMcRiqr7uJwGAEonR1KC7PD+4VBU6qhPkbjRwClgtQCAHSVSOY33c6qmO1EQf1Ni2Wk9Ih5ONHEWPO++kV4xV8GYWogfrvmI7G/Yan8nFCJQtHUi23ZxmyiVdhq9fNnHtCeufLlZztwONvtSaKiWN0+SO4URd0ZaIRH0lvg5f1yCMns4AZTDFhP5dgzwbjvCQ4p7TvNueYfa9gguaro0V3klToEVCWYkV+tLQdtERoniddTPBmMsa4Nm//UjxcGdsbXf51Mw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from MW4PR11MB5872.namprd11.prod.outlook.com (2603:10b6:303:169::14) by MN0PR11MB6159.namprd11.prod.outlook.com (2603:10b6:208:3c9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.16; Sun, 12 Jun 2022 13:33:30 +0000 Received: from MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::24ae:1cd3:3192:4c7e]) by MW4PR11MB5872.namprd11.prod.outlook.com ([fe80::24ae:1cd3:3192:4c7e%7]) with mapi id 15.20.5332.013; Sun, 12 Jun 2022 13:33:30 +0000 From: "Yao, Jiewen" To: "Xu, Min M" , "devel@edk2.groups.io" CC: Gerd Hoffmann , "Wang, Jian J" Subject: Re: [PATCH 2/2] SecurityPkg/HashLibTdx: Return EFI_UNSUPPORTED if it is not Tdx guest Thread-Topic: [PATCH 2/2] SecurityPkg/HashLibTdx: Return EFI_UNSUPPORTED if it is not Tdx guest Thread-Index: AQHYfk8MThKL7lQQL0KNHisL1OjlCK1LxV7w Date: Sun, 12 Jun 2022 13:33:30 +0000 Message-ID: References: <20220612112434.1829-1-min.m.xu@intel.com> <20220612112434.1829-2-min.m.xu@intel.com> In-Reply-To: <20220612112434.1829-2-min.m.xu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.500.17 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: d882e3a6-d265-4308-cf61-08da4c78238c x-ms-traffictypediagnostic: MN0PR11MB6159:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Xu7zCVl+gv6qrGh5cjUxI3OkW3dqDcxU2evVO0qbXzv/zdEuRobETcuw800P6VU3bXEL0WXww2EWENmlCcs/kuDgodNNCnPtVvMJDlfiapSBjGYOuuULSrVcjvRweAbUkEVWvFYhiUf+Zzn7wQX7FsnKvs45vqqIE4bl8DUgRwkivb9tnoJDPk0cwmqo4m8EZsWoZNH4dE4OEgt5WyfvocVKuZ+U+LzKPCykSPT3tngA0McWUDVL2ZN/vcm/kiQjRGx06eIqk5v1fEv3yYd9gNp3bqQBjjvuFy56YDTXxXIqFc1SEt5KxsQdUu9Ou2Pz+AOYnH47s/xGwKTsFcaNT+3WhqP7ER2OgsvRWu2yVPWa/ZHbyK8RiELUXZ97R2tWtPmftFUehFRIT4rFb2uFGQbnTAhsoX4icW5AuNaZZEJsWTp4qHXNPHvfEaxBpLyZTUfVznJOId2hFzGjbzKg2oJ/YCumxi3dhwziES3GmZn0wPln/jqhoi0SiF0A0gDR1t5JCjdiiTLeA+SDa1O2UM1pFPGmjRSmrUkaItZ1fM9nLY602bV+VnCw7Ybjr3m2h7gIEmOIuy1CGal33ymQ1mpSQRLsqCcBlHBSxQndfNHHcdBXzwOIAjktR5cxPbI7R1twF046hHeQcmopnOGEa6uTG1Inl577Cq8ZFB9J9PT2+0bSOZFF9kdwsIvgKJGJVyYCSafRVb50cuSbgTj53w== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR11MB5872.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(366004)(9686003)(26005)(38100700002)(107886003)(7696005)(53546011)(6506007)(33656002)(2906002)(55016003)(15650500001)(5660300002)(52536014)(8936002)(76116006)(122000001)(4326008)(86362001)(66476007)(66556008)(64756008)(66446008)(8676002)(66946007)(38070700005)(83380400001)(82960400001)(186003)(110136005)(316002)(54906003)(71200400001)(508600001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?qVycGaHNM49AE5Q1jDLeRJ3IpURQbHPJAnENUpMJPD2G2m0XoxFmYsSsaIGg?= =?us-ascii?Q?KkzdfHmm6VtuyG0xZ2L7ZLEdLiGeNJHgvQ8CGe2m6n0yLAJnR9tsBvKm7lEJ?= =?us-ascii?Q?81ze9zoyDOFGgff3LkP1EPgl+w0YO05e40kq5yNRlIsykWg8zA1cze6J7t/E?= =?us-ascii?Q?6TZO3WZnI7srxauPWZc3OffRO8Z1d/l/F39x3xALk77Z7lNZbFYzFzZPbOBs?= =?us-ascii?Q?ZOVOubpyqHVyIP2jNlK1Kdf5tWd6jDwQTjrEGJ8NYOsKmsnu/oLFc1oYCn1H?= =?us-ascii?Q?9hFRfW/2qHIYhWJPibrmLlnBGLqZ67hqlMC56hBJnZ/iXtwompqsEv/R5lEZ?= =?us-ascii?Q?10VlxjvckSeLsq2amg3aNEoOzCptzAfqv8kb3o7VJqcPOEwupGERJYTAlo5v?= =?us-ascii?Q?c5nMjEi2IdqvwFChtKHY2HQ828zSWGkAVoq6DFoKF1/D+wTa+EhHQRZAexQN?= =?us-ascii?Q?vg/CHYXCXR3WFK0gxpTyz3g6wltJ2pmPolOx6XkjmDoE7T3aOH6fViS2LHW+?= =?us-asc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eaBTYUmHgmpYgcxYaw+MmyafIM+U3s?= =?us-ascii?Q?srV3MOQwsOZRk8UZgCIg9YX0VCKLW2Ivd166/7rajiaVC7T2INJ9oYTqJQ4y?= =?us-ascii?Q?zUCHNk31cjAsp8AEwlTagEdhar9dDWZfGTo88hScfyS6Ix+F35SpodlC5puA?= =?us-ascii?Q?uxJwX9GheZnvrcAexxLqlWrssusYzPiwQJ1vBalibXcgPINJYgTSvGXIlOJa?= =?us-ascii?Q?uWrvBz5ZMen+roEW514faHleBNwWaGNk3/erktpok4lhi2FGdEy9CFGvCxYH?= =?us-ascii?Q?Ao56FZwvJ7EipZEKkugQG5/tAvX7YpCx7b1n2r7pU6BvXQrErC3O2H0kKQKa?= =?us-ascii?Q?rjTDJ2XrCg=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5872.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d882e3a6-d265-4308-cf61-08da4c78238c X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Jun 2022 13:33:30.1938 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: TkLn74k9D6ctQs5pvKm/478AJiRnLCTe9Hmvt+190xfHX/LLCFbEtbBZK6F05vBD0f32aIa1sCotTJfBfOoG1g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR11MB6159 Return-Path: jiewen.yao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiewen Yao > -----Original Message----- > From: Xu, Min M > Sent: Sunday, June 12, 2022 7:25 PM > To: devel@edk2.groups.io > Cc: Xu, Min M ; Gerd Hoffmann ; > Yao, Jiewen ; Wang, Jian J > Subject: [PATCH 2/2] SecurityPkg/HashLibTdx: Return EFI_UNSUPPORTED if it= is > not Tdx guest >=20 > From: Min M Xu >=20 > HashLibTdx is designed for the Tdx guest. So if is not a Tdx guest, > return EFI_UNSUPPORTED in RegisterHashInterfaceLib. >=20 > Cc: Gerd Hoffmann > Cc: Jiewen Yao > Cc: Jian J Wang > Signed-off-by: Min Xu > --- > SecurityPkg/Library/HashLibTdx/HashLibTdx.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) >=20 > diff --git a/SecurityPkg/Library/HashLibTdx/HashLibTdx.c > b/SecurityPkg/Library/HashLibTdx/HashLibTdx.c > index 75d96ee64b44..3cebbc70d3ec 100644 > --- a/SecurityPkg/Library/HashLibTdx/HashLibTdx.c > +++ b/SecurityPkg/Library/HashLibTdx/HashLibTdx.c > @@ -186,7 +186,13 @@ RegisterHashInterfaceLib ( > IN HASH_INTERFACE *HashInterface > ) > { > - ASSERT (TdIsEnabled ()); > + // > + // HashLibTdx is designed for Tdx guest. So if it is not Tdx guest, > + // return EFI_UNSUPPORTED. > + // > + if (!TdIsEnabled ()) { > + return EFI_UNSUPPORTED; > + } >=20 > // > // Only SHA384 is allowed. > -- > 2.29.2.windows.2