diff mbox

[5/6] KVM: PPC: BOOKE: Allow guest to change MSR_DE

Message ID 1405067941-27134-6-git-send-email-Bharat.Bhushan@freescale.com
State New, archived
Headers show

Commit Message

Bharat Bhushan July 11, 2014, 8:39 a.m. UTC
When userspace is debugging guest then MSR_DE is always set and
MSRP_DEP is set so that guest cannot change MSR_DE.
Guest debug resources are not yet emulated, So there seems no reason
we should stop guest controlling MSR_DE.
Also a followup patch will enable debug emulation and that requires
guest to control MSR_DE.

Signed-off-by: Bharat Bhushan <Bharat.Bhushan@freescale.com>
---
 arch/powerpc/kvm/e500mc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Scott Wood July 28, 2014, 10:01 p.m. UTC | #1
On Fri, 2014-07-11 at 14:09 +0530, Bharat Bhushan wrote:
> When userspace is debugging guest then MSR_DE is always set and
> MSRP_DEP is set so that guest cannot change MSR_DE.
> Guest debug resources are not yet emulated, So there seems no reason
> we should stop guest controlling MSR_DE.
> Also a followup patch will enable debug emulation and that requires
> guest to control MSR_DE.

Why does it matter whether we emulate debug resources?  We still don't
want the guest to be able to clear MSR[DE] and thus break host debug.

-Scott


--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alexander Graf July 29, 2014, 2:05 p.m. UTC | #2
On 29.07.14 00:01, Scott Wood wrote:
> On Fri, 2014-07-11 at 14:09 +0530, Bharat Bhushan wrote:
>> When userspace is debugging guest then MSR_DE is always set and
>> MSRP_DEP is set so that guest cannot change MSR_DE.
>> Guest debug resources are not yet emulated, So there seems no reason
>> we should stop guest controlling MSR_DE.
>> Also a followup patch will enable debug emulation and that requires
>> guest to control MSR_DE.
> Why does it matter whether we emulate debug resources?  We still don't
> want the guest to be able to clear MSR[DE] and thus break host debug.

The patch description is misleading. This patch changes the default of 
DEP to "guest controlled" when it boots up. Once QEMU wants control over 
the debug registers, it gets switched to "QEMU controlled" (that code is 
already there).


Alex

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bharat Bhushan July 30, 2014, 5:37 a.m. UTC | #3
> -----Original Message-----

> From: Alexander Graf [mailto:agraf@suse.de]

> Sent: Tuesday, July 29, 2014 7:35 PM

> To: Wood Scott-B07421; Bhushan Bharat-R65777

> Cc: kvm-ppc@vger.kernel.org; kvm@vger.kernel.org; Yoder Stuart-B08248

> Subject: Re: [PATCH 5/6] KVM: PPC: BOOKE: Allow guest to change MSR_DE

> 

> 

> On 29.07.14 00:01, Scott Wood wrote:

> > On Fri, 2014-07-11 at 14:09 +0530, Bharat Bhushan wrote:

> >> When userspace is debugging guest then MSR_DE is always set and

> >> MSRP_DEP is set so that guest cannot change MSR_DE.

> >> Guest debug resources are not yet emulated, So there seems no reason

> >> we should stop guest controlling MSR_DE.

> >> Also a followup patch will enable debug emulation and that requires

> >> guest to control MSR_DE.

> > Why does it matter whether we emulate debug resources?  We still don't

> > want the guest to be able to clear MSR[DE] and thus break host debug.

> 

> The patch description is misleading. This patch changes the default of DEP to

> "guest controlled" when it boots up. Once QEMU wants control over the debug

> registers, it gets switched to "QEMU controlled" (that code is already there).


Yes, now default MSR_DE is controlled by guest and when QEMU wants to use debug resources then MSR_DEP is set, so guest cannot change MSR_DE.

Thanks
-Bharat 

> 

> 

> Alex
diff mbox

Patch

diff --git a/arch/powerpc/kvm/e500mc.c b/arch/powerpc/kvm/e500mc.c
index 690499d..bd0a2bd 100644
--- a/arch/powerpc/kvm/e500mc.c
+++ b/arch/powerpc/kvm/e500mc.c
@@ -194,7 +194,7 @@  int kvmppc_core_vcpu_setup(struct kvm_vcpu *vcpu)
 #ifdef CONFIG_64BIT
 	vcpu->arch.shadow_epcr |= SPRN_EPCR_ICM;
 #endif
-	vcpu->arch.shadow_msrp = MSRP_UCLEP | MSRP_DEP | MSRP_PMMP;
+	vcpu->arch.shadow_msrp = MSRP_UCLEP | MSRP_PMMP;
 	vcpu->arch.eplc = EPC_EGS | (vcpu->kvm->arch.lpid << EPC_ELPID_SHIFT);
 	vcpu->arch.epsc = vcpu->arch.eplc;