From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web12.1085.1663043783567107656 for ; Mon, 12 Sep 2022 21:36:23 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=exGQyuZL; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: hao.a.wu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663043783; x=1694579783; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Zn2NcUpvtUGS0CMV8J76gkL2ixRXvWm1ZJiBH99qhuc=; b=exGQyuZLwq43hX1KPqzdpOxtDlkRYzSHHyciauhf93h0uoT5H55D1/dP FF/csNy5YHBVQWrYNkVx38oiWH0CyCBTycQABoDCv4r4Vtq45l/POcYKQ PkxnXaWrHRHlMeFryMwtDE7uMdWjCT4pbOKRQN3NMbqfC451WklsrVh2w S49aQWwbTaFxiu1Rju1MrOwD2mJ68QCQbD7P29y8XfSQgwA5eIpfYSUhU g/7qgq5c6PJo7U3+s8oP5tqcuCc+o1YpVMrJC92E+xKrBqjK2g7IW/dmx 7o7DWKEEcUJ5PdBSUi/OrvzWpEOpIekyu5uudlaqKeixzPRldEEn9t6t1 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10468"; a="324276820" X-IronPort-AV: E=Sophos;i="5.93,311,1654585200"; d="scan'208";a="324276820" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Sep 2022 21:36:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,311,1654585200"; d="scan'208";a="593773064" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga006.jf.intel.com with ESMTP; 12 Sep 2022 21:36:22 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 12 Sep 2022 21:36:22 -0700 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 12 Sep 2022 21:36:22 -0700 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Mon, 12 Sep 2022 21:36:22 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.107) 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.2375.31; Mon, 12 Sep 2022 21:36:22 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jl6ynr4Ln/4ocfs1nomECHmEeGpbbFm4Y5qx0IQI4duL5rfTcJPREI4o88K9w6wRPMzEZNDa3ksPT9D6hjNWBQl2wObulBJeLFPy+c7uAaFp4hpfauSm8zGFvXnTuLsvzpsAhfFnULBu24rZjuc4/yskbL48dJYcb4cSZKpwsNhLiGUvJ2nYhX/wQFcdURFo4wbS8zAgq1d5M8A/so0GZVisNhdCbq3BA1+sNw8VLL5Pxl1EkMMmKCc+ItjlZLZJGcoKK0Puc4tVJILBzz6ODk6UNJDZI217dDmvxZ0biSnSZTCavkyT9+telFHE+gNiBZJpLEahU+YyPWGr7IxC0Q== 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=NzMh8Y/ctEQwD7mDddlmtmqrRO8F+thhu5SXD5PpC0o=; b=d/gezx3u9dvTow/5p6YiYZZGH9h9KxSi2A2xaaa1bAhN2nXVgPFHslqqam2DbpHEouDeGoXIVqnrot/EWpz76ob2AblBQHii9Ote8iT/gFxXB1mFUXGeR/r3J/gVvjoLdhMvMu6KuUuKeuMGs1997CsPUZwX6TIHGB59WG4PVUvukWZ3e+TpVQXbuMgyJEzL9d5oVvOM1TqhYN3wT+8rtqaJeJiwfzL2g7yKLlMMWs4UFfNriKFn3aw9FdYCg15FWlDkZN/J8vkfY6bguh3TdIKVBVNBotjTv9urUvqN5bbdAXY+Sz0nVf/WcoC95zptDt4yCDbcKTfzA1pGNB+fcg== 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 DM6PR11MB4025.namprd11.prod.outlook.com (2603:10b6:5:197::31) by BL1PR11MB5463.namprd11.prod.outlook.com (2603:10b6:208:315::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.16; Tue, 13 Sep 2022 04:36:20 +0000 Received: from DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::6144:b5e3:5217:f60e]) by DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::6144:b5e3:5217:f60e%5]) with mapi id 15.20.5612.022; Tue, 13 Sep 2022 04:36:20 +0000 From: "Wu, Hao A" To: "Czajkowski, Maciej" , "devel@edk2.groups.io" CC: "Ni, Ray" Subject: Re: [PATCH v1] MdeModulePkg/AhciPei: Fix MMIO base assignment Thread-Topic: [PATCH v1] MdeModulePkg/AhciPei: Fix MMIO base assignment Thread-Index: AQHYxHeH5Z7MhPEFx0CZx+t4X+3LW63cy8Qg Date: Tue, 13 Sep 2022 04:36:20 +0000 Message-ID: References: <20220909181055.1237-1-maciej.czajkowski@intel.com> In-Reply-To: <20220909181055.1237-1-maciej.czajkowski@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR11MB4025:EE_|BL1PR11MB5463:EE_ x-ms-office365-filtering-correlation-id: 757916c1-817f-4edc-458f-08da9541818d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 86PF5IHhiEem5Uw5hv6XfdGWBBJIBYRAKbz+L0LkBcB1XwUwjEd1ibjOnBGzOXYDRyuFs5nB/MlEEJXaktwZVvI++1CsAOgXjT7+p4FDS7sFrC7Lnqb8qyrUwxbfp/+6WuYXcX5ip9xqG94zvTmVspzqhzEYMSCAD0f9Ox2ngpz5hOs+plY3+9EOuCpZRtX3y1IqW0CMqVsgZThAEL5W82B6K0MkIJKsJH5s7RP+e4lz0wRKegSv54NU3vYzdc0d/v8XJhA9RGZlpNAHLLiQT+lNL4MEIB+DrDvEtscYWSPk5WvOuWIdbE+eCSzF2E+YoQduJxTqmlUdmCbCq5KX4Yt58KeoUK2XGfWHgZlAcCK14tIfnlYSeha46ceHZeKqFQpm6GWF3PJ9UpgTUB5KfIZ9beJ98VCLb3t3x5Tg6Uz9IFUVdgGZgWn2jazoEM7BRU7t+qNkhTzr4SaNqqQMCpDVuIwDoaCsITrH/NFgog4Z2tb7bsmSshVYjiaCttBhMLci6rsOb1VEJPMnlAJk/bR/vpF/5lFOA2xF4GCvRH/gSZp8aNAsMZVnbPnPK01G+h9IU+2i8HD+RPjjV/KfA/9WDqTEXttqUjuPJJPWOYp5coo+RUgb2duZPev80I2Qhbj3OM5IW1tVC+n3PcrEevVBCo0JfL+YmNER7jOTTpoMTZtm89dzwkkDIxke++kWnTRqMyDDc77l8hCvin4L6rZhRwCiLUj/A8rzGSV4z/+FnR11dgeI83V3Xfn0dm9SQF3o90QQJ4JAfyaBa8UAVr6Az7tMEEHyXM4FeZ6EN9g= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4025.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(136003)(376002)(39860400002)(366004)(396003)(346002)(451199015)(9686003)(26005)(316002)(5660300002)(966005)(110136005)(71200400001)(53546011)(41300700001)(7696005)(38100700002)(478600001)(122000001)(83380400001)(107886003)(66556008)(52536014)(8936002)(8676002)(186003)(38070700005)(82960400001)(6506007)(66946007)(64756008)(76116006)(55016003)(66476007)(86362001)(66446008)(2906002)(33656002)(4326008);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?uuUL/eqExaK0I2FiAJulLiLyAyf7xYTmekGTTpb+OewvTKAPD1M99q/C6T6y?= =?us-ascii?Q?1i3iK5t9BVjQ/7l0QX93VgRwHewGGMTQVlfImqp7XFQqt+QtnKrB4X4aZXHm?= =?us-ascii?Q?rALUElg5z6T/FI00vy+TdIuZffUUzEgzzZPguaygrAHgZieXW5aKc5O5jw/U?= =?us-ascii?Q?Mtz448vyxy2B+BaD3iOr/JBP8W04s66gNvPKQnpKEppJC4bOxwJpH+8h0YDV?= =?us-ascii?Q?GBR/l+5/DxNXGffdA5JDexopPWTMWnJGaXdfVgjUoqpINmc/0Xj8FqUQiimq?= =?us-ascii?Q?R5YSpVS8bUSS9RkcCsgA3F/o5uoKxV6wSnaZYHWnQelgECeDa5evuV4u62Es?= =?us-ascii?Q?rY9G8sKKQlFXkAsxwbB5ifa6/1BygA4kSlpVe/zyuKpcMWMfTmVb4XYHWIv4?= =?us-ascii?Q?i/xV6Cxw6nVqwViIIWdbZXXgsCLM0Oj5SKNa83l/vi48h98rwDoTRmeZP2Av?= =?us-ascii?Q?sjWQgC9yXOCNqmW99+TPALZzSABjgYkotoHXCWh8DVc7xb26QO3RQPYm5BIP?= =?us-ascii?Q?5UqACb+WTO8CJu8YUrgZjLhIfIPhP/dS2W5Cp73vrgX2EQaDXsV4ay122M0+?= =?us-ascii?Q?e8YWmFnYEhIr1QSaNw9h9sSdKCrzke2+9q50knp1mXct4fxNx7UaSFHNchC2?= =?us-ascii?Q?76csbWHPkssS/Go83okKAkm3gPHjDE3IuckcE5BPEMJm1EfB0HcG6TKpmuha?= =?us-ascii?Q?jmVVL0CUuasqqKh7BEzQwQR1wXr8CIczOMYvmzL1srgg41Sf8cw/nlzL6Aem?= =?us-ascii?Q?hoaUtXLZkowQz+FV6J06auX2t468Rx4gKkhg3qT+6oFscPziRFBix+pzNpwv?= =?us-ascii?Q?yHL2gC5SZfhnm97YQEGZqItN+WNvq26CvNbca3filb6z2Zbh6YdRZj/sFhrC?= =?us-ascii?Q?U69DnZD64Qs/5WcNf2QWKmfRVPOC/+dUNU4B4t49nKuuxOXuEXe6cVF3CS8C?= =?us-ascii?Q?DP5mz8cq8iX+xWsvutDdE3gectorcHxWdCzJxBeddncQeMRObHZltY8G7HJA?= =?us-ascii?Q?vzRROiRrqOvYAHLXqErRSBKN5IyTRWKM5qWzQAmvEmEF2yOTxEV7Qg73VpNF?= =?us-ascii?Q?azIOKMJ+zFZsBt+tlRrYw4rNj2LDF3lpnYxbvKkEeGlFZHThguGIuCZpqHH/?= =?us-ascii?Q?WqYipULoegL0XvSiSnmVqJeMpbABfN7X6Tc6DIq54eCvuPdiOtE1XQpanYq1?= =?us-ascii?Q?zFJH/jXzrU/9wTnVr361vxRSB4vEO5rUZUAc6D8Egc28F9bebtuvLn6PDyvH?= =?us-ascii?Q?Bg42cdVcow5tCaz6JMjaLTEzYGl++8JWRauBsBvFdfwLxBV/URlpmqq0mVMe?= =?us-ascii?Q?nwYgFUTED36mQvpQLHSKEAYrjWxAlOLyZQkTj4X9x2LsfioWyzoR82SCju2x?= =?us-ascii?Q?pVdAzTaPExpk9wpQkKIzxgEds6kQ3EYeN3d8elqFZ1jHoS0jl/ICTXj+ciXB?= =?us-ascii?Q?f0eRc9ngI6TxS7P+vgDs5KPiRyWkTZW397KKCmNpHVl2QHlHPFpSxW9AQYoo?= =?us-ascii?Q?snYIBuWA0kFm/RJynzgC/cOKIqgDhl1VZMHBYG68egIQUIZ9KyczF9AqxdJ1?= =?us-ascii?Q?ISvoLvMVHungsoALjbX5scmNos9uU8OOFTG6OU42?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4025.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 757916c1-817f-4edc-458f-08da9541818d X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Sep 2022 04:36:20.4653 (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: QL339EnFZmjNEB03N+WMhXzWipQYVz+H6yV5cNyvRJWdJPCYTaSU0vpJWctUOWg/gQblgtlA6A9vIWlJFKHTXA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5463 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Hao A Wu Best Regards, Hao Wu > -----Original Message----- > From: Czajkowski, Maciej > Sent: Saturday, September 10, 2022 2:11 AM > To: devel@edk2.groups.io > Cc: Wu, Hao A ; Ni, Ray > Subject: [PATCH v1] MdeModulePkg/AhciPei: Fix MMIO base assignment >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4041 >=20 > There is a mistake in getting MMIO base using PciDevicePpi that > can lead to the data corruption. >=20 > Cc: Hao A Wu > Cc: Ray Ni > Signed-off-by: Maciej Czajkowski > --- > MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c > b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c > index 98dd732a4023..47367f43f73a 100644 > --- a/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c > +++ b/MdeModulePkg/Bus/Ata/AhciPei/AhciPei.c > @@ -405,7 +405,7 @@ AtaAhciInitPrivateDataFromPciDevice ( > { >=20 > EFI_STATUS Status; >=20 > PCI_TYPE00 PciData; >=20 > - UINTN MmioBase; >=20 > + UINT32 MmioBase; >=20 > EFI_DEVICE_PATH_PROTOCOL *DevicePath; >=20 > UINTN DevicePathLength; >=20 > UINT64 EnabledPciAttributes; >=20 > @@ -454,12 +454,13 @@ AtaAhciInitPrivateDataFromPciDevice ( > &PciDevice->PciIo, >=20 > EfiPciIoWidthUint32, >=20 > 0x24, >=20 > - sizeof (UINTN), >=20 > + 1, >=20 > &MmioBase >=20 > ); >=20 > if (EFI_ERROR (Status)) { >=20 > return EFI_UNSUPPORTED; >=20 > } >=20 > + MmioBase &=3D 0xFFFFFFF0; >=20 >=20 >=20 > DevicePathLength =3D GetDevicePathSize (PciDevice->DevicePath); >=20 > DevicePath =3D PciDevice->DevicePath; >=20 > -- > 2.27.0.windows.1