All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add emulation of E500 register mmucsr0
@ 2009-02-17  8:52 Liu Yu
  2009-02-17 20:06 ` Hollis Blanchard
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Liu Yu @ 2009-02-17  8:52 UTC (permalink / raw)
  To: kvm-ppc

Latest kernel flushes TLB via mmucsr0.

Signed-off-by: Liu Yu <yu.liu@freescale.com>
---
 arch/powerpc/kvm/e500_emulate.c |    8 ++++++++
 arch/powerpc/kvm/e500_tlb.c     |   16 ++++++++++++++++
 arch/powerpc/kvm/e500_tlb.h     |    1 +
 3 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kvm/e500_emulate.c b/arch/powerpc/kvm/e500_emulate.c
index 7a98d4a..3f76041 100644
--- a/arch/powerpc/kvm/e500_emulate.c
+++ b/arch/powerpc/kvm/e500_emulate.c
@@ -105,6 +105,11 @@ int kvmppc_core_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs)
 	case SPRN_HID1:
 		vcpu_e500->hid1 = vcpu->arch.gpr[rs]; break;
 
+	case SPRN_MMUCSR0:
+		emulated = kvmppc_e500_emul_mt_mmucsr0(vcpu_e500,
+				vcpu->arch.gpr[rs]);
+		break;
+
 	/* extra exceptions */
 	case SPRN_IVOR32:
 		vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_UNAVAIL] = vcpu->arch.gpr[rs];
@@ -172,6 +177,9 @@ int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt)
 	case SPRN_HID1:
 		vcpu->arch.gpr[rt] = vcpu_e500->hid1; break;
 
+	case SPRN_MMUCSR0:
+		vcpu->arch.gpr[rt] = 0; break;
+
 	/* extra exceptions */
 	case SPRN_IVOR32:
 		vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_UNAVAIL];
diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c
index d437160..72386dd 100644
--- a/arch/powerpc/kvm/e500_tlb.c
+++ b/arch/powerpc/kvm/e500_tlb.c
@@ -391,6 +391,22 @@ static int kvmppc_e500_gtlbe_invalidate(struct kvmppc_vcpu_e500 *vcpu_e500,
 	return 0;
 }
 
+int kvmppc_e500_emul_mt_mmucsr0(struct kvmppc_vcpu_e500 *vcpu_e500, ulong value)
+{
+	int esel;
+
+	if (value & MMUCSR0_TLB0FI)
+		for (esel = 0; esel < vcpu_e500->guest_tlb_size[0]; esel++)
+			kvmppc_e500_gtlbe_invalidate(vcpu_e500, 0, esel);
+	if (value & MMUCSR0_TLB1FI)
+		for (esel = 0; esel < vcpu_e500->guest_tlb_size[1]; esel++)
+			kvmppc_e500_gtlbe_invalidate(vcpu_e500, 1, esel);
+
+	_tlbil_all();
+
+	return EMULATE_DONE;
+}
+
 int kvmppc_e500_emul_tlbivax(struct kvm_vcpu *vcpu, int ra, int rb)
 {
 	struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
diff --git a/arch/powerpc/kvm/e500_tlb.h b/arch/powerpc/kvm/e500_tlb.h
index ab49e93..4d5cc0f 100644
--- a/arch/powerpc/kvm/e500_tlb.h
+++ b/arch/powerpc/kvm/e500_tlb.h
@@ -44,6 +44,7 @@
 	   | E500_TLB_USER_PERM_MASK | E500_TLB_SUPER_PERM_MASK)
 
 extern void kvmppc_dump_tlbs(struct kvm_vcpu *);
+extern int kvmppc_e500_emul_mt_mmucsr0(struct kvmppc_vcpu_e500 *, ulong);
 extern int kvmppc_e500_emul_tlbwe(struct kvm_vcpu *);
 extern int kvmppc_e500_emul_tlbre(struct kvm_vcpu *);
 extern int kvmppc_e500_emul_tlbivax(struct kvm_vcpu *, int, int);
-- 
1.5.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Add emulation of E500 register mmucsr0
  2009-02-17  8:52 [PATCH] Add emulation of E500 register mmucsr0 Liu Yu
@ 2009-02-17 20:06 ` Hollis Blanchard
  2009-02-18  7:24 ` Liu Yu-B13201
  2009-02-23 14:06 ` Avi Kivity
  2 siblings, 0 replies; 4+ messages in thread
From: Hollis Blanchard @ 2009-02-17 20:06 UTC (permalink / raw)
  To: kvm-ppc

Acked-by: Hollis Blanchard <hollisb@us.ibm.com>

Avi, would you apply this?

Yu, I think you should feel free to send e500-specific patches directly
to Avi. If it touches other PowerPC code I'd like to ack first though. I
just don't want to slow you down if you need me to ack every patch...
sound good?

-- 
Hollis Blanchard
IBM Linux Technology Center

On Tue, 2009-02-17 at 16:52 +0800, Liu Yu wrote:
> Latest kernel flushes TLB via mmucsr0.
> 
> Signed-off-by: Liu Yu <yu.liu@freescale.com>
> ---
>  arch/powerpc/kvm/e500_emulate.c |    8 ++++++++
>  arch/powerpc/kvm/e500_tlb.c     |   16 ++++++++++++++++
>  arch/powerpc/kvm/e500_tlb.h     |    1 +
>  3 files changed, 25 insertions(+), 0 deletions(-)
> 
> diff --git a/arch/powerpc/kvm/e500_emulate.c b/arch/powerpc/kvm/e500_emulate.c
> index 7a98d4a..3f76041 100644
> --- a/arch/powerpc/kvm/e500_emulate.c
> +++ b/arch/powerpc/kvm/e500_emulate.c
> @@ -105,6 +105,11 @@ int kvmppc_core_emulate_mtspr(struct kvm_vcpu *vcpu, int sprn, int rs)
>  	case SPRN_HID1:
>  		vcpu_e500->hid1 = vcpu->arch.gpr[rs]; break;
> 
> +	case SPRN_MMUCSR0:
> +		emulated = kvmppc_e500_emul_mt_mmucsr0(vcpu_e500,
> +				vcpu->arch.gpr[rs]);
> +		break;
> +
>  	/* extra exceptions */
>  	case SPRN_IVOR32:
>  		vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_UNAVAIL] = vcpu->arch.gpr[rs];
> @@ -172,6 +177,9 @@ int kvmppc_core_emulate_mfspr(struct kvm_vcpu *vcpu, int sprn, int rt)
>  	case SPRN_HID1:
>  		vcpu->arch.gpr[rt] = vcpu_e500->hid1; break;
> 
> +	case SPRN_MMUCSR0:
> +		vcpu->arch.gpr[rt] = 0; break;
> +
>  	/* extra exceptions */
>  	case SPRN_IVOR32:
>  		vcpu->arch.gpr[rt] = vcpu->arch.ivor[BOOKE_IRQPRIO_SPE_UNAVAIL];
> diff --git a/arch/powerpc/kvm/e500_tlb.c b/arch/powerpc/kvm/e500_tlb.c
> index d437160..72386dd 100644
> --- a/arch/powerpc/kvm/e500_tlb.c
> +++ b/arch/powerpc/kvm/e500_tlb.c
> @@ -391,6 +391,22 @@ static int kvmppc_e500_gtlbe_invalidate(struct kvmppc_vcpu_e500 *vcpu_e500,
>  	return 0;
>  }
> 
> +int kvmppc_e500_emul_mt_mmucsr0(struct kvmppc_vcpu_e500 *vcpu_e500, ulong value)
> +{
> +	int esel;
> +
> +	if (value & MMUCSR0_TLB0FI)
> +		for (esel = 0; esel < vcpu_e500->guest_tlb_size[0]; esel++)
> +			kvmppc_e500_gtlbe_invalidate(vcpu_e500, 0, esel);
> +	if (value & MMUCSR0_TLB1FI)
> +		for (esel = 0; esel < vcpu_e500->guest_tlb_size[1]; esel++)
> +			kvmppc_e500_gtlbe_invalidate(vcpu_e500, 1, esel);
> +
> +	_tlbil_all();
> +
> +	return EMULATE_DONE;
> +}
> +
>  int kvmppc_e500_emul_tlbivax(struct kvm_vcpu *vcpu, int ra, int rb)
>  {
>  	struct kvmppc_vcpu_e500 *vcpu_e500 = to_e500(vcpu);
> diff --git a/arch/powerpc/kvm/e500_tlb.h b/arch/powerpc/kvm/e500_tlb.h
> index ab49e93..4d5cc0f 100644
> --- a/arch/powerpc/kvm/e500_tlb.h
> +++ b/arch/powerpc/kvm/e500_tlb.h
> @@ -44,6 +44,7 @@
>  	   | E500_TLB_USER_PERM_MASK | E500_TLB_SUPER_PERM_MASK)
> 
>  extern void kvmppc_dump_tlbs(struct kvm_vcpu *);
> +extern int kvmppc_e500_emul_mt_mmucsr0(struct kvmppc_vcpu_e500 *, ulong);
>  extern int kvmppc_e500_emul_tlbwe(struct kvm_vcpu *);
>  extern int kvmppc_e500_emul_tlbre(struct kvm_vcpu *);
>  extern int kvmppc_e500_emul_tlbivax(struct kvm_vcpu *, int, int);


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] Add emulation of E500 register mmucsr0
  2009-02-17  8:52 [PATCH] Add emulation of E500 register mmucsr0 Liu Yu
  2009-02-17 20:06 ` Hollis Blanchard
@ 2009-02-18  7:24 ` Liu Yu-B13201
  2009-02-23 14:06 ` Avi Kivity
  2 siblings, 0 replies; 4+ messages in thread
From: Liu Yu-B13201 @ 2009-02-18  7:24 UTC (permalink / raw)
  To: kvm-ppc



> -----Original Message-----
> From: Hollis Blanchard [mailto:hollisb@us.ibm.com] 
> Sent: Wednesday, February 18, 2009 4:07 AM
> To: Avi Kivity
> Cc: kvm-ppc@vger.kernel.org; Liu Yu-B13201
> Subject: Re: [PATCH] Add emulation of E500 register mmucsr0
> 
> Acked-by: Hollis Blanchard <hollisb@us.ibm.com>
> 
> Avi, would you apply this?
> 
> Yu, I think you should feel free to send e500-specific 
> patches directly
> to Avi. If it touches other PowerPC code I'd like to ack 
> first though. I
> just don't want to slow you down if you need me to ack every patch...
> sound good?

OK.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Add emulation of E500 register mmucsr0
  2009-02-17  8:52 [PATCH] Add emulation of E500 register mmucsr0 Liu Yu
  2009-02-17 20:06 ` Hollis Blanchard
  2009-02-18  7:24 ` Liu Yu-B13201
@ 2009-02-23 14:06 ` Avi Kivity
  2 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2009-02-23 14:06 UTC (permalink / raw)
  To: kvm-ppc

Liu Yu wrote:
> Latest kernel flushes TLB via mmucsr0.
>
>   

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-02-23 14:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-17  8:52 [PATCH] Add emulation of E500 register mmucsr0 Liu Yu
2009-02-17 20:06 ` Hollis Blanchard
2009-02-18  7:24 ` Liu Yu-B13201
2009-02-23 14:06 ` Avi Kivity

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.