aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/kvm.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2010-07-29 08:48:00 -0400
committerAvi Kivity <avi@redhat.com>2010-10-24 04:50:53 -0400
commitd1290b15e7f139e24150cc6e6d8e904214359e8a (patch)
treefb0ba6b3248ebedd566c209f3f761826a320c3cf /arch/powerpc/kernel/kvm.c
parentd1293c927568f5b5b8dd3fa263a98683cf8556dc (diff)
KVM: PPC: PV tlbsync to nop
With our current MMU scheme we don't need to know about the tlbsync instruction. So we can just nop it out. Signed-off-by: Alexander Graf <agraf@suse.de> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/powerpc/kernel/kvm.c')
-rw-r--r--arch/powerpc/kernel/kvm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/kvm.c b/arch/powerpc/kernel/kvm.c
index 9ec572c4d2a5..3258922cc22c 100644
--- a/arch/powerpc/kernel/kvm.c
+++ b/arch/powerpc/kernel/kvm.c
@@ -62,6 +62,8 @@
62#define KVM_INST_MTSPR_DAR 0x7c1303a6 62#define KVM_INST_MTSPR_DAR 0x7c1303a6
63#define KVM_INST_MTSPR_DSISR 0x7c1203a6 63#define KVM_INST_MTSPR_DSISR 0x7c1203a6
64 64
65#define KVM_INST_TLBSYNC 0x7c00046c
66
65static bool kvm_patching_worked = true; 67static bool kvm_patching_worked = true;
66 68
67static inline void kvm_patch_ins(u32 *inst, u32 new_inst) 69static inline void kvm_patch_ins(u32 *inst, u32 new_inst)
@@ -98,6 +100,11 @@ static void kvm_patch_ins_stw(u32 *inst, long addr, u32 rt)
98 kvm_patch_ins(inst, KVM_INST_STW | rt | (addr & 0x0000fffc)); 100 kvm_patch_ins(inst, KVM_INST_STW | rt | (addr & 0x0000fffc));
99} 101}
100 102
103static void kvm_patch_ins_nop(u32 *inst)
104{
105 kvm_patch_ins(inst, KVM_INST_NOP);
106}
107
101static void kvm_map_magic_page(void *data) 108static void kvm_map_magic_page(void *data)
102{ 109{
103 kvm_hypercall2(KVM_HC_PPC_MAP_MAGIC_PAGE, 110 kvm_hypercall2(KVM_HC_PPC_MAP_MAGIC_PAGE,
@@ -166,6 +173,11 @@ static void kvm_check_ins(u32 *inst)
166 case KVM_INST_MTSPR_DSISR: 173 case KVM_INST_MTSPR_DSISR:
167 kvm_patch_ins_stw(inst, magic_var(dsisr), inst_rt); 174 kvm_patch_ins_stw(inst, magic_var(dsisr), inst_rt);
168 break; 175 break;
176
177 /* Nops */
178 case KVM_INST_TLBSYNC:
179 kvm_patch_ins_nop(inst);
180 break;
169 } 181 }
170 182
171 switch (_inst) { 183 switch (_inst) {