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.web11.13647.1600942973425380349 for ; Thu, 24 Sep 2020 03:22:53 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: jacek.kukiello@intel.com) IronPort-SDR: Q/KLEYnRf0E4twlDEq3KH7W2j1QznUyvrhvCP9NbDYj4Nbvwbr6E8s6dR//AjCUp9UsA25y3N+ EvELo4P2/SAQ== X-IronPort-AV: E=McAfee;i="6000,8403,9753"; a="179235840" X-IronPort-AV: E=Sophos;i="5.77,297,1596524400"; d="scan'208";a="179235840" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2020 03:22:52 -0700 IronPort-SDR: 5jOdf+JvKCRdFAPAxPl20ei5TkV49oNffMgdHO0EN2XrbCscYj+wI5oStPyaGi6+A0ThQWoPAX h+iySVVEvW4g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,297,1596524400"; d="scan'208";a="338996261" Received: from jkukiell-desk.ger.corp.intel.com ([10.102.87.26]) by orsmga008.jf.intel.com with ESMTP; 24 Sep 2020 03:22:50 -0700 From: "Malgorzata Kukiello" To: devel@edk2.groups.io Cc: Malgorzata Kukiello , Jian J Wang , Hao A Wu , Dandan Bi , Liming Gao , Oleksiy Yakovlev , Ard Biesheuvel Subject: [PATCH v2 2/2] MdeModulePkg/Core/Dxe: expose SP and CRYPTO capabilities in UEFI memmap Date: Thu, 24 Sep 2020 12:21:31 +0200 Message-Id: <20200924102132.18248-2-jacek.kukiello@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 In-Reply-To: <20200924102132.18248-1-jacek.kukiello@intel.com> References: <20200924102132.18248-1-jacek.kukiello@intel.com> OSs are now capable of treating SP and CRYPTO memory as true capabilities and therefore these should be exposed. This requires usage of a separate ACCESS_MASK to hide all page-access permission capabilities. Change in masking and hiding of SP and CRYPTO was introduced in 3bd5c994c879f78e8e3d5346dc3b627f199291aa Signed-off-by: Malgorzata Kukiello Cc: Jian J Wang Cc: Hao A Wu Cc: Dandan Bi Cc: Liming Gao Cc: Oleksiy Yakovlev Cc: Ard Biesheuvel (ARM address) --- MdeModulePkg/Core/Dxe/Mem/Page.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/Page.c index 2c2c9cd6c3..731bf08bc9 100644 --- a/MdeModulePkg/Core/Dxe/Mem/Page.c +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c @@ -1924,16 +1924,16 @@ CoreGetMemoryMap ( // set attributes and change memory paging attribute accordingly. // But current EFI_MEMORY_DESCRIPTOR.Attribute is assigned by // value from Capabilities in GCD memory map. This might cause - // boot problems. Clearing all paging related capabilities can - // workaround it. Following code is supposed to be removed once - // the usage of EFI_MEMORY_DESCRIPTOR.Attribute is clarified in - // UEFI spec and adopted by both EDK-II Core and all supported - // OSs. + // boot problems. Clearing all page-access permission related + // capabilities can workaround it. Following code is supposed to + // be removed once the usage of EFI_MEMORY_DESCRIPTOR.Attribute + // is clarified in UEFI spec and adopted by both EDK-II Core and + // all supported OSs. // MemoryMapEnd = MemoryMap; MemoryMap = MemoryMapStart; while (MemoryMap < MemoryMapEnd) { - MemoryMap->Attribute &= ~(UINT64)EFI_MEMORY_ATTRIBUTE_MASK; + MemoryMap->Attribute &= ~(UINT64)EFI_MEMORY_ACCESS_MASK; MemoryMap = NEXT_MEMORY_DESCRIPTOR (MemoryMap, Size); } MergeMemoryMap (MemoryMapStart, &BufferSize, Size); -- 2.18.0.windows.1 --------------------------------------------------------------------- Intel Technology Poland sp. z o.o. ul. Sowackiego 173 | 80-298 Gdask | Sd Rejonowy Gdask Pnoc | VII Wydzia Gospodarczy Krajowego Rejestru Sdowego - KRS 101882 | NIP 957-07-52-316 | Kapita zakadowy 200.000 PLN. Ta wiadomo wraz z zacznikami jest przeznaczona dla okrelonego adresata i moe zawiera informacje poufne. W razie przypadkowego otrzymania tej wiadomoci, prosimy o powiadomienie nadawcy oraz trwae jej usunicie; jakiekolwiek przegldanie lub rozpowszechnianie jest zabronione. This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.