Am 03.04.2013 um 12:03 schrieb Bhushan Bharat-R65777 <R65777@xxxxxxxxxxxxx>: > > >> -----Original Message----- >> From: Wood Scott-B07421 >> Sent: Tuesday, April 02, 2013 11:30 PM >> To: Bhushan Bharat-R65777 >> Cc: Alexander Graf; kvm-ppc@xxxxxxxxxxxxxxx; kvm@xxxxxxxxxxxxxxx; Wood Scott- >> B07421 >> Subject: Re: [PATCH 4/4 v2] KVM: PPC: Add userspace debug stub support >> >> On 04/02/2013 09:09:34 AM, Bhushan Bharat-R65777 wrote: >>> >>> >>>> -----Original Message----- >>>> From: Alexander Graf [mailto:agraf@xxxxxxx] >>>> Sent: Tuesday, April 02, 2013 1:57 PM >>>> To: Bhushan Bharat-R65777 >>>> Cc: kvm-ppc@xxxxxxxxxxxxxxx; kvm@xxxxxxxxxxxxxxx; Wood Scott-B07421 >>>> Subject: Re: [PATCH 4/4 v2] KVM: PPC: Add userspace debug stub >>> support >>>> >>>> >>>> On 29.03.2013, at 07:04, Bhushan Bharat-R65777 wrote: >>>> >>>>> >>>>> >>>>>> -----Original Message----- >>>>>> From: Alexander Graf [mailto:agraf@xxxxxxx] >>>>>> Sent: Thursday, March 28, 2013 10:06 PM >>>>>> To: Bhushan Bharat-R65777 >>>>>> Cc: kvm-ppc@xxxxxxxxxxxxxxx; kvm@xxxxxxxxxxxxxxx; Wood >>> Scott-B07421; >>>>>> Bhushan >>>>>> Bharat-R65777 >>>>>> Subject: Re: [PATCH 4/4 v2] KVM: PPC: Add userspace debug stub >>>>>> support >>>>>> >>>>>> >>>>>> How does the normal debug register switching code work in Linux? >>>>>> Can't we just reuse that? Or rely on it to restore working state >>> when >>>>>> another process gets scheduled in? >>>>> >>>>> Good point, I can see debug registers loading in function >>> __switch_to()- >>>>> switch_booke_debug_regs() in file arch/powerpc/kernel/process.c. >>>>> So as long as assume that host will not use debug resources we >>> can rely on >>>> this restore. But I am not sure that this is a fare assumption. As >>> Scott earlier >>>> mentioned someone can use debug resource for kernel debugging also. >>>> >>>> Someone in the kernel can also use floating point registers. But >>> then it's his >>>> responsibility to clean up the mess he leaves behind. >>> >>> I am neither convinced by what you said and nor even have much reason >>> to oppose :) >>> >>> Scott, >>> I remember you mentioned that host can use debug resources, you >>> comment on this ? >> >> I thought the conclusion we reached was that it was OK as long as KVM waits >> until it actually needs the debug resources to mess with the registers. > > Right, Are we also agreeing on that KVM will not save/restore host debug context on vcpu_load/vcpu_put()? KVM will load its context in vcpu_load() if needed and on vcpu_put() it will clear DBCR0 and DBSR. That depends on whether the kernel restores the debug registers. Please double-check that. Also, someone could want to gdb QEMU, so the debug registers might have to get restored on a heavy weight exit. I'd hope Linux just provides helpers to restore a process's debug state that we can call here. Alex > > Thanks > -Bharat > > > > > -- > 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 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html