]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
arch/arm64: Add definitions for block-size mappings
authorMichalis Pappas <michalis@unikraft.io>
Sun, 28 Apr 2024 08:27:59 +0000 (10:27 +0200)
committerRazvan Deaconescu <razvan.deaconescu@upb.ro>
Mon, 3 Jun 2024 10:57:23 +0000 (13:57 +0300)
VMSAv8-64 does not provide a naming scheme for the block
size mapped by PT block descriptors at various translation
levels. Moreover, the block size varies depending on the
size of the translation granule.

To provide granularity agnostic definitions, use the
x86_64 terminology of Large / Huge pages.

Signed-off-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
Reviewed-by: Serban Sorohan <serban.sorohan@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
GitHub-Closes: #1373

arch/arm/arm64/include/uk/asm/paging.h

index fdd9ef25f6396db5ee2f6b9235797674d74768c6..5324890509d9a73e158e40463041a3983a542e53 100644 (file)
@@ -69,6 +69,16 @@ struct ukarch_pagetable {
 #define PT_PTES_PER_LEVEL              512
 #define PT_LEVEL_SHIFT                 9
 
+#define PAGE_LARGE_LEVEL               1
+#define PAGE_LARGE_SHIFT               21
+#define PAGE_LARGE_SIZE                        0x200000UL
+#define PAGE_LARGE_MASK                        (~(PAGE_LARGE_SIZE - 1))
+
+#define PAGE_HUGE_LEVEL                        2
+#define PAGE_HUGE_SHIFT                        30
+#define PAGE_HUGE_SIZE                 0x40000000UL
+#define PAGE_HUGE_MASK                 (~(PAGE_HUGE_SIZE - 1))
+
 /* We use plain values here so we do not create dependencies on external helper
  * macros, which would forbid us to use the macros in functions defined further
  * down in this header.