Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2011-09-14 01:16:42 +0200
committerAlexander Graf <agraf@suse.de>2011-09-14 01:18:20 +0200
commitfe60c70be2a0dd9b4239837753fda593ad82e1a4 (patch)
tree105e957a8b736c5bd37af3f167a4b3eaa6581b20
parentbfd10a024bb3bea39416bea8d5067ce7853d18cc (diff)
KVM: PPC: Assemble book3s{,_hv}_rmhandlers.S separately
When building KVM HV mode with plenty other options enabled, the build fails. That's fixed upstream, but 3.1-rc5 doesn't have the patch yet. So I pulled it in from the kvm tree.
-rw-r--r--patches.arch/ppc-kvm-fix-big-section.patch110
-rw-r--r--series.conf1
2 files changed, 111 insertions, 0 deletions
diff --git a/patches.arch/ppc-kvm-fix-big-section.patch b/patches.arch/ppc-kvm-fix-big-section.patch
new file mode 100644
index 0000000000..8cfebb6fb8
--- /dev/null
+++ b/patches.arch/ppc-kvm-fix-big-section.patch
@@ -0,0 +1,110 @@
+From: Paul Mackerras <paulus@samba.org>
+Date: Sat, 23 Jul 2011 17:41:11 +1000
+Subject: KVM: PPC: Assemble book3s{,_hv}_rmhandlers.S separately
+Patch-Mainline: b4bff997e9049231bb24fb813be39172fb8b3e03
+
+This makes arch/powerpc/kvm/book3s_rmhandlers.S and
+arch/powerpc/kvm/book3s_hv_rmhandlers.S be assembled as
+separate compilation units rather than having them #included in
+arch/powerpc/kernel/exceptions-64s.S. We no longer have any
+conditional branches between the exception prologs in
+exceptions-64s.S and the KVM handlers, so there is no need to
+keep their contents close together in the vmlinux image.
+
+In their current location, they are using up part of the limited
+space between the first-level interrupt handlers and the firmware
+NMI data area at offset 0x7000, and with some kernel configurations
+this area will overflow (e.g. allyesconfig), leading to an
+"attempt to .org backwards" error when compiling exceptions-64s.S.
+
+Moving them out requires that we add some #includes that the
+book3s_{,hv_}rmhandlers.S code was previously getting implicitly
+via exceptions-64s.S.
+
+Signed-off-by: Paul Mackerras <paulus@samba.org>
+Signed-off-by: Alexander Graf <agraf@suse.de>
+
+diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
+index 41b02c7..29ddd8b 100644
+--- a/arch/powerpc/kernel/exceptions-64s.S
++++ b/arch/powerpc/kernel/exceptions-64s.S
+@@ -427,16 +427,6 @@ slb_miss_user_pseries:
+ b . /* prevent spec. execution */
+ #endif /* __DISABLED__ */
+
+-/* KVM's trampoline code needs to be close to the interrupt handlers */
+-
+-#ifdef CONFIG_KVM_BOOK3S_64_HANDLER
+-#ifdef CONFIG_KVM_BOOK3S_PR
+-#include "../kvm/book3s_rmhandlers.S"
+-#else
+-#include "../kvm/book3s_hv_rmhandlers.S"
+-#endif
+-#endif
+-
+ .align 7
+ .globl __end_interrupts
+ __end_interrupts:
+diff --git a/arch/powerpc/kvm/Makefile b/arch/powerpc/kvm/Makefile
+index 4c66d51..3688aee 100644
+--- a/arch/powerpc/kvm/Makefile
++++ b/arch/powerpc/kvm/Makefile
+@@ -50,12 +50,15 @@ kvm-book3s_64-objs-$(CONFIG_KVM_BOOK3S_64_PR) := \
+ book3s_64_mmu_host.o \
+ book3s_64_mmu.o \
+ book3s_32_mmu.o
++kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_PR) := \
++ book3s_rmhandlers.o
+
+ kvm-book3s_64-objs-$(CONFIG_KVM_BOOK3S_64_HV) := \
+ book3s_hv.o \
+ book3s_hv_interrupts.o \
+ book3s_64_mmu_hv.o
+ kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HV) := \
++ book3s_hv_rmhandlers.o \
+ book3s_hv_rm_mmu.o \
+ book3s_64_vio_hv.o \
+ book3s_hv_builtin.o
+diff --git a/arch/powerpc/kvm/book3s_hv_rmhandlers.S b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+index 6dd3358..543ee50 100644
+--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
++++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+@@ -20,7 +20,10 @@
+ #include <asm/ppc_asm.h>
+ #include <asm/kvm_asm.h>
+ #include <asm/reg.h>
++#include <asm/mmu.h>
+ #include <asm/page.h>
++#include <asm/ptrace.h>
++#include <asm/hvcall.h>
+ #include <asm/asm-offsets.h>
+ #include <asm/exception-64s.h>
+
+diff --git a/arch/powerpc/kvm/book3s_rmhandlers.S b/arch/powerpc/kvm/book3s_rmhandlers.S
+index c1f877c..5ee66ed 100644
+--- a/arch/powerpc/kvm/book3s_rmhandlers.S
++++ b/arch/powerpc/kvm/book3s_rmhandlers.S
+@@ -20,6 +20,7 @@
+ #include <asm/ppc_asm.h>
+ #include <asm/kvm_asm.h>
+ #include <asm/reg.h>
++#include <asm/mmu.h>
+ #include <asm/page.h>
+ #include <asm/asm-offsets.h>
+
+@@ -39,6 +40,7 @@
+ #define MSR_NOIRQ MSR_KERNEL & ~(MSR_IR | MSR_DR)
+ #define FUNC(name) GLUE(.,name)
+
++ .globl kvmppc_skip_interrupt
+ kvmppc_skip_interrupt:
+ /*
+ * Here all GPRs are unchanged from when the interrupt happened
+@@ -51,6 +53,7 @@ kvmppc_skip_interrupt:
+ rfid
+ b .
+
++ .globl kvmppc_skip_Hinterrupt
+ kvmppc_skip_Hinterrupt:
+ /*
+ * Here all GPRs are unchanged from when the interrupt happened
diff --git a/series.conf b/series.conf
index 3bb2def91c..b95193bf50 100644
--- a/series.conf
+++ b/series.conf
@@ -148,6 +148,7 @@
patches.arch/ppc64-xmon-dmesg-printing.patch
patches.arch/ppc-prom-nodisplay.patch
patches.fixes/ptrace-getsiginfo
+ patches.arch/ppc-kvm-fix-big-section.patch
########################################################
# PS3