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

KVM: PPC: Expose magic page support to guest

Now that we have the shared page in place and the MMU code knows about
the magic page, we can expose that capability to the guest!

Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>

authored by

Alexander Graf and committed by
Avi Kivity
5fc87407 e8508940

+13
+2
arch/powerpc/include/asm/kvm_para.h
··· 45 45 #define HC_EV_SUCCESS 0 46 46 #define HC_EV_UNIMPLEMENTED 12 47 47 48 + #define KVM_FEATURE_MAGIC_PAGE 1 49 + 48 50 #ifdef __KERNEL__ 49 51 50 52 #ifdef CONFIG_KVM_GUEST
+11
arch/powerpc/kvm/powerpc.c
··· 61 61 } 62 62 63 63 switch (nr) { 64 + case HC_VENDOR_KVM | KVM_HC_PPC_MAP_MAGIC_PAGE: 65 + { 66 + vcpu->arch.magic_page_pa = param1; 67 + vcpu->arch.magic_page_ea = param2; 68 + 69 + r = HC_EV_SUCCESS; 70 + break; 71 + } 64 72 case HC_VENDOR_KVM | KVM_HC_FEATURES: 65 73 r = HC_EV_SUCCESS; 74 + #if defined(CONFIG_PPC_BOOK3S) /* XXX Missing magic page on BookE */ 75 + r2 |= (1 << KVM_FEATURE_MAGIC_PAGE); 76 + #endif 66 77 67 78 /* Second return value is in r4 */ 68 79 kvmppc_set_gpr(vcpu, 4, r2);