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

KVM: PPC: Book 3S: Fix compilation for !HV configs

Commits 2f5cdd5487 ("KVM: PPC: Book3S HV: Make secondary threads more
robust against stray IPIs") and 1c2066b0f7 ("KVM: PPC: Book3S HV: Make
virtual processor area registration more robust") added fields to
struct kvm_vcpu_arch inside #ifdef CONFIG_KVM_BOOK3S_64_HV regions,
and added lines to arch/powerpc/kernel/asm-offsets.c to generate
assembler constants for their offsets. Unfortunately this led to
compile errors on Book 3S machines for configs that had KVM enabled
but not CONFIG_KVM_BOOK3S_64_HV. This fixes the problem by moving
the offending lines inside #ifdef CONFIG_KVM_BOOK3S_64_HV regions.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Avi Kivity <avi@redhat.com>

authored by

Paul Mackerras and committed by
Avi Kivity
7657f408 c0fe7b09

+3 -3
+3 -3
arch/powerpc/kernel/asm-offsets.c
··· 450 450 DEFINE(KVM_VRMA_SLB_V, offsetof(struct kvm, arch.vrma_slb_v)); 451 451 DEFINE(VCPU_DSISR, offsetof(struct kvm_vcpu, arch.shregs.dsisr)); 452 452 DEFINE(VCPU_DAR, offsetof(struct kvm_vcpu, arch.shregs.dar)); 453 + DEFINE(VCPU_VPA, offsetof(struct kvm_vcpu, arch.vpa.pinned_addr)); 453 454 #endif 454 455 #ifdef CONFIG_PPC_BOOK3S 455 456 DEFINE(VCPU_VCPUID, offsetof(struct kvm_vcpu, vcpu_id)); ··· 467 466 DEFINE(VCPU_PENDING_EXC, offsetof(struct kvm_vcpu, arch.pending_exceptions)); 468 467 DEFINE(VCPU_CEDED, offsetof(struct kvm_vcpu, arch.ceded)); 469 468 DEFINE(VCPU_PRODDED, offsetof(struct kvm_vcpu, arch.prodded)); 470 - DEFINE(VCPU_VPA, offsetof(struct kvm_vcpu, arch.vpa.pinned_addr)); 471 469 DEFINE(VCPU_MMCR, offsetof(struct kvm_vcpu, arch.mmcr)); 472 470 DEFINE(VCPU_PMC, offsetof(struct kvm_vcpu, arch.pmc)); 473 471 DEFINE(VCPU_SLB, offsetof(struct kvm_vcpu, arch.slb)); ··· 540 540 HSTATE_FIELD(HSTATE_IN_GUEST, in_guest); 541 541 HSTATE_FIELD(HSTATE_RESTORE_HID5, restore_hid5); 542 542 HSTATE_FIELD(HSTATE_NAPPING, napping); 543 - HSTATE_FIELD(HSTATE_HWTHREAD_REQ, hwthread_req); 544 - HSTATE_FIELD(HSTATE_HWTHREAD_STATE, hwthread_state); 545 543 546 544 #ifdef CONFIG_KVM_BOOK3S_64_HV 545 + HSTATE_FIELD(HSTATE_HWTHREAD_REQ, hwthread_req); 546 + HSTATE_FIELD(HSTATE_HWTHREAD_STATE, hwthread_state); 547 547 HSTATE_FIELD(HSTATE_KVM_VCPU, kvm_vcpu); 548 548 HSTATE_FIELD(HSTATE_KVM_VCORE, kvm_vcore); 549 549 HSTATE_FIELD(HSTATE_XICS_PHYS, xics_phys);