summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Rudolph <siro@das-labor.org>2019-11-12 16:56:43 +0100
committerPatrick Georgi <pgeorgi@google.com>2019-12-26 10:39:26 +0000
commite69798b5ae43d0a71fcbe6e2b38b0dc8edf404bf (patch)
tree8e1b50693df7c3d9b19b4bbb08bae6b4e7325517
parentb73111cfa74a76842c9403e534e8b8163a8a77e1 (diff)
util/pgtblgen: Fix qemu on KVM
Running the x86_64 qemu mainboard target with '-accel kvm' results in hang, as the 'D' and 'A' bits needs to be set in read only page tables. Tested on QEMU Q35: Boots into payload with '-accel kvm'. Change-Id: I4beae8deec6bf34f9762e7b54c5da4e5b63f6d24 Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/36778 Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--util/pgtblgen/pgtblgen.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/util/pgtblgen/pgtblgen.c b/util/pgtblgen/pgtblgen.c
index e9ebd8b0cf..3a41a90793 100644
--- a/util/pgtblgen/pgtblgen.c
+++ b/util/pgtblgen/pgtblgen.c
@@ -38,12 +38,14 @@ static void usage(char *argv[])
*
* Page table attributes: WB, User+Supervisor, Present, Writeable
*/
-#define PRES (1ULL << 0)
-#define RW (1ULL << 1)
-#define US (1ULL << 2)
-#define PS (1ULL << 7)
-#define _GEN_DIR(a) (PRES | RW | US | (a))
-#define _GEN_PAGE(a) (PRES | RW | US | PS | (a))
+#define _PRES (1ULL << 0)
+#define _RW (1ULL << 1)
+#define _US (1ULL << 2)
+#define _A (1ULL << 5)
+#define _D (1ULL << 6)
+#define _PS (1ULL << 7)
+#define _GEN_DIR(a) (_PRES | _RW | _US | _A | (a))
+#define _GEN_PAGE(a) (_PRES | _RW | _US | _PS | _A | _D | (a))
/*
* Generate x86_64 page tables.