> -----Original Message----- > From: kvm-owner@xxxxxxxxxxxxxxx [mailto:kvm-owner@xxxxxxxxxxxxxxx] On Behalf Of > Alexander Graf > Sent: Wednesday, April 03, 2013 11:26 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 > > > > Am 03.04.2013 um 19:47 schrieb Bhushan Bharat-R65777 <R65777@xxxxxxxxxxxxx>: > > >>>>>>>>> + dbg_reg =&(vcpu->arch.shadow_dbg_reg); > >>>>>>>>> + > >>>>>>>>> + /* > >>>>>>>>> + * On BOOKE (e500v2); Set DBCR1 and DBCR2 to allow debug events > >>>>>>>>> + * to occur when MSR.PR is set. > >>>>>>>>> + * On BOOKE-HV (e500mc+); MSR.PR = 0 when guest is running. So we > >>>>>>>>> + * should clear DBCR1 and DBCR2. > >>>>>>>>> + */ > >>>>>>>>> +#ifdef CONFIG_KVM_BOOKE_HV > >>>>>>>>> + dbg_reg->dbcr1 = 0; > >>>>>>>>> + dbg_reg->dbcr2 = 0; > >>>>>>>> Does that mean we can't debug guest user space? > >>>>>>> Yes > >>>>>> This is wrong. > >>>>> Really, So far I am assuming qemu debug stub is not mean for > >>>>> debugging guest > >>>> application. > >>>> > >>>> Ok, let me rephrase: This is confusing. You do trap in PR mode on > >>>> e500v2. IIRC > >>>> x86 also traps in kernel and user space. I don't see why e500 hv > >>>> should be different. > >>> > >>> I am sorry, I think did not read the document correctly. > >>> > >>> DBCR1 = 0 ; means the "00 IAC1 debug conditions unaffected by > MSR[PR],MSR[GS]. > >>> > >>> Similarly for dbcr2. > >>> > >>> So yes the guest user space can be debugged. > >> > >> So why is this conditional on BOOKE_HV then? Wouldn't it make things > >> easier to treat HV and PR identical? > > > > On BOOKE-HV we have to keep these to 0, so guest and guest application both > can be debugged. Also on HV we have EPCR.DUVD to control that debug events will > not come in hypervisor (GS = 0). > > > > On BOOKE; guest and guest application both runs in PR = 1 and hypervisor in PR > = 0. So with dbcr1/dbcr2 on booke we control debug exception not to come in > hypervisor mode still allow guest and its application debugging. > > Ah, can we group these 2 overrides next to each other with an #ifdef ... #else > to make this obvious from the code? I will try :) Thanks -Bharat -- 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