Skip to contentSkip to conversation

KVM: PPC: Make long relocations be ulong

PATCH In review Alexander Graf 2 participants 3 messages Jul 19, 2010 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: PPC: Make long relocations be ulong

On Book3S KVM we directly expose some asm pointers to C code as variables. These need to be relocated and thus break on relocatable kernels.

To make sure we can at least build, let's mark them as long instead of u32 where 64bit relocations don't work.

This fixes the following build error:

WARNING: 2 bad relocations

Quoted 2 lines

c000000000008590 R_PPC64_ADDR32 .text+0x4000000000008460
c000000000008594 R_PPC64_ADDR32 .text+0x4000000000008598

Please keep in mind that actually using KVM on a relocated kernel might still break. This only fixes the compile problem.

---

I'm not sure which tree this should go through. Avi and Ben, please coordinate this.

---
 arch/powerpc/include/asm/kvm_book3s.h |    4 ++--
 arch/powerpc/kvm/book3s_rmhandlers.S  |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
arch/powerpc/include/asm/kvm_book3s.h +2 -2
index b5b1961..b3d763d 100644
@@ -131,8 +131,8 @@ extern void kvmppc_set_bat(struct kvm_vcpu *vcpu, struct kvmppc_bat *bat,
 extern void kvmppc_giveup_ext(struct kvm_vcpu *vcpu, ulong msr);
 extern int kvmppc_emulate_paired_single(struct kvm_run *run, struct kvm_vcpu *vcpu);
 
-extern u32 kvmppc_trampoline_lowmem;
-extern u32 kvmppc_trampoline_enter;
+extern ulong kvmppc_trampoline_lowmem;
+extern ulong kvmppc_trampoline_enter;
 extern void kvmppc_rmcall(ulong srr0, ulong srr1);
 extern void kvmppc_load_up_fpu(void);
 extern void kvmppc_load_up_altivec(void);
arch/powerpc/kvm/book3s_rmhandlers.S +2 -2
index 506d5c3..20eb908 100644
@@ -242,10 +242,10 @@ define_load_up(vsx)
 
 .global kvmppc_trampoline_lowmem
 kvmppc_trampoline_lowmem:
-	.long kvmppc_handler_lowmem_trampoline - CONFIG_KERNEL_START
+	PPC_LONG kvmppc_handler_lowmem_trampoline - CONFIG_KERNEL_START
 
 .global kvmppc_trampoline_enter
 kvmppc_trampoline_enter:
-	.long kvmppc_handler_trampoline_enter - CONFIG_KERNEL_START
+	PPC_LONG kvmppc_handler_trampoline_enter - CONFIG_KERNEL_START
 
 #include "book3s_segment.S"
Signature · 1 line
1.6.0.2
#2 lore raw
In reply to a message not in the archive
Quoted 8 lines · Alexander Graf

I'm not sure which tree this should go through. Avi and Ben, please coordinate this.

---
  arch/powerpc/include/asm/kvm_book3s.h |    4 ++--
  arch/powerpc/kvm/book3s_rmhandlers.S  |    4 ++--
  2 files changed, 4 insertions(+), 4 deletions(-)

The diffstat suggests kvm.git.

Is this broken in Linus' tree, or just kvm.git?

Signature · 1 line
error compiling committee.c: too many arguments to function
#3 lore raw
Quoted 10 lines · Avi Kivity
Quoted 8 lines · Alexander Graf

I'm not sure which tree this should go through. Avi and Ben, please coordinate this.

---
  arch/powerpc/include/asm/kvm_book3s.h |    4 ++--
  arch/powerpc/kvm/book3s_rmhandlers.S  |    4 ++--
  2 files changed, 4 insertions(+), 4 deletions(-)
Quoted 3 lines

The diffstat suggests kvm.git.

Is this broken in Linus' tree, or just kvm.git?

I got the bug report through linuxppc-dev, so I assume it's broken in Linus' tree. In fact, that code has been around for a while already, so it should even be in 2.6.24.

Alex