From: Alex Shi Date: Thu, 17 Nov 2016 06:14:11 +0000 (+0800) Subject: Merge branch 'v4.4/topic/hibernate' into linux-linaro-lsk-v4.4 X-Git-Tag: firefly_0821_release~176^2~4^2~16 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=03263ac9903481c204624cf2ed2fbbc8a1150a3a;p=firefly-linux-kernel-4.4.55.git Merge branch 'v4.4/topic/hibernate' into linux-linaro-lsk-v4.4 Conflicts: arch/arm64/include/asm/kvm_asm.h arch/arm64/include/asm/memory.h arch/arm64/kernel/head.S arch/arm64/kvm/hyp.S --- 03263ac9903481c204624cf2ed2fbbc8a1150a3a diff --cc arch/arm64/include/asm/kvm_asm.h index 054ac25e7c2e,fca51486cd37..36a30c80032d --- a/arch/arm64/include/asm/kvm_asm.h +++ b/arch/arm64/include/asm/kvm_asm.h @@@ -26,9 -28,24 +28,24 @@@ #define KVM_ARM64_DEBUG_DIRTY_SHIFT 0 #define KVM_ARM64_DEBUG_DIRTY (1 << KVM_ARM64_DEBUG_DIRTY_SHIFT) -#define kvm_ksym_ref(sym) ((void *)&sym + kvm_ksym_shift) +#define kvm_ksym_ref(sym) phys_to_virt((u64)&sym - kimage_voffset) #ifndef __ASSEMBLY__ + #if __GNUC__ > 4 + #define kvm_ksym_shift (PAGE_OFFSET - KIMAGE_VADDR) + #else + /* + * GCC versions 4.9 and older will fold the constant below into the addend of + * the reference to 'sym' above if kvm_ksym_shift is declared static or if the + * constant is used directly. However, since we use the small code model for + * the core kernel, the reference to 'sym' will be emitted as a adrp/add pair, + * with a +/- 4 GB range, resulting in linker relocation errors if the shift + * is sufficiently large. So prevent the compiler from folding the shift into + * the addend, by making the shift a variable with external linkage. + */ + __weak u64 kvm_ksym_shift = PAGE_OFFSET - KIMAGE_VADDR; + #endif + struct kvm; struct kvm_vcpu;