Avi Kivity wrote: > Jan Kiszka wrote: >> In order to allow the gdbstub of QEMU to push (soft) breakpoint handling >> completely into the gdb frontend, this patch enables guest exits also >> for #BP exceptions - in case guest debugging was turned on. >> >> Along this enhancement, this patch also fixes the flag manipulation for >> the singlestep mode. >> > > Suppose userspace determines the exception is due to a guest > breakpoint. How does it inject the debug exception? Good question. Is there no "inject exception #XX" mechanism in kvm yet? Will need this, as my current impression is that we better keep track of breakpoints at qemu level to tell guest soft-BPs apart from host injected ones. Would you suggest to add a separate IOCTL for exception injection then? Or should the new guest debug IOCTL contain a flag that signals "inject breakpoint trap" (both for guest soft-BP hits as well as guests already in single step mode)? Jan