RE: [PATCH 4/4] kvmppc/booke: exit_nr fixup for guest debug single step

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 

> -----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.


> 
> > Thus, we'll see that an single step interrupt happens at
> > the beginning of guest exit path.
> >
> > Then we need to recognize this kind of single step interrupt
> > and fix the exit_nr to the original value.
> > So that everything looks like normal.
> >
> > Signed-off-by: Liu Yu <yu.liu@xxxxxxxxxxxxx>
> > ---
> > arch/powerpc/kvm/booke.c            |   82 
> ++++++++++++++++++++++++++ 
> > +++++++++
> > arch/powerpc/kvm/booke_interrupts.S |    9 ++--
> > 2 files changed, 87 insertions(+), 4 deletions(-)
> >
> > diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
> > index ec2722d..9056708 100644
> > --- a/arch/powerpc/kvm/booke.c
> > +++ b/arch/powerpc/kvm/booke.c
> > @@ -24,6 +24,7 @@
> > #include <linux/module.h>
> > #include <linux/vmalloc.h>
> > #include <linux/fs.h>
> > +#include <linux/highmem.h>
> >
> > #include <asm/cputable.h>
> > #include <asm/uaccess.h>
> > @@ -34,6 +35,8 @@
> > #include "booke.h"
> >
> > unsigned long kvmppc_booke_handlers;
> > +unsigned long kvmppc_booke_handler_addr[16];
> > +#define handler_vector_num 
> (sizeof(kvmppc_booke_handler_addr)/sizeof 
> > (kvmppc_booke_handler_addr[0]))
> >
> > #define VM_STAT(x) offsetof(struct kvm, stat.x), KVM_STAT_VM
> > #define VCPU_STAT(x) offsetof(struct kvm_vcpu, stat.x), 
> KVM_STAT_VCPU
> > @@ -214,6 +217,80 @@ void kvmppc_core_deliver_interrupts(struct  
> > kvm_vcpu *vcpu)
> >    }
> > }
> >
> > +int kvmppc_read_guest(struct kvm_vcpu *vcpu, unsigned long geaddr,
> > +              void *data, int len)
> 
> Ah, nice. I have something similar in book3s.c. IIRC it's called  
> kvmppc_ld.
> 
> I think we should make the semantics identical and declare it as  
> common kvmppc_core function.
> 
Cool.
--
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

[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux