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

KVM: PPC: Book3S: ifdef on CONFIG_KVM_BOOK3S_32_HANDLER for 32bit

The book3s_32 target can get built as module which means we don't see the
config define for it in code. Instead, check on the bool define
CONFIG_KVM_BOOK3S_32_HANDLER whenever we want to know whether we're building
for a book3s_32 host.

This fixes running book3s_32 kvm as a module for me.

Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

+6 -6
+3 -3
arch/powerpc/kvm/book3s.c
··· 886 886 r = kvm_init(NULL, sizeof(struct kvm_vcpu), 0, THIS_MODULE); 887 887 if (r) 888 888 return r; 889 - #ifdef CONFIG_KVM_BOOK3S_32 889 + #ifdef CONFIG_KVM_BOOK3S_32_HANDLER 890 890 r = kvmppc_book3s_init_pr(); 891 891 #endif 892 892 return r; ··· 895 895 896 896 static void kvmppc_book3s_exit(void) 897 897 { 898 - #ifdef CONFIG_KVM_BOOK3S_32 898 + #ifdef CONFIG_KVM_BOOK3S_32_HANDLER 899 899 kvmppc_book3s_exit_pr(); 900 900 #endif 901 901 kvm_exit(); ··· 905 905 module_exit(kvmppc_book3s_exit); 906 906 907 907 /* On 32bit this is our one and only kernel module */ 908 - #ifdef CONFIG_KVM_BOOK3S_32 908 + #ifdef CONFIG_KVM_BOOK3S_32_HANDLER 909 909 MODULE_ALIAS_MISCDEV(KVM_MINOR); 910 910 MODULE_ALIAS("devname:kvm"); 911 911 #endif
+3 -3
arch/powerpc/kvm/book3s_pr.c
··· 1153 1153 goto free_vcpu; 1154 1154 vcpu->arch.book3s = vcpu_book3s; 1155 1155 1156 - #ifdef CONFIG_KVM_BOOK3S_32 1156 + #ifdef CONFIG_KVM_BOOK3S_32_HANDLER 1157 1157 vcpu->arch.shadow_vcpu = 1158 1158 kzalloc(sizeof(*vcpu->arch.shadow_vcpu), GFP_KERNEL); 1159 1159 if (!vcpu->arch.shadow_vcpu) ··· 1198 1198 uninit_vcpu: 1199 1199 kvm_vcpu_uninit(vcpu); 1200 1200 free_shadow_vcpu: 1201 - #ifdef CONFIG_KVM_BOOK3S_32 1201 + #ifdef CONFIG_KVM_BOOK3S_32_HANDLER 1202 1202 kfree(vcpu->arch.shadow_vcpu); 1203 1203 free_vcpu3s: 1204 1204 #endif ··· 1215 1215 1216 1216 free_page((unsigned long)vcpu->arch.shared & PAGE_MASK); 1217 1217 kvm_vcpu_uninit(vcpu); 1218 - #ifdef CONFIG_KVM_BOOK3S_32 1218 + #ifdef CONFIG_KVM_BOOK3S_32_HANDLER 1219 1219 kfree(vcpu->arch.shadow_vcpu); 1220 1220 #endif 1221 1221 vfree(vcpu_book3s);