]> git.ipfire.org Git - thirdparty/qemu.git/commit
whpx: Fixed incorrect CR8/TPR synchronization
authorIvan Shcherbakov <ivan@sysprogs.com>
Wed, 23 Feb 2022 05:18:00 +0000 (21:18 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 15 Mar 2022 10:26:20 +0000 (11:26 +0100)
commit5ad93fd351b303172732f3cea953c67fa7fa336e
treee60e4c024f576de561f80f361437cce79d514c7c
parente561890841e8b1ab49a5610dd811ab732904fb1f
whpx: Fixed incorrect CR8/TPR synchronization

This fixes the following error triggered when stopping and resuming a 64-bit
Linux kernel via gdb:

qemu-system-x86_64.exe: WHPX: Failed to set virtual processor context, hr=c0350005

The previous logic for synchronizing the values did not take into account
that the lower 4 bits of the CR8 register, containing the priority level,
mapped to bits 7:4 of the APIC.TPR register (see section 10.8.6.1 of
Volume 3 of Intel 64 and IA-32 Architectures Software Developer's Manual).
The caused WHvSetVirtualProcessorRegisters() to fail with an error,
effectively preventing GDB from changing the guest context.

Signed-off-by: Ivan Shcherbakov <ivan@sysprogs.com>
Message-Id: <010b01d82874$bb4ef160$31ecd420$@sysprogs.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/whpx/whpx-all.c