summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/kvm_e500.h
diff options
context:
space:
mode:
authorLiu Yu <yu.liu@freescale.com>2011-06-14 18:35:14 -0500
committerAvi Kivity <avi@redhat.com>2011-07-12 13:16:39 +0300
commitdd9ebf1f94354b010f2ac7a98bf69168636cb08e (patch)
treed7a6cbe2b31cd7349913d289b715fa1086ba0a1a /arch/powerpc/include/asm/kvm_e500.h
parent08b7fa92b9250eab0f493f7721977e781a887b3d (diff)
downloadblackbird-op-linux-dd9ebf1f94354b010f2ac7a98bf69168636cb08e.tar.gz
blackbird-op-linux-dd9ebf1f94354b010f2ac7a98bf69168636cb08e.zip
KVM: PPC: e500: Add shadow PID support
Dynamically assign host PIDs to guest PIDs, splitting each guest PID into multiple host (shadow) PIDs based on kernel/user and MSR[IS/DS]. Use both PID0 and PID1 so that the shadow PIDs for the right mode can be selected, that correspond both to guest TID = zero and guest TID = guest PID. This allows us to significantly reduce the frequency of needing to invalidate the entire TLB. When the guest mode or PID changes, we just update the host PID0/PID1. And since the allocation of shadow PIDs is global, multiple guests can share the TLB without conflict. Note that KVM does not yet support the guest setting PID1 or PID2 to a value other than zero. This will need to be fixed for nested KVM to work. Until then, we enforce the requirement for guest PID1/PID2 to stay zero by failing the emulation if the guest tries to set them to something else. Signed-off-by: Liu Yu <yu.liu@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/include/asm/kvm_e500.h')
-rw-r--r--arch/powerpc/include/asm/kvm_e500.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/kvm_e500.h b/arch/powerpc/include/asm/kvm_e500.h
index 4a6d77a8b8a0..adbfca9dd100 100644
--- a/arch/powerpc/include/asm/kvm_e500.h
+++ b/arch/powerpc/include/asm/kvm_e500.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Freescale Semiconductor, Inc. All rights reserved.
+ * Copyright (C) 2008-2011 Freescale Semiconductor, Inc. All rights reserved.
*
* Author: Yu Liu, <yu.liu@freescale.com>
*
@@ -37,6 +37,8 @@ struct tlbe_priv {
unsigned int flags; /* E500_TLB_* */
};
+struct vcpu_id_table;
+
struct kvmppc_vcpu_e500 {
/* Unmodified copy of the guest's TLB. */
struct tlbe *gtlb_arch[E500_TLB_NUM];
@@ -59,6 +61,10 @@ struct kvmppc_vcpu_e500 {
u32 mas5;
u32 mas6;
u32 mas7;
+
+ /* vcpu id table */
+ struct vcpu_id_table *idt;
+
u32 l1csr0;
u32 l1csr1;
u32 hid0;
OpenPOWER on IntegriCloud