diff options
author | Alexander Graf <agraf@suse.de> | 2011-06-07 14:45:34 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-07-12 06:16:29 -0400 |
commit | a22a2daccfa3ade5cdd9ef1e8a05cf1e6ffca42b (patch) | |
tree | 70b14bb0f62fb61569d3f1e89edce9ac01b6cd27 /arch/powerpc/kvm | |
parent | 24294b9a3fbe00289c039fb3e80087be66b8c415 (diff) |
KVM: PPC: Resolve real-mode handlers through function exports
Up until now, Book3S KVM had variables stored in the kernel that a kernel module
or the kvm code in the kernel could read from to figure out where some real mode
helper functions are located.
This is all unnecessary. The high bits of the EA get ignore in real mode, so we
can just use the pointer as is. Also, it's a lot easier on relocations when we
use the normal way of resolving the address to a function, instead of jumping
through hoops.
This patch fixes compilation with CONFIG_RELOCATABLE=y.
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r-- | arch/powerpc/kvm/book3s.c | 4 | ||||
-rw-r--r-- | arch/powerpc/kvm/book3s_exports.c | 4 | ||||
-rw-r--r-- | arch/powerpc/kvm/book3s_rmhandlers.S | 8 |
3 files changed, 4 insertions, 12 deletions
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index 0f95b5cce033..73fdab8a567f 100644 --- a/arch/powerpc/kvm/book3s.c +++ b/arch/powerpc/kvm/book3s.c | |||
@@ -1342,8 +1342,8 @@ struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm, unsigned int id) | |||
1342 | vcpu_book3s->slb_nr = 64; | 1342 | vcpu_book3s->slb_nr = 64; |
1343 | 1343 | ||
1344 | /* remember where some real-mode handlers are */ | 1344 | /* remember where some real-mode handlers are */ |
1345 | vcpu->arch.trampoline_lowmem = kvmppc_trampoline_lowmem; | 1345 | vcpu->arch.trampoline_lowmem = (ulong)kvmppc_handler_lowmem_trampoline; |
1346 | vcpu->arch.trampoline_enter = kvmppc_trampoline_enter; | 1346 | vcpu->arch.trampoline_enter = (ulong)kvmppc_handler_trampoline_enter; |
1347 | vcpu->arch.highmem_handler = (ulong)kvmppc_handler_highmem; | 1347 | vcpu->arch.highmem_handler = (ulong)kvmppc_handler_highmem; |
1348 | #ifdef CONFIG_PPC_BOOK3S_64 | 1348 | #ifdef CONFIG_PPC_BOOK3S_64 |
1349 | vcpu->arch.rmcall = *(ulong*)kvmppc_rmcall; | 1349 | vcpu->arch.rmcall = *(ulong*)kvmppc_rmcall; |
diff --git a/arch/powerpc/kvm/book3s_exports.c b/arch/powerpc/kvm/book3s_exports.c index 1dd5a1ddfd0d..f94fd9a4c69a 100644 --- a/arch/powerpc/kvm/book3s_exports.c +++ b/arch/powerpc/kvm/book3s_exports.c | |||
@@ -20,8 +20,8 @@ | |||
20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
21 | #include <asm/kvm_book3s.h> | 21 | #include <asm/kvm_book3s.h> |
22 | 22 | ||
23 | EXPORT_SYMBOL_GPL(kvmppc_trampoline_enter); | 23 | EXPORT_SYMBOL_GPL(kvmppc_handler_trampoline_enter); |
24 | EXPORT_SYMBOL_GPL(kvmppc_trampoline_lowmem); | 24 | EXPORT_SYMBOL_GPL(kvmppc_handler_lowmem_trampoline); |
25 | EXPORT_SYMBOL_GPL(kvmppc_rmcall); | 25 | EXPORT_SYMBOL_GPL(kvmppc_rmcall); |
26 | EXPORT_SYMBOL_GPL(kvmppc_load_up_fpu); | 26 | EXPORT_SYMBOL_GPL(kvmppc_load_up_fpu); |
27 | #ifdef CONFIG_ALTIVEC | 27 | #ifdef CONFIG_ALTIVEC |
diff --git a/arch/powerpc/kvm/book3s_rmhandlers.S b/arch/powerpc/kvm/book3s_rmhandlers.S index 1a1b34487e71..5f5d07475c91 100644 --- a/arch/powerpc/kvm/book3s_rmhandlers.S +++ b/arch/powerpc/kvm/book3s_rmhandlers.S | |||
@@ -251,12 +251,4 @@ define_load_up(altivec) | |||
251 | define_load_up(vsx) | 251 | define_load_up(vsx) |
252 | #endif | 252 | #endif |
253 | 253 | ||
254 | .global kvmppc_trampoline_lowmem | ||
255 | kvmppc_trampoline_lowmem: | ||
256 | PPC_LONG kvmppc_handler_lowmem_trampoline - CONFIG_KERNEL_START | ||
257 | |||
258 | .global kvmppc_trampoline_enter | ||
259 | kvmppc_trampoline_enter: | ||
260 | PPC_LONG kvmppc_handler_trampoline_enter - CONFIG_KERNEL_START | ||
261 | |||
262 | #include "book3s_segment.S" | 254 | #include "book3s_segment.S" |