From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web10.22965.1649633240592405549 for ; Sun, 10 Apr 2022 16:27:21 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=Uj4g7euq; spf=pass (domain: intel.com, ip: 134.134.136.126, mailfrom: guo.dong@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1649633240; x=1681169240; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=hY9w35AUFXxBr5BL7lzTfXGSBkGroXYWbr4g+CXQU0M=; b=Uj4g7euqi/63kJxh0GjRfJfEgi+wosDUGPUa5WO8Rq3+CcF9+ivqSmH4 jJLRDirbK35pdyb4UqpT59S9xAvFnd7sk2lwqG6e6WM/qsQduhgNVgUZh qPNjALVHdX723qxh7kFskvzqiyLk/QwzHUQdSI3bYlq+EYxWsBAgyW8yY a54E92vFt9tcpwR2KHznFS/GT6L6opNFIXUr4u+CCrv82q/uhPlltgbop 6bAHalUsM0YX05TeOpW9TTTgcwvY8/NX6cMfB+w074JDdq4vEsFFWU5gZ XLe+L2erp2m+yXy2yVuL9PHrkwfWaUok8usW9SIxGJGqq0MfQ0XAQQ6tq Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10313"; a="243887101" X-IronPort-AV: E=Sophos;i="5.90,250,1643702400"; d="scan'208";a="243887101" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Apr 2022 16:27:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,250,1643702400"; d="scan'208";a="853681669" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by fmsmga005.fm.intel.com with ESMTP; 10 Apr 2022 16:27:19 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) 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; Sun, 10 Apr 2022 16:27:18 -0700 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Sun, 10 Apr 2022 16:27:18 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx609.amr.corp.intel.com (10.22.229.22) 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, 10 Apr 2022 16:27:18 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.170) 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, 10 Apr 2022 16:27:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A/VgLR0vD2j7a1umF2WJsrn9sqpEBHHQRALP/4NCKzxNKnSXs0/XvgH4C/HKtv00ZsgQ4QDdZFI9OgKsr5dNcL51VkGvN9u3eZIxT2O1wr0N/b5K+AAH9ZgGymeMw6jWA/O39exKTYnx94L6gIpTXy+OL8T2EdXsM6iUnueZDE9SgymCLGPRywBUeMC0GC+m3Qefm3x2mRyuwzMc6O/b+EaYZFzMtY47lXVdpr+7vMlc4bjj1Kau64+xcOTwez2hitPksfyDfJ4aDdrGwnGqCVZviVO2Nq8x9hEWfiNOVpb2SE3ZTmWOh/FCDZkyFVv2RRsiialrvD4BXaOGAhRgsw== 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=F7wKeohgUntmzeahO4FUTFgKIkUg+N0Thj9/kI6+VPU=; b=DnZ3pFxqJjWGXNrhBs70RGmqVb44+ETVsEA7kSm48gnrVMIr3TgK0dE+k89Wv8nsy0TAJkxZ+KlDxVq6P1JikHbIEBXjgVnF5bsDCNkjMEDyD17IOsARzZLKLjkEAaq4D6jGdQlaNTMLOAH482dFZZVsD3Yj6IB6BwV8B5hwf7GbVUX4708X5D6M7a39yUbvLhFA9k9It38bBeprM59V+AyZ/2y91gq27K9pZcEttOpnnBZ1lisy+ORXnnesTGAKkKRH8q+4THkRj70cWml2dmhsrWnrMshVRvkq9ojpaNMkbfzaMBQpcoZ5DYZtDU1xOWmVkJRhenwRcT8tuAFp6g== 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 BYAPR11MB3622.namprd11.prod.outlook.com (2603:10b6:a03:fe::30) by MN2PR11MB3712.namprd11.prod.outlook.com (2603:10b6:208:f6::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Sun, 10 Apr 2022 23:27:14 +0000 Received: from BYAPR11MB3622.namprd11.prod.outlook.com ([fe80::343e:797f:807a:5c9]) by BYAPR11MB3622.namprd11.prod.outlook.com ([fe80::343e:797f:807a:5c9%5]) with mapi id 15.20.5144.029; Sun, 10 Apr 2022 23:27:14 +0000 From: "Guo Dong" To: Akihiko Odaki CC: "devel@edk2.groups.io" , "Wang, Jian J" , "Gao, Liming" , "Bi, Dandan" , "Kinney, Michael D" , "Liu, Zhiguang" , "Ni, Ray" , "Ma, Maurice" , "You, Benjamin" Subject: Re: [PATCH] UefiPayloadPkg: Keep reserved MMIO at runtime Thread-Topic: [PATCH] UefiPayloadPkg: Keep reserved MMIO at runtime Thread-Index: AQHYS7kcsDCIPhUaxUCwkC1l/pKCFKzpzOIA Date: Sun, 10 Apr 2022 23:27:14 +0000 Message-ID: References: <20220409022521.3913-1-akihiko.odaki@gmail.com> In-Reply-To: <20220409022521.3913-1-akihiko.odaki@gmail.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.401.20 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: 72c4575b-9770-4414-5674-08da1b49a536 x-ms-traffictypediagnostic: MN2PR11MB3712:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr 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: eSF7Q2oxYi/sF7HONWqz7B7Mg1aoTq+fFxmN6GCKfFYlsEPNfwodkYnXNQR23BsKRlFyf5bKnvBYD26YAu4mE2NDX/Of97VLUc0d/T4+c0I1eiRObPCESHz8x3OWGKP5baKCbDkSl6h/s6M/W6DZprw5Hagg1Rzlcym+WoEvhYQp1Hs9wdCIMNtv6qaWJVghylA8y1UBFTm6LlPmLJXsWD+Kq/J/p+EGRPkKB4nPMar4FONHEKZz9+CFdCuRdbws7jItzhcziPvQMyszGuspqnW0NRhECGC/3O39S+PDz6MVXWdPbkDenvIRtpwaJQ8jFyAqKQdIsN5LH8CIKGnKYjf9StwAsTYEaOfJYHGi98tVrDoqct28QD+gJyq3FxCVSpM2FzXZXUcKGWZ8m41BYJdx1hLyCB+0rbE0wUa+F9Gy/Fw5caNWx8O465EfhCsuGKXh1qz4eMyLT6RR+1XCu2FcKcrNEw6wcSiKekRWKF6RS8sIpF/BsEOwaHR/S2CB4sxFFJLwBGEcuObFUROpDSG2AfmKgdJXLYuj9wIBYpPr7qSk45oxfFXayNfToBBiaVvt6Il3RBCT5lkTf7X/+aCrSTnyd9AB97a4jLS9UnZ5CbypnUut6gdYWKgYCc5OU06gpQGqbhx44suY7EvoE01v3H/X3lrrEzcWHO/6uaEjnIaD2o5c9bsBmT0lFRlIGWb5rJ8TnHyFbkdl5DdGMQ== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR11MB3622.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(71200400001)(55016003)(6916009)(54906003)(107886003)(508600001)(83380400001)(66446008)(76116006)(4326008)(66946007)(8676002)(64756008)(66556008)(186003)(33656002)(38100700002)(86362001)(8936002)(52536014)(9686003)(5660300002)(316002)(38070700005)(66476007)(6506007)(7696005)(122000001)(2906002)(82960400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 2 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?++Nkqzl0juIshvJT/3GqaArqoI3lEJdEnRWEPdvlhWU4kI2/M/L044jhU+Ck?= =?us-ascii?Q?3iTm8r0XffF1pJsLnT0oHttB1lk8qQWQzKyU5eApBt0eRsRuMLr+JqdBGwyS?= =?us-ascii?Q?dw6gVtV8DE7CIqAMki53FIGVqqLmI/TCmQE6bN54LO0h3bDi6+RjyokNzEHw?= =?us-ascii?Q?YJPzZinUDXOH4UgvIEgzmxlxh2WCmzMef5cSIwTkRXGEzbhZUgnaOzHQ+cSB?= =?us-ascii?Q?/G9uBR7CV5NQIbgIZaQoq4dMmWY9dgzMfUP62oqr0WrWNxBM7GtZS/C9P8bb?= =?us-ascii?Q?OBXNy3kCDTongtposKhcmnGMutjWJsBbEMrOqmW/62q1l+p9evy684EgCAGo?= =?us-ascii?Q?pMEG2+XEc+HLdqTS+b+IbjAG4fzs1S9wbG9zT8vPUXVNbuPuY0k2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goTDao4HPAQVoE3E81Y/cbB10pNnl4eMdQcPtEHVBy9gUO3tiw6w?= =?us-ascii?Q?Pwg80vCPml98ui+2f13Tsz99U0KDPyCgD7zXhWNoJucTtcaMcKrVY71LkW03?= =?us-ascii?Q?xtL+lDxhYzz1+ctfEaBCJlnKafsawn/HxmYBx7sFgtOIJBIqi2NLVmI4K4FB?= =?us-ascii?Q?0abouN34LM0iQiOIaHDiBgDfd6vTDB8tcTWH8qYIjnJrn7Enlxh+RI5fMDt0?= =?us-ascii?Q?TVkIT5Pa1Vg95ik4u5cs8DKa4bHYKP9iRLSitMXaDSySwdeZs1PI7r7iP4t+?= =?us-ascii?Q?xJh9EzDDHYe2gXys/r/xvsSMHsIS1Fo3oCdBY+4OeiqicvCD2NGB4TVV4rcm?= =?us-ascii?Q?+ImCLdvPr0sE7uOx1DrXQPfeT2n/S58h0BeGKen+TfxfjqpcZX81w1KOeLqb?= =?us-ascii?Q?HLBRZE68fxx/z68mQ6dLbPcc7cNeabHP8mvcI+u+W6zP645aVBshJ4iQ5RMN?= =?us-ascii?Q?bsVcWdhNuYy2bwwJog2qRIG13clLxEbIU6iZ0Y2p1ItashJkT/Vt9yY1FknA?= x-ms-exchange-antispam-messagedata-1: TadicGaw8LVSKA== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3622.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 72c4575b-9770-4414-5674-08da1b49a536 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Apr 2022 23:27:14.3460 (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: r/M0TVx/gE4WaNRU7PJ8IR6lLtUyqBZpdY2T+EsAn9BTeCOxqL3WK5E+sdgA5bxEhKTozIXFseG2xdeLpaErog== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3712 Return-Path: guo.dong@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This patch changed both MdeModulePkg and UefiPayloadPkg, had better split t= hem into 2 patches? Thanks, Guo -----Original Message----- From: Akihiko Odaki =20 Sent: Friday, April 8, 2022 7:25 PM Cc: devel@edk2.groups.io; Wang, Jian J ; Gao, Liming= ; Bi, Dandan ; Kinney, Mich= ael D ; Liu, Zhiguang ;= Dong, Guo ; Ni, Ray ; Ma, Maurice ; You, Benjamin ; Akihiko Odaki= Subject: [PATCH] UefiPayloadPkg: Keep reserved MMIO at runtime Signed-off-by: Akihiko Odaki --- MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 9 +++++++++ MdePkg/Include/Pi/PiHob.h | 2 ++ UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gc= d.c index 3763467bdb..623b316c61 100644 --- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c +++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c @@ -2628,6 +2628,15 @@ CoreInitializeGcdServices ( ResourceHob->ResourceLength, Capabil= ities );++ if (!EFI_ERROR (Status) &&+ = (ResourceHob->ResourceAttribute & EFI_RESOURCE_ATTRIBUTE_RUNTIME) =3D=3D E= FI_RESOURCE_ATTRIBUTE_RUNTIME) {+ Status =3D CoreSetMemorySpaceAtt= ributes(+ ResourceHob->PhysicalStart,+ ResourceHob->R= esourceLength,+ EFI_MEMORY_RUNTIME+ );+ } = } if (GcdIoType !=3D EfiGcdIoTypeNonExistent) {diff --git a/MdePkg= /Include/Pi/PiHob.h b/MdePkg/Include/Pi/PiHob.h index e9f0ab4309..92bacbe62c 100644 --- a/MdePkg/Include/Pi/PiHob.h +++ b/MdePkg/Include/Pi/PiHob.h @@ -296,6 +296,8 @@ typedef UINT32 EFI_RESOURCE_ATTRIBUTE_TYPE; // #define= EFI_RESOURCE_ATTRIBUTE_MORE_RELIABLE 0x02000000 +#define EFI_RESOURCE_ATT= RIBUTE_RUNTIME 0x04000000+ /// /// Describes the resource properties of all= fixed, /// nonrelocatable resource ranges found on the processordiff --git= a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c b/UefiPayloadPkg/Uefi= PayloadEntry/UefiPayloadEntry.c index 0fed1e3691..a50f1c0271 100644 --- a/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c +++ b/UefiPayloadPkg/UefiPayloadEntry/UefiPayloadEntry.c @@ -74,7 +74,8 @@ MemInfoCallbackMmio ( EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE | EFI_RESOURC= E_ATTRIBUTE_WRITE_COMBINEABLE | EFI_RESOURCE_ATTRIBUTE_WRITE_T= HROUGH_CACHEABLE |- EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE= ;+ EFI_RESOURCE_ATTRIBUTE_WRITE_BACK_CACHEABLE |+ E= FI_RESOURCE_ATTRIBUTE_RUNTIME; BuildResourceDescriptorHob (Type, Attribu= e, (EFI_PHYSICAL_ADDRESS)Base, Size); DEBUG ((DEBUG_INFO, "buildhob: base= =3D 0x%lx, size =3D 0x%lx, type =3D 0x%x\n", Base, Size, Type));--=20 2.35.1