From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Mon, 04 Feb 2013 19:47:23 +0000 Subject: Re: [PATCH 8/8] KVM:PPC:booke: Allow debug interrupt injection to guest Message-Id: <1360007243.14901.2@snotra> List-Id: References: <6A3DF150A5B70D4F9B66A25E3F7C888D0659471E@039-SN2MPN1-023.039d.mgd.msft.net> In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D0659471E@039-SN2MPN1-023.039d.mgd.msft.net> (from R65777@freescale.com on Sun Feb 3 22:48:29 2013) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Bhushan Bharat-R65777 Cc: Wood Scott-B07421 , Alexander Graf , "kvm-ppc@vger.kernel.org" , "kvm@vger.kernel.org" On 02/03/2013 10:48:29 PM, Bhushan Bharat-R65777 wrote: > > > > -----Original Message----- > > From: Wood Scott-B07421 > > Sent: Saturday, February 02, 2013 4:09 AM > > To: Alexander Graf > > Cc: Bhushan Bharat-R65777; kvm-ppc@vger.kernel.org; > kvm@vger.kernel.org > > Subject: Re: [PATCH 8/8] KVM:PPC:booke: Allow debug interrupt > injection to guest > > > > On 01/31/2013 06:11:32 PM, Alexander Graf wrote: > > > My main concern here is that we don't know when to remove MSR_DE > again > > > from the (shadow) MSR. So how about this one instead? > > > > Why wouldn't you know this? if (vcpu->guest_debug) { you never > remove it } else > > { just copy whatever's in guest MSR } > > I think we are ok with shadow_msr on e500v2 but we can have problem > on bookehv where we do not know when to clear MSR_DE in shared->msr. > > How it works on e500mc: > (1) User-space makes ioctl to use debug resource, we set > vcpu->guest_debug. > (2) Before entering into the guest we check vcpu->guest_debug > flag and if set we set MSR_DE in shared->msr. > (3) Sometime later user-space releases the debug resource then > in ioctl handling will clear vcpu->guest_debug. > (4) Now when entering to guest we do not know what to do with > MSR_DE in shared->msr as we do now know if guest might have tried to > set/clear MSR_DE in between step (2) and step(3). What should be safe > thing to do? Can we leave MSR_DE set or clear MSR_DE. If we want to > clear MSR_DE then will it be good idea to clear this in step (3) > above (in ioctl where we clear vcpu->guest_debug). Oh, you want to support dynamically changing the debug mode? The hardware can't really deal with that, unless you paravirt MSR[DE], which doesn't seem worth it. There's also the issue of confusing the guest if it checks EDM before you give debug to the host (this one applies to e500v2 as well). -Scott