qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] RE: [PATCH 3/5] Add guest debug support for kvmppc


From: Liu Yu-B13201
Subject: [Qemu-devel] RE: [PATCH 3/5] Add guest debug support for kvmppc
Date: Tue, 28 Jul 2009 10:01:57 +0800

 

> -----Original Message-----
> From: address@hidden [mailto:address@hidden 
> Sent: Saturday, July 25, 2009 6:19 PM
> To: Liu Yu-B13201
> Cc: qemu-devel; Hollis Blanchard; kvm-ppc; Nathan Froyd
> Subject: Re: [PATCH 3/5] Add guest debug support for kvmppc
> 
> Liu Yu wrote:
> > Signed-off-by: Liu Yu 
> <address@hidden>
> > ---
> >  target-ppc/kvm.c |  197 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  1 files changed, 197 insertions(+), 0 deletions(-)
> > 
> > diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
> > index b53d6e9..d8dbdb4 100644
> > --- a/target-ppc/kvm.c
> > +++ b/target-ppc/kvm.c
> > +
> > +int kvm_arch_debug(struct kvm_debug_exit_arch *arch_info)
> > +{
> > +    int handle = 0;
> > +    int n;
> > +
> > +    if (cpu_single_env->singlestep_enabled) {
> > +        handle = 1;
> > +
> > +    } else if (arch_info->status) {
> > +        if (arch_info->status == KVMPPC_DEBUG_BREAKPOINT) {
> > +            n = find_hw_breakpoint(arch_info->pc, 
> GDB_BREAKPOINT_HW);
> > +            if (n >= 0)
> > +                handle = 1;
> > +
> > +        } else if (arch_info->status == 
> KVMPPC_DEBUG_WATCH_ACCESS) {
> > +            n = find_hw_breakpoint(arch_info->pc, 
> GDB_WATCHPOINT_ACCESS);
> > +            if (n >= 0) {
> > +                handle = 1;
> > +                cpu_single_env->watchpoint_hit = &hw_watchpoint;
> > +                hw_watchpoint.vaddr = hw_breakpoint[n].addr;
> > +                hw_watchpoint.flags = BP_MEM_ACCESS;
> > +            }
> > +
> > +        } else if (arch_info->status == KVMPPC_DEBUG_WATCH_WRITE) {
> > +            n = find_hw_breakpoint(arch_info->pc, 
> GDB_WATCHPOINT_WRITE);
> > +            if (n >= 0) {
> > +                handle = 1;
> > +                cpu_single_env->watchpoint_hit = &hw_watchpoint;
> > +                hw_watchpoint.vaddr = hw_breakpoint[n].addr;
> > +                hw_watchpoint.flags = BP_MEM_WRITE;
> > +            }
> > +        }
> > +
> > +    } else if (kvm_find_sw_breakpoint(cpu_single_env, 
> arch_info->pc))
> > +        handle = 1;
> > +
> > +    /* XXX inject guest debug exception */
> > +    if (!handle)
> > +        printf("Unhandled debug exception!\n");
> 
> Out of curiosity: Not yet implemented here, or is PPC also 
> lacking some
> kernel bits to support it?

Yes, guest has no hardware debug support in booke kvm so far.
It's now useless for a guest to set debug register.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]