Liu Yu-B13201 wrote: > > > >> -----Original Message----- >> From: Alexander Graf [mailto:agraf@xxxxxxx] >> Sent: Wednesday, February 03, 2010 6:14 PM >> To: Liu Yu-B13201 >> Cc: hollis@xxxxxxxxxxxxxx; kvm-ppc@xxxxxxxxxxxxxxx; >> kvm@xxxxxxxxxxxxxxx >> Subject: Re: [PATCH 4/4] kvmppc/booke: exit_nr fixup for >> guest debug single step >> >> Liu Yu-B13201 wrote: >> >>> >>> >>> >>> >>>> -----Original Message----- >>>> From: kvm-ppc-owner@xxxxxxxxxxxxxxx >>>> [mailto:kvm-ppc-owner@xxxxxxxxxxxxxxx] On Behalf Of Alexander Graf >>>> Sent: Wednesday, February 03, 2010 5:03 PM >>>> To: Liu Yu-B13201 >>>> Cc: hollis@xxxxxxxxxxxxxx; kvm-ppc@xxxxxxxxxxxxxxx; >>>> kvm@xxxxxxxxxxxxxxx; Liu Yu-B13201 >>>> Subject: Re: [PATCH 4/4] kvmppc/booke: exit_nr fixup for >>>> guest debug single step >>>> >>>> >>>> Am 03.02.2010 um 08:53 schrieb Liu Yu <yu.liu@xxxxxxxxxxxxx>: >>>> >>>> >>>> >>>>> As BOOKE doesn't have hardware support for virtualization, >>>>> hardware never know who's guest and host. >>>>> >>>>> When enable hardware single step in guest, >>>>> we cannot disabled it at the point we switch back to host. >>>>> >>>>> >>>> Why not? We directly arrive in our code. So we can just >>>> disable it, no? >>>> >>>> Or does that break when you'd try to debug the guest >>>> interrupt handlers? >>>> >>>> >>> That's the hardware limitition. >>> Assume received itlb miss interrupt, but it doesn't clear >>> >> MSR_DE in MSR, >> >>> so on the exit path single step still work and then debug >>> >> interrupt is >> >>> triggled. >>> >>> >> MSRDE is set to 0 by critical class interrupts >> unless Category E.ED is supported, by Debug >> interrupts, and by Machine Check interrupts, >> and is left unchanged by all other interrupts. >> >> Great. >> >> So when single stepping is enabled, you jump into the guest, >> get an itlb >> miss, get out, still have DE set, get in KVM's own DE handler and can >> process things from there. >> >> Could you check if the debug instruction was on PR=0? If so, you can >> just rfi and be good, right? >> >> > > Hr? > The moment we found this happen we've already saved the guest and loaded host on exit path > Rfi will make exit path again which means save guest again. > Well the guest saving code is in our hands. So we can just modify the debug interrupt handler in booke_interrupts.S to check for PR=0 first thing and then decide whether to save to guest state or return to the host kernel. I think that'd make it a lot cleaner. Alex -- To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html