From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Subject: Re: [PATCH 8/8] KVM:PPC:booke: Allow debug interrupt injection to guest Date: Mon, 4 Feb 2013 13:47:23 -0600 Message-ID: <1360007243.14901.2@snotra> References: <6A3DF150A5B70D4F9B66A25E3F7C888D0659471E@039-SN2MPN1-023.039d.mgd.msft.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; delsp=Yes; format=Flowed Content-Transfer-Encoding: 8BIT Cc: Wood Scott-B07421 , Alexander Graf , "kvm-ppc@vger.kernel.org" , "kvm@vger.kernel.org" To: Bhushan Bharat-R65777 Return-path: Received: from ch1ehsobe005.messaging.microsoft.com ([216.32.181.185]:39086 "EHLO ch1outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754857Ab3BDTra convert rfc822-to-8bit (ORCPT ); Mon, 4 Feb 2013 14:47:30 -0500 In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D0659471E@039-SN2MPN1-023.039d.mgd.msft.net> (from R65777@freescale.com on Sun Feb 3 22:48:29 2013) Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: 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