Blame SOURCES/0001-arm64-Use-CONFIG_ARM64_VA_BITS-to-initialize-VA_BITS.patch

e64a0b
From 6ecb8a23ca294de5ef92726c782f4c92fcb39d92 Mon Sep 17 00:00:00 2001
e64a0b
From: Huang Shijie <shijie@os.amperecomputing.com>
e64a0b
Date: Fri, 11 Feb 2022 09:46:42 +0000
e64a0b
Subject: [PATCH] arm64: Use CONFIG_ARM64_VA_BITS to initialize VA_BITS_ACTUAL
e64a0b
e64a0b
We can get VA_BITS_ACTUAL from CONFIG_ARM64_VA_BITS by guess.
e64a0b
e64a0b
Without this patch, we may need to use "--machdep vabits_actual=48" to
e64a0b
set the VA_BITS_ACTUAL.
e64a0b
e64a0b
Signed-off-by: Huang Shijie <shijie@os.amperecomputing.com>
e64a0b
---
e64a0b
 arm64.c | 5 +++++
e64a0b
 1 file changed, 5 insertions(+)
e64a0b
e64a0b
diff --git a/arm64.c b/arm64.c
e64a0b
index 4f2c2b5..de1038a 100644
e64a0b
--- a/arm64.c
e64a0b
+++ b/arm64.c
e64a0b
@@ -4170,6 +4170,11 @@ arm64_calc_VA_BITS(void)
e64a0b
 			} else if (machdep->machspec->VA_BITS_ACTUAL) {
e64a0b
 				machdep->machspec->VA_BITS = machdep->machspec->VA_BITS_ACTUAL;
e64a0b
 				machdep->machspec->VA_START = _VA_START(machdep->machspec->VA_BITS_ACTUAL);
e64a0b
+			} else if (machdep->machspec->CONFIG_ARM64_VA_BITS) {
e64a0b
+				/* guess */
e64a0b
+				machdep->machspec->VA_BITS_ACTUAL = machdep->machspec->CONFIG_ARM64_VA_BITS;
e64a0b
+				machdep->machspec->VA_BITS = machdep->machspec->CONFIG_ARM64_VA_BITS;
e64a0b
+				machdep->machspec->VA_START = _VA_START(machdep->machspec->VA_BITS_ACTUAL);
e64a0b
 			} else
e64a0b
 				error(FATAL, "cannot determine VA_BITS_ACTUAL\n");
e64a0b
 		}
e64a0b
-- 
e64a0b
2.31.1
e64a0b