From: Avi Kivity <avi@redhat.com>
To: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 22/30] KVM: ppc: Add emulation of E500 register mmucsr0
Date: Sat, 28 Feb 2009 03:41:41 +0200 [thread overview]
Message-ID: <1235785309-12835-23-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1235785309-12835-1-git-send-email-avi@redhat.com>
From: Liu Yu <yu.liu@freescale.com>
Latest kernel flushes TLB via mmucsr0.
Signed-off-by: Liu Yu <yu.liu@freescale.com>
Acked-by: Hollis Blanchard <hollisb@us.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.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.6.0.6
next prev parent reply other threads:[~2009-02-28 1:49 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-28 1:41 [PATCH 00/30] KVM Updates for the 2.6.30 merge window (3/3) Avi Kivity
2009-02-28 1:41 ` [PATCH 01/30] KVM: ia64: vTLB change for enabling windows 2008 boot Avi Kivity
2009-02-28 1:41 ` [PATCH 02/30] KVM: ia64: Add the support for translating PAL Call's pointer args Avi Kivity
2009-02-28 1:41 ` [PATCH 03/30] KVM: ia64: Implement some pal calls needed for windows 2008 Avi Kivity
2009-02-28 1:41 ` [PATCH 04/30] KVM: s390: Fix printk on SIGP set arch Avi Kivity
2009-02-28 1:41 ` [PATCH 05/30] KVM: s390: Fix problem state check for b2 intercepts Avi Kivity
2009-02-28 1:41 ` [PATCH 06/30] KVM: s390: Fix SIGP set prefix ioctl Avi Kivity
2009-02-28 1:41 ` [PATCH 07/30] KVM: ia64: dynamic nr online cpus Avi Kivity
2009-02-28 1:41 ` [PATCH 08/30] KVM: make irq ack notifications aware of routing table Avi Kivity
2009-02-28 1:41 ` [PATCH 09/30] x86: Add EFER descriptions for FFXSR Avi Kivity
2009-02-28 1:41 ` [PATCH 10/30] KVM: Add FFXSR support Avi Kivity
2009-02-28 1:41 ` [PATCH 11/30] KVM: Drop unused evaluations from string pio handlers Avi Kivity
2009-02-28 1:41 ` [PATCH 12/30] KVM: Use irq routing API for MSI Avi Kivity
2009-02-28 1:41 ` [PATCH 13/30] KVM: VMX: Use kvm_mmu_page_fault() handle EPT violation mmio Avi Kivity
2009-02-28 1:41 ` [PATCH 14/30] KVM: Fix kvmclock on !constant_tsc boxes Avi Kivity
2009-02-28 1:41 ` [PATCH 15/30] KVM: MMU: handle compound pages in kvm_is_mmio_pfn Avi Kivity
2009-02-28 1:41 ` [PATCH 16/30] KVM: MMU: remove redundant check in mmu_set_spte Avi Kivity
2009-02-28 1:41 ` [PATCH 17/30] KVM: MMU: remove assertion in kvm_mmu_alloc_page Avi Kivity
2009-02-28 1:41 ` [PATCH 18/30] KVM: Report IRQ injection status to userspace Avi Kivity
2009-02-28 1:41 ` [PATCH 19/30] KVM: SVM: set accessed bit for VMCB segment selectors Avi Kivity
2009-02-28 1:41 ` [PATCH 20/30] KVM: MMU: Fix another largepage memory leak Avi Kivity
2009-02-28 1:41 ` [PATCH 21/30] KVM: Report IRQ injection status for MSI delivered interrupts Avi Kivity
2009-02-28 1:41 ` Avi Kivity [this message]
2009-02-28 1:41 ` [PATCH 23/30] KVM: define KVM_CAP_DEVICE_DEASSIGNMENT Avi Kivity
2009-02-28 1:41 ` [PATCH 24/30] KVM: fix kvm_vm_ioctl_deassign_device Avi Kivity
2009-02-28 1:41 ` [PATCH 25/30] ia64: Move the macro definitions related to MSI to one header file Avi Kivity
2009-02-28 1:41 ` [PATCH 26/30] KVM: ia64: Fix the build errors due to lack of macros related to MSI Avi Kivity
2009-02-28 1:41 ` [PATCH 27/30] KVM: VMX: Update necessary state when guest enters long mode Avi Kivity
2009-02-28 1:41 ` [PATCH 28/30] KVM: is_long_mode() should check for EFER.LMA Avi Kivity
2009-02-28 1:41 ` [PATCH 29/30] KVM: fix sparse warnings: context imbalance Avi Kivity
2009-02-28 1:41 ` [PATCH 30/30] KVM: fix sparse warnings: Should it be static? Avi Kivity
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1235785309-12835-23-git-send-email-avi@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome