diff options
author | Alexander Graf <agraf@suse.de> | 2014-07-30 09:25:48 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2014-07-30 09:25:49 -0400 |
commit | 29577fc00ba40a89fc824f030bcc80c583259346 (patch) | |
tree | 04a4dc718f000e3b06388344250554110350bd3c | |
parent | 5a484c7c1efd2c45f8cc726e4d21283a5324e361 (diff) |
KVM: PPC: HV: Remove generic instruction emulation
Now that we have properly split load/store instruction emulation and generic
instruction emulation, we can move the generic one from kvm.ko to kvm-pr.ko
on book3s_64.
This reduces the attack surface and amount of code loaded on HV KVM kernels.
Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r-- | arch/powerpc/kvm/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/kvm/trace_pr.h | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/Makefile b/arch/powerpc/kvm/Makefile index 1ccd7a1a441c..2d590dea5482 100644 --- a/arch/powerpc/kvm/Makefile +++ b/arch/powerpc/kvm/Makefile | |||
@@ -48,6 +48,7 @@ kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HANDLER) := \ | |||
48 | 48 | ||
49 | kvm-pr-y := \ | 49 | kvm-pr-y := \ |
50 | fpu.o \ | 50 | fpu.o \ |
51 | emulate.o \ | ||
51 | book3s_paired_singles.o \ | 52 | book3s_paired_singles.o \ |
52 | book3s_pr.o \ | 53 | book3s_pr.o \ |
53 | book3s_pr_papr.o \ | 54 | book3s_pr_papr.o \ |
@@ -91,7 +92,6 @@ kvm-book3s_64-module-objs += \ | |||
91 | $(KVM)/kvm_main.o \ | 92 | $(KVM)/kvm_main.o \ |
92 | $(KVM)/eventfd.o \ | 93 | $(KVM)/eventfd.o \ |
93 | powerpc.o \ | 94 | powerpc.o \ |
94 | emulate.o \ | ||
95 | emulate_loadstore.o \ | 95 | emulate_loadstore.o \ |
96 | book3s.o \ | 96 | book3s.o \ |
97 | book3s_64_vio.o \ | 97 | book3s_64_vio.o \ |
diff --git a/arch/powerpc/kvm/trace_pr.h b/arch/powerpc/kvm/trace_pr.h index e1357cd8dc1f..a674f090dfb8 100644 --- a/arch/powerpc/kvm/trace_pr.h +++ b/arch/powerpc/kvm/trace_pr.h | |||
@@ -291,6 +291,26 @@ TRACE_EVENT(kvm_unmap_hva, | |||
291 | TP_printk("unmap hva 0x%lx\n", __entry->hva) | 291 | TP_printk("unmap hva 0x%lx\n", __entry->hva) |
292 | ); | 292 | ); |
293 | 293 | ||
294 | TRACE_EVENT(kvm_ppc_instr, | ||
295 | TP_PROTO(unsigned int inst, unsigned long _pc, unsigned int emulate), | ||
296 | TP_ARGS(inst, _pc, emulate), | ||
297 | |||
298 | TP_STRUCT__entry( | ||
299 | __field( unsigned int, inst ) | ||
300 | __field( unsigned long, pc ) | ||
301 | __field( unsigned int, emulate ) | ||
302 | ), | ||
303 | |||
304 | TP_fast_assign( | ||
305 | __entry->inst = inst; | ||
306 | __entry->pc = _pc; | ||
307 | __entry->emulate = emulate; | ||
308 | ), | ||
309 | |||
310 | TP_printk("inst %u pc 0x%lx emulate %u\n", | ||
311 | __entry->inst, __entry->pc, __entry->emulate) | ||
312 | ); | ||
313 | |||
294 | #endif /* _TRACE_KVM_H */ | 314 | #endif /* _TRACE_KVM_H */ |
295 | 315 | ||
296 | /* This part must be outside protection */ | 316 | /* This part must be outside protection */ |