target/i386: emulate: 5-level paging for the page table walker
Signed-off-by: Mohamed Mediouni <mohamed@unpredictable.fr> Link: https://lore.kernel.org/r/20260223233950.96076-19-mohamed@unpredictable.fr Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Mohamed Mediouni committed
Feb 24, 2026 at 00:39 UTC
d1d985a34d5b30c5b99e8e203bc33f22b6e363b4
4 files changed
+17
target/i386/emulate/x86.h
+1
@@ -263,6 +263,7 @@ bool x86_is_protected(CPUState *cpu);
263
bool x86_is_real(CPUState *cpu);
264
bool x86_is_v8086(CPUState *cpu);
265
bool x86_is_long_mode(CPUState *cpu);
266
+bool x86_is_la57(CPUState *cpu);
267
bool x86_is_long64_mode(CPUState *cpu);
268
bool x86_is_paging_mode(CPUState *cpu);
269
bool x86_is_pae_enabled(CPUState *cpu);
target/i386/emulate/x86_helpers.c
+8
@@ -236,6 +236,14 @@ bool x86_is_long_mode(CPUState *cpu)
236
return ((efer & lme_lma) == lme_lma);
237
}
238
239
+bool x86_is_la57(CPUState *cpu)
240
+{
241
+ X86CPU *x86_cpu = X86_CPU(cpu);
242
+ CPUX86State *env = &x86_cpu->env;
243
+ uint64_t is_la57 = env->cr[4] & CR4_LA57_MASK;
244
+ return is_la57;
245
+}
246
+
247
bool x86_is_long64_mode(CPUState *cpu)
248
{
249
error_report("unimplemented: is_long64_mode()");
target/i386/emulate/x86_mmu.c
+3
@@ -56,6 +56,9 @@ static int gpt_top_level(CPUState *cpu, bool pae)
56
return 2;
57
}
58
if (x86_is_long_mode(cpu)) {
59
+ if (x86_is_la57(cpu)) {
60
+ return 5;
61
+ }
62
return 4;
63
}
64
target/i386/hvf/x86.c
+5
@@ -138,6 +138,11 @@ bool x86_is_long_mode(CPUState *cpu)
138
return rvmcs(cpu->accel->fd, VMCS_GUEST_IA32_EFER) & MSR_EFER_LMA;
139
}
140
141
+bool x86_is_la57(CPUState *cpu)
142
+{
143
+ return false;
144
+}
145
+
146
bool x86_is_long64_mode(CPUState *cpu)
147
{
148
struct vmx_segment desc;