linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: PPC: Make long relocations be ulong
@ 2010-07-19 14:54 Alexander Graf
  2010-07-19 15:30 ` Avi Kivity
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Graf @ 2010-07-19 14:54 UTC (permalink / raw)
  To: kvm-ppc; +Cc: Linuxppc-dev, subrata, kvm

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
> 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.

Reported-by: Subrata Modak <subrata@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>

---

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(-)

diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h
index b5b1961..b3d763d 100644
--- a/arch/powerpc/include/asm/kvm_book3s.h
+++ b/arch/powerpc/include/asm/kvm_book3s.h
@@ -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);
diff --git a/arch/powerpc/kvm/book3s_rmhandlers.S b/arch/powerpc/kvm/book3s_rmhandlers.S
index 506d5c3..20eb908 100644
--- a/arch/powerpc/kvm/book3s_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_rmhandlers.S
@@ -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"
-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: PPC: Make long relocations be ulong
  2010-07-19 14:54 [PATCH] KVM: PPC: Make long relocations be ulong Alexander Graf
@ 2010-07-19 15:30 ` Avi Kivity
  2010-07-19 15:33   ` Alexander Graf
  0 siblings, 1 reply; 3+ messages in thread
From: Avi Kivity @ 2010-07-19 15:30 UTC (permalink / raw)
  To: Alexander Graf; +Cc: Linuxppc-dev, subrata, kvm, kvm-ppc

On 07/19/2010 05:54 PM, Alexander Graf wrote:
> 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?

-- 
error compiling committee.c: too many arguments to function

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: PPC: Make long relocations be ulong
  2010-07-19 15:30 ` Avi Kivity
@ 2010-07-19 15:33   ` Alexander Graf
  0 siblings, 0 replies; 3+ messages in thread
From: Alexander Graf @ 2010-07-19 15:33 UTC (permalink / raw)
  To: Avi Kivity; +Cc: Linuxppc-dev, subrata, kvm, kvm-ppc

Avi Kivity wrote:
> On 07/19/2010 05:54 PM, Alexander Graf wrote:
>> 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?

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-19 15:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-19 14:54 [PATCH] KVM: PPC: Make long relocations be ulong Alexander Graf
2010-07-19 15:30 ` Avi Kivity
2010-07-19 15:33   ` Alexander Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).