> On 13. Feb 2026, at 04:45, Mohamed Mediouni <[email protected]> wrote:
>
> Signed-off-by: Mohamed Mediouni <[email protected]>
> ---
> target/i386/emulate/meson.build | 1 +
> target/i386/{hvf => emulate}/x86_mmu.c | 14 +++++++++-----
> target/i386/{hvf => emulate}/x86_mmu.h | 0
> target/i386/hvf/hvf.c | 6 +++++-
> target/i386/hvf/meson.build | 1 -
> target/i386/hvf/x86.c | 2 +-
> target/i386/hvf/x86_task.c | 2 +-
> 7 files changed, 17 insertions(+), 9 deletions(-)
> rename target/i386/{hvf => emulate}/x86_mmu.c (95%)
> rename target/i386/{hvf => emulate}/x86_mmu.h (100%)
>
Oops, forgot this bit:
diff --git a/target/i386/hvf/hvf.c b/target/i386/hvf/hvf.c
index 9c5d85453d..0b3674ad33 100644
--- a/target/i386/hvf/hvf.c
+++ b/target/i386/hvf/hvf.c
@@ -263,6 +263,10 @@ static void hvf_read_mem(CPUState *cpu, void *data,
target_ulong gva, int bytes)
static void hvf_write_mem(CPUState *cpu, void *data, target_ulong gva, int
bytes)
{
+ X86CPU *x86_cpu = X86_CPU(cpu);
+ CPUX86State *env = &x86_cpu->env;
+ env->cr[0] = rvmcs(cpu->accel->fd, VMCS_GUEST_CR0);
+ env->cr[3] = rvmcs(cpu->accel->fd, VMCS_GUEST_CR3);
vmx_write_mem(cpu, gva, data, bytes);
}
Will include it in the next revision.