Re: Problem debugging kernel driver running on guest os

2023-07-25 Thread Peter Maydell
On Tue, 25 Jul 2023 at 12:50, Mark Wood-Patrick  wrote:
>
>  I am trying to debug a driver issue where the driver is running on the guest 
> os running under QEMU 7.1.0 using gdb running on the host & connecting to the 
> guest. When I try to attach I get a message "qemu-system-x86_64: 
> -s: gdbstub: KVM doesn't support guest debugging". This used to work on QEMU 
> 4.2, does anyone know what changed or what the issue is and how to fix it?

I have a suspicion you may be running into a bug in your
host kernel. QEMU used to unconditionally assume that you
could do guest debug on KVM, but this isn't generally
true across host architectures, so somewhere around
QEMU 6.2 we started explicitly checking "does the kernel
say it supports KVM_CAP_SET_GUEST_DEBUG" before trying to
use it. Unfortunately a bug in the kernel meant that on
x86 it wasn't actually advertising that capability even
though it had supported it for a long time.

You should check that your host kernel has
commit b9b2782cd55aaf5a or some backport of that:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b9b2782cd55aaf5a65573df99376cf391941cb66

thanks
-- PMM



Problem debugging kernel driver running on guest os

2023-07-25 Thread Mark Wood-Patrick
 I am trying to debug a driver issue where the driver is running on the
guest os running under QEMU 7.1.0 using gdb running on the host &
connecting to the guest. When I try to attach I get a message
"qemu-system-x86_64: -s: gdbstub: KVM doesn't support guest debugging".
This used to work on QEMU 4.2, does anyone know what changed or what the
issue is and how to fix it?

-- 
Mark Wood-Patrick