aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ppc64/kernel/ItLpQueue.c22
-rw-r--r--arch/ppc64/kernel/iSeries_setup.c21
-rw-r--r--include/asm-ppc64/iSeries/ItLpQueue.h1
3 files changed, 24 insertions, 20 deletions
diff --git a/arch/ppc64/kernel/ItLpQueue.c b/arch/ppc64/kernel/ItLpQueue.c
index 35f6deac0b99..091aaed4842c 100644
--- a/arch/ppc64/kernel/ItLpQueue.c
+++ b/arch/ppc64/kernel/ItLpQueue.c
@@ -11,6 +11,7 @@
11#include <linux/stddef.h> 11#include <linux/stddef.h>
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/sched.h> 13#include <linux/sched.h>
14#include <linux/bootmem.h>
14#include <asm/system.h> 15#include <asm/system.h>
15#include <asm/paca.h> 16#include <asm/paca.h>
16#include <asm/iSeries/ItLpQueue.h> 17#include <asm/iSeries/ItLpQueue.h>
@@ -186,3 +187,24 @@ static int set_spread_lpevents(char *str)
186} 187}
187__setup("spread_lpevents=", set_spread_lpevents); 188__setup("spread_lpevents=", set_spread_lpevents);
188 189
190void setup_hvlpevent_queue(void)
191{
192 void *eventStack;
193
194 /*
195 * Allocate a page for the Event Stack. The Hypervisor needs the
196 * absolute real address, so we subtract out the KERNELBASE and add
197 * in the absolute real address of the kernel load area.
198 */
199 eventStack = alloc_bootmem_pages(LpEventStackSize);
200 memset(eventStack, 0, LpEventStackSize);
201
202 /* Invoke the hypervisor to initialize the event stack */
203 HvCallEvent_setLpEventStack(0, eventStack, LpEventStackSize);
204
205 xItLpQueue.xSlicEventStackPtr = (char *)eventStack;
206 xItLpQueue.xSlicCurEventPtr = (char *)eventStack;
207 xItLpQueue.xSlicLastValidEventPtr = (char *)eventStack +
208 (LpEventStackSize - LpEventMaxSize);
209 xItLpQueue.xIndex = 0;
210}
diff --git a/arch/ppc64/kernel/iSeries_setup.c b/arch/ppc64/kernel/iSeries_setup.c
index 78f283560252..b3f770f6d402 100644
--- a/arch/ppc64/kernel/iSeries_setup.c
+++ b/arch/ppc64/kernel/iSeries_setup.c
@@ -24,7 +24,6 @@
24#include <linux/smp.h> 24#include <linux/smp.h>
25#include <linux/param.h> 25#include <linux/param.h>
26#include <linux/string.h> 26#include <linux/string.h>
27#include <linux/bootmem.h>
28#include <linux/initrd.h> 27#include <linux/initrd.h>
29#include <linux/seq_file.h> 28#include <linux/seq_file.h>
30#include <linux/kdev_t.h> 29#include <linux/kdev_t.h>
@@ -676,7 +675,6 @@ static void __init iSeries_bolt_kernel(unsigned long saddr, unsigned long eaddr)
676 */ 675 */
677static void __init iSeries_setup_arch(void) 676static void __init iSeries_setup_arch(void)
678{ 677{
679 void *eventStack;
680 unsigned procIx = get_paca()->lppaca.dyn_hv_phys_proc_index; 678 unsigned procIx = get_paca()->lppaca.dyn_hv_phys_proc_index;
681 679
682 /* Add an eye catcher and the systemcfg layout version number */ 680 /* Add an eye catcher and the systemcfg layout version number */
@@ -685,24 +683,7 @@ static void __init iSeries_setup_arch(void)
685 systemcfg->version.minor = SYSTEMCFG_MINOR; 683 systemcfg->version.minor = SYSTEMCFG_MINOR;
686 684
687 /* Setup the Lp Event Queue */ 685 /* Setup the Lp Event Queue */
688 686 setup_hvlpevent_queue();
689 /* Allocate a page for the Event Stack
690 * The hypervisor wants the absolute real address, so
691 * we subtract out the KERNELBASE and add in the
692 * absolute real address of the kernel load area
693 */
694 eventStack = alloc_bootmem_pages(LpEventStackSize);
695 memset(eventStack, 0, LpEventStackSize);
696
697 /* Invoke the hypervisor to initialize the event stack */
698 HvCallEvent_setLpEventStack(0, eventStack, LpEventStackSize);
699
700 /* Initialize fields in our Lp Event Queue */
701 xItLpQueue.xSlicEventStackPtr = (char *)eventStack;
702 xItLpQueue.xSlicCurEventPtr = (char *)eventStack;
703 xItLpQueue.xSlicLastValidEventPtr = (char *)eventStack +
704 (LpEventStackSize - LpEventMaxSize);
705 xItLpQueue.xIndex = 0;
706 687
707 /* Compute processor frequency */ 688 /* Compute processor frequency */
708 procFreqHz = ((1UL << 34) * 1000000) / 689 procFreqHz = ((1UL << 34) * 1000000) /
diff --git a/include/asm-ppc64/iSeries/ItLpQueue.h b/include/asm-ppc64/iSeries/ItLpQueue.h
index 832497e3259b..de90feedbe12 100644
--- a/include/asm-ppc64/iSeries/ItLpQueue.h
+++ b/include/asm-ppc64/iSeries/ItLpQueue.h
@@ -80,5 +80,6 @@ extern struct HvLpEvent *ItLpQueue_getNextLpEvent(void);
80extern int ItLpQueue_isLpIntPending(void); 80extern int ItLpQueue_isLpIntPending(void);
81extern unsigned ItLpQueue_process(struct pt_regs *); 81extern unsigned ItLpQueue_process(struct pt_regs *);
82extern void ItLpQueue_clearValid(struct HvLpEvent *); 82extern void ItLpQueue_clearValid(struct HvLpEvent *);
83extern void setup_hvlpevent_queue(void);
83 84
84#endif /* _ITLPQUEUE_H */ 85#endif /* _ITLPQUEUE_H */