From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web10.22191.1678062132259075315 for ; Sun, 05 Mar 2023 16:22:13 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=AkXu/siX; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: nathaniel.l.desimone@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678062132; x=1709598132; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=UgG3XdJLzbyBuXwZ7j/y6Aq7tIyMKTNHxsObW7T26LA=; b=AkXu/siXHyWaeC1vnFfYT2UFMBFhrfRbIKhK/fO4v5ZwKhNHkWF3n/J1 RF8n6tCDnERRjVoPxscDzNaBEPeotcqtcf+0vPcTEadXtc7Qbw3PZ/uwd 47Xaiw/zJoP+rv3RMZjUH/045E2TM/Nz2Z6c0JCvVcyO2nttip+2XlWqz AQZJ6hZubm5Tn6i2J0tjAx38RLPnhCh7Mw6RQ3bWu7/cGRLQJAH0H8Fqc UZ1NaZmDKw4VMw+4YOVAyAsbndQBHX4LUuJTOxNcpXrJUF1DdNPN2roSM MIIGPfYKyZRB0862LwgHlGDk9klzjBu7PGluvQ9miFGy6J9YrqDlHbLwa g==; X-IronPort-AV: E=McAfee;i="6500,9779,10640"; a="337758110" X-IronPort-AV: E=Sophos;i="5.98,236,1673942400"; d="scan'208";a="337758110" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Mar 2023 16:22:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10640"; a="669263309" X-IronPort-AV: E=Sophos;i="5.98,236,1673942400"; d="scan'208";a="669263309" Received: from nldesimo-desk.amr.corp.intel.com ([10.24.12.177]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Mar 2023 16:22:11 -0800 From: "Nate DeSimone" To: devel@edk2.groups.io Cc: Leif Lindholm , Ard Biesheuvel , Sami Mujawar , Michael D Kinney , Chasel Chiu Subject: [PATCH v1 1/6] ArmPkg: Add ArmMmuNullLib Date: Sun, 5 Mar 2023 16:22:00 -0800 Message-Id: <20230306002205.1640-2-nathaniel.l.desimone@intel.com> X-Mailer: git-send-email 2.39.2.windows.1 In-Reply-To: <20230306002205.1640-1-nathaniel.l.desimone@intel.com> References: <20230306002205.1640-1-nathaniel.l.desimone@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Adds a NULL implementation of the ArmMmuLib. This is nessesary for ARM support in EmulatorPkg due to DxeIplPeim requiring an implementation of ArmMmuLib. Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Sami Mujawar Cc: Michael D Kinney Cc: Chasel Chiu Signed-off-by: Nate DeSimone --- ArmPkg/ArmPkg.dsc | 2 + ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.c | 84 +++++++++++++++++++ .../Library/ArmMmuNullLib/ArmMmuNullLib.inf | 36 ++++++++ 3 files changed, 122 insertions(+) create mode 100644 ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.c create mode 100644 ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.inf diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc index 3fb95d1951..3dc2c21e9d 100644 --- a/ArmPkg/ArmPkg.dsc +++ b/ArmPkg/ArmPkg.dsc @@ -6,6 +6,7 @@ # Copyright (c) 2016, Linaro Ltd. All rights reserved.
# Copyright (c) Microsoft Corporation.
# Copyright (c) 2021, Ampere Computing LLC. All rights reserved. +# Copyright (c) 2023, Intel Corporation. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -142,6 +143,7 @@ ArmPkg/Filesystem/SemihostFs/SemihostFs.inf ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf + ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.inf ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf diff --git a/ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.c b/ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.c new file mode 100644 index 0000000000..f91582f86a --- /dev/null +++ b/ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.c @@ -0,0 +1,84 @@ +/** @file + ARM MMU NULL Library + +Copyright (c) 2023, Intel Corporation. All rights reserved.
+Copyright (c) 2015 - 2016, Linaro Ltd. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include + +EFI_STATUS +EFIAPI +ArmConfigureMmu ( + IN ARM_MEMORY_REGION_DESCRIPTOR *MemoryTable, + OUT VOID **TranslationTableBase OPTIONAL, + OUT UINTN *TranslationTableSize OPTIONAL + ) +{ + return EFI_UNSUPPORTED; +} + +EFI_STATUS +EFIAPI +ArmSetMemoryRegionNoExec ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length + ) +{ + return EFI_UNSUPPORTED; +} + +EFI_STATUS +EFIAPI +ArmClearMemoryRegionNoExec ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length + ) +{ + return EFI_UNSUPPORTED; +} + +EFI_STATUS +EFIAPI +ArmSetMemoryRegionReadOnly ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length + ) +{ + return EFI_UNSUPPORTED; +} + +EFI_STATUS +EFIAPI +ArmClearMemoryRegionReadOnly ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length + ) +{ + return EFI_UNSUPPORTED; +} + +VOID +EFIAPI +ArmReplaceLiveTranslationEntry ( + IN UINT64 *Entry, + IN UINT64 Value, + IN UINT64 RegionStart, + IN BOOLEAN DisableMmu + ) +{ + return; +} + +EFI_STATUS +ArmSetMemoryAttributes ( + IN EFI_PHYSICAL_ADDRESS BaseAddress, + IN UINT64 Length, + IN UINT64 Attributes + ) +{ + return EFI_UNSUPPORTED; +} diff --git a/ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.inf b/ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.inf new file mode 100644 index 0000000000..fa6791f3d9 --- /dev/null +++ b/ArmPkg/Library/ArmMmuNullLib/ArmMmuNullLib.inf @@ -0,0 +1,36 @@ +## @file +# Module Information description file for ARM MMU NULL Library +# +# For user space environments like EmulatorPkg +# +# Copyright (c) 2023, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x00010017 + BASE_NAME = ArmMmuNullLib + FILE_GUID = E61735C8-DD00-4C4A-B07B-FD71A67C239D + VERSION_STRING = 1.0 + MODULE_TYPE = BASE + LIBRARY_CLASS = ArmMmuLib +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES ARM AARCH64 +# + +[LibraryClasses] + + +[Packages] + ArmPkg/ArmPkg.dec + MdePkg/MdePkg.dec + +[Pcd] + +[Sources] + ArmMmuNullLib.c + +[Guids] -- 2.30.2