Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+21 -1
+1 -1
arch/powerpc/kvm/Makefile
··· 48 48 49 49 kvm-pr-y := \ 50 50 fpu.o \ 51 + emulate.o \ 51 52 book3s_paired_singles.o \ 52 53 book3s_pr.o \ 53 54 book3s_pr_papr.o \ ··· 92 91 $(KVM)/kvm_main.o \ 93 92 $(KVM)/eventfd.o \ 94 93 powerpc.o \ 95 - emulate.o \ 96 94 emulate_loadstore.o \ 97 95 book3s.o \ 98 96 book3s_64_vio.o \
+20
arch/powerpc/kvm/trace_pr.h
··· 291 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 314 #endif /* _TRACE_KVM_H */ 295 315 296 316 /* This part must be outside protection */