From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 0A56DAC0C10 for ; Sat, 20 Jan 2024 04:40:00 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=LQrIf4YnR47Y55I/87J1DPBieJq6C/EqUmLsZtOVf6I=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1705725599; v=1; b=TjQ1pVUxefAhkcJCQDa2m/HPKFYgew4b/04QJDfxV48OeUDY1TAzAZV5NZNk2koloCsBzX6a blKM+ZzlTx8F4oJs91PNBDBtEG5fkbaiZFURD/sVxSkQMfy1B6oGZBkT7ym8qOofic4VdwjWonu uyuQmuM0X2PxttzAm7oAZDYA= X-Received: by 127.0.0.2 with SMTP id 7F2sYY7687511xPfp9rB2Z8T; Fri, 19 Jan 2024 20:39:59 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.15334.1705725598311861314 for ; Fri, 19 Jan 2024 20:39:59 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10957"; a="487056608" X-IronPort-AV: E=Sophos;i="6.05,206,1701158400"; d="scan'208";a="487056608" X-Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2024 20:39:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10957"; a="734710600" X-IronPort-AV: E=Sophos;i="6.05,206,1701158400"; d="scan'208";a="734710600" X-Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga003.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 19 Jan 2024 20:39:56 -0800 X-Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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.2507.35; Fri, 19 Jan 2024 20:39:56 -0800 X-Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Fri, 19 Jan 2024 20:39:55 -0800 X-Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35 via Frontend Transport; Fri, 19 Jan 2024 20:39:55 -0800 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.100) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Fri, 19 Jan 2024 20:39:55 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mPS+XJw1EzBbENV9KBvE/J354GJ3+dWgjPU7dlUY3vKGs90jYT7E60h0C57Y8TG0Y3FfByntXYF9iBSgTgB+ZiPiDkoEHlUHLA2fKqosYf24bqhaqpzenvyLUjuEV2wBYbzmUs5p0JnpQ2O4kUzmfBKBYRaQVIiA+Klz4usxheIee5iMLlas0Y9StsplYC5V51KzpiGkX3MUQ+B+HSlGk+BIoWrTU2EdSdOIlr4NSFgI/um54b2ZjS2xriZjoMf7Z7EPnH7TA0vnSDPwLUTO2ySOQ67vsdw1UoYNDEUvdDhsSXgk064zqDlUi0NIsIguJIK+jWCn2gkl+nM0L6OjLA== 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=ZlmXDOaG9xdT8TAxcZJkqwqF3FgyODNlu3ZYG0GZEMU=; b=cTas7ATF6J7Ko2lxy3fLTkvvBsmtB37HgUa0cECBYFqoh+TRVSpfKt+sXbrtSfssir7/vfAGWiZXlyNme6QCLY5gK2qXjGw3692885pFfQcu9t6QHbsa2YNynL8tiSC/pv3mnB+804zIZdQgYY+fyed95VhS87VT3BIIJynAZvkvU/AAC1aP0XeBS2JoUOAK14B8z6bh8ugL7T0KxgJQrbdhkdSMsR3vJSgUFv+5Jvt8WZT96EecmWQTPGaaFxDXn9TLom5XGZ9xZRWuNSqK4m6mMqy7GXT9F85+cIbaMJH0d41/nuSeeaHtaNXVv03aNz2Xhf9Qw16i7tm8wP/M0g== 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 X-Received: from CO1PR11MB4929.namprd11.prod.outlook.com (2603:10b6:303:6d::19) by DM8PR11MB5621.namprd11.prod.outlook.com (2603:10b6:8:38::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.26; Sat, 20 Jan 2024 04:39:53 +0000 X-Received: from CO1PR11MB4929.namprd11.prod.outlook.com ([fe80::4382:5b03:f13:88ff]) by CO1PR11MB4929.namprd11.prod.outlook.com ([fe80::4382:5b03:f13:88ff%4]) with mapi id 15.20.7202.026; Sat, 20 Jan 2024 04:39:53 +0000 From: "Michael D Kinney" To: "devel@edk2.groups.io" , "Li, Zhiquan1" CC: "Kinney, Michael D" Subject: Re: [edk2-devel] [PATCH] MdePkg: fix the types of casting for TD MMIO read Thread-Topic: [edk2-devel] [PATCH] MdePkg: fix the types of casting for TD MMIO read Thread-Index: AQHaRYwMB7HezaHn006ExvK/vKsoE7DiCxyAgAAMTLA= Date: Sat, 20 Jan 2024 04:39:53 +0000 Message-ID: References: <20240112060220.824280-1-zhiquan1.li@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CO1PR11MB4929:EE_|DM8PR11MB5621:EE_ x-ms-office365-filtering-correlation-id: 3e9c6f70-7347-430b-b443-08dc1971d898 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: 2Q7kGM9TOsxUc/vRit9gZAXYuhmwc05vp9T/KmfAjpYCI6wboh1WdR8GF8GB51qB0vmFZpiSzFdY+9R9vDb/75hrPqt0e0MKK21865BMBjiUoAbxHIkqBZ2BjdSvGyQI17VtECJVFPiGY8AmJLa5SnplITqnuQ1nYfEnw+9v3p4iLGmhTB8zLTLGaT4Lfo8pOBz+YQ258tneXeWJedjnqt4zVs4hJEgwjyszlWHcM87P9Rn8NqM45ipfGqFzXke/ET7KBblq3M2fCLuXDkJ5preWs/LYacbdhyhmqvs12P13BBy6wq+IsouTUIDxeI4Fd6wij+33vqnQfPgnKUGGWe4RrWCwBuFE9YrA2jHqvQn5L0IGrivubYweHTCZLeUfokIZZiOmxt4p2fFk+Way5cRO5ip4+G+p+HMAv2pAjphfWFDFPQiwZuOTQDKZJ39oMbt+RhfVnBYzmBAZTlwBA4LZBEaLfUTYbjwbSMhQliXoN9FDDxtOBz2mSWLqx4ZHqRqs2IttkgmhnhhP3O2Y5K/r+7dbkcnODSeewKM0uEnN2eYKtOlETFgrzDIGqhjaZv/x5rZxZYoakJTd30M7whOfUfFILVPmITGmRc0s6kD4o9UFl3dj5fplCYpduMB24rpXRiJ6gHg9uvPhaXkS8g== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Gu0PkYUUmmLk8MNJ4quFIayFyjxYA9/9gBfFLca9eRrEEuuYO/48WOvnUCOl?= =?us-ascii?Q?XUmeL1GnVBcL2Y0RJIDefOrNSRQdM00W5j0NknnLXsKZXBMNhWhD/jopDjUO?= =?us-ascii?Q?/jly9gCriB3GqracOia5erTxQd8M3C2KLjFcLeYvLLAxZZxo9cdnhooR3Tlz?= =?us-ascii?Q?FDY/6cYSJNY7JGjmtzDkW8CDhyicuk2O2OXtKf9Zd0E41+hZx/cQQvXHYhkM?= =?us-ascii?Q?edyFwJVs9Ec3Q93RSfvwta4vR8rwWcwUORJ/5mDyw8ZUs73/gCRx5Oj8bPv2?= =?us-ascii?Q?ExY3IaXPKqxHrUHNBQ4hNBi3wgkiTmnB5HUmNMYhsmsQzosjNF5apfSj0hnW?= =?us-ascii?Q?5Da5y1aHuMV6wsMhVVmqFa06KMITOQVvygaEXX3MGc8yEdq2F5iYym4rYXNE?= =?us-ascii?Q?CCD6eMIxrw9ajY/8vIp2P8U3Nsr3XWWZZdp/NoBBB4PRf6dXxnGVX+tl8sVF?= =?us-ascii?Q?S73ihIrpCG37inpyeR6GiAErkgq8SlFwmGfPYUmk9AnXjxsRohOwrtzCbJeY?= =?us-ascii?Q?8lU2/CNTpZ5kmfmjXJGMbZ+hmVJnIQMc2NoxfC6ZvC14WShsVsA+Dqz5SECt?= =?us-ascii?Q?yN7OkvbvjB9K4ZzwS4RK9X1LHYhVpLzKKBR0NAF6h4o9NyGcBC8Fwy25gNMo?= =?us-ascii?Q?V5wETpqmFIGVIMeG39qQxNJeAlqRGqIAOWQH2ErNBEOqt/NCdX43TNfbuB06?= =?us-ascii?Q?mHZnC7qJDnZ8jySz0xq4GXu5Ggaq08I+ni813S91vctN8NnoN9gi7mK1s+0o?= =?us-ascii?Q?yyrIq+bI5LzUALVxJcCzjX7nYkrlLm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Tenant-AuthSource: CO1PR11MB4929.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e9c6f70-7347-430b-b443-08dc1971d898 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jan 2024 04:39:53.5161 (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: Vg2aRFh0dmsw7GqUIDcUjnIMxRh3YC9e3PbsFy1od8uU99VBQxx/c7uiErKOkAqStrwOKJMm5RMmCkx47945sZjCpCcl811dHOGNAbYezXI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR11MB5621 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,michael.d.kinney@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: PvtopqNKcAhQsw5SMyLVBISdx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=TjQ1pVUx; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Merged: https://github.com/tianocore/edk2/pull/5278 > -----Original Message----- > From: Kinney, Michael D > Sent: Friday, January 19, 2024 6:49 PM > To: devel@edk2.groups.io; Li, Zhiquan1 > Cc: Kinney, Michael D > Subject: RE: [edk2-devel] [PATCH] MdePkg: fix the types of casting for > TD MMIO read >=20 > Reviewed-by: Michael D Kinney >=20 > Please include Cc tags in commit message with the maintainers of > the patch for review. Otherwise, the maintainers may miss the > email patches. >=20 > Thanks, >=20 > Mike >=20 >=20 >=20 > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of Zhiquan > > Li > > Sent: Thursday, January 11, 2024 10:02 PM > > To: devel@edk2.groups.io > > Cc: Li, Zhiquan1 > > Subject: [edk2-devel] [PATCH] MdePkg: fix the types of casting for TD > > MMIO read > > > > Currently the types of casting mismatch with TD MMIO read 1, 2 and 4 > > bytes, that might introduce potential issues. So fix the types as > > conventional MmioRead[8|16|32] does. > > > > Signed-off-by: Zhiquan Li > > --- > > MdePkg/Library/BaseIoLibIntrinsic/IoLibInternalTdx.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/MdePkg/Library/BaseIoLibIntrinsic/IoLibInternalTdx.c > > b/MdePkg/Library/BaseIoLibIntrinsic/IoLibInternalTdx.c > > index ec837f5eb03e..1acc3b3d9638 100644 > > --- a/MdePkg/Library/BaseIoLibIntrinsic/IoLibInternalTdx.c > > +++ b/MdePkg/Library/BaseIoLibIntrinsic/IoLibInternalTdx.c > > @@ -237,7 +237,7 @@ TdMmioRead8 ( > > > > > > Status =3D TdVmCall (TDVMCALL_MMIO, TDVMCALL_ACCESS_SIZE_1, > > TDVMCALL_ACCESS_READ, Address | TdSharedPageMask (), 0, &Value); > > > > if (Status !=3D 0) { > > > > - Value =3D *(volatile UINT64 *)Address; > > > > + Value =3D *(volatile UINT8 *)Address; > > > > } > > > > > > > > return (UINT8)Value; > > > > @@ -294,7 +294,7 @@ TdMmioRead16 ( > > > > > > Status =3D TdVmCall (TDVMCALL_MMIO, TDVMCALL_ACCESS_SIZE_2, > > TDVMCALL_ACCESS_READ, Address | TdSharedPageMask (), 0, &Value); > > > > if (Status !=3D 0) { > > > > - Value =3D *(volatile UINT64 *)Address; > > > > + Value =3D *(volatile UINT16 *)Address; > > > > } > > > > > > > > return (UINT16)Value; > > > > @@ -353,7 +353,7 @@ TdMmioRead32 ( > > > > > > Status =3D TdVmCall (TDVMCALL_MMIO, TDVMCALL_ACCESS_SIZE_4, > > TDVMCALL_ACCESS_READ, Address | TdSharedPageMask (), 0, &Value); > > > > if (Status !=3D 0) { > > > > - Value =3D *(volatile UINT64 *)Address; > > > > + Value =3D *(volatile UINT32 *)Address; > > > > } > > > > > > > > return (UINT32)Value; > > > > -- > > 2.25.1 > > > > > > > > -=3D-=3D-=3D-=3D-=3D-=3D > > Groups.io Links: You receive all messages sent to this group. > > View/Reply Online (#113765): > > https://edk2.groups.io/g/devel/message/113765 > > Mute This Topic: https://groups.io/mt/103689726/1643496 > > Group Owner: devel+owner@edk2.groups.io > > Unsubscribe: https://edk2.groups.io/g/devel/unsub > > [michael.d.kinney@intel.com] > > -=3D-=3D-=3D-=3D-=3D-=3D > > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#114112): https://edk2.groups.io/g/devel/message/114112 Mute This Topic: https://groups.io/mt/103689726/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-