Commit bea248fb authored by Michael Ellerman's avatar Michael Ellerman Committed by Paul Mackerras

[PATCH] ppc64: Remove lpqueue pointer from the paca on iSeries

The iSeries code keeps a pointer to the ItLpQueue in its paca struct. But
all these pointers end up pointing to the one place, ie. xItLpQueue.

So remove the pointer from the paca struct and just refer to xItLpQueue
directly where needed.

The only complication is that the spread_lpevents logic was implemented by
having a NULL lpqueue pointer in the paca on CPUs that weren't supposed to
process events. Instead we just compare the spread_lpevents value to the
processor id to get the same behaviour.
Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Acked-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent b1bdfbd0
...@@ -69,15 +69,17 @@ struct HvLpEvent * ItLpQueue_getNextLpEvent( struct ItLpQueue * lpQueue ) ...@@ -69,15 +69,17 @@ struct HvLpEvent * ItLpQueue_getNextLpEvent( struct ItLpQueue * lpQueue )
return nextLpEvent; return nextLpEvent;
} }
unsigned long spread_lpevents = 1;
int ItLpQueue_isLpIntPending( struct ItLpQueue * lpQueue ) int ItLpQueue_isLpIntPending( struct ItLpQueue * lpQueue )
{ {
int retval = 0; struct HvLpEvent *next_event;
struct HvLpEvent * nextLpEvent;
if ( lpQueue ) { if (smp_processor_id() >= spread_lpevents)
nextLpEvent = (struct HvLpEvent *)lpQueue->xSlicCurEventPtr; return 0;
retval = nextLpEvent->xFlags.xValid | lpQueue->xPlicOverflowIntPending;
} next_event = (struct HvLpEvent *)lpQueue->xSlicCurEventPtr;
return retval; return next_event->xFlags.xValid | lpQueue->xPlicOverflowIntPending;
} }
void ItLpQueue_clearValid( struct HvLpEvent * event ) void ItLpQueue_clearValid( struct HvLpEvent * event )
......
...@@ -855,17 +855,15 @@ late_initcall(iSeries_src_init); ...@@ -855,17 +855,15 @@ late_initcall(iSeries_src_init);
static int set_spread_lpevents(char *str) static int set_spread_lpevents(char *str)
{ {
unsigned long i;
unsigned long val = simple_strtoul(str, NULL, 0); unsigned long val = simple_strtoul(str, NULL, 0);
extern unsigned long spread_lpevents;
/* /*
* The parameter is the number of processors to share in processing * The parameter is the number of processors to share in processing
* lp events. * lp events.
*/ */
if (( val > 0) && (val <= NR_CPUS)) { if (( val > 0) && (val <= NR_CPUS)) {
for (i = 1; i < val; ++i) spread_lpevents = val;
paca[i].lpqueue_ptr = paca[0].lpqueue_ptr;
printk("lpevent processing spread over %ld processors\n", val); printk("lpevent processing spread over %ld processors\n", val);
} else { } else {
printk("invalid spread_lpevents %ld\n", val); printk("invalid spread_lpevents %ld\n", val);
......
...@@ -88,7 +88,7 @@ static int iSeries_idle(void) ...@@ -88,7 +88,7 @@ static int iSeries_idle(void)
while (1) { while (1) {
if (lpaca->lppaca.shared_proc) { if (lpaca->lppaca.shared_proc) {
if (ItLpQueue_isLpIntPending(lpaca->lpqueue_ptr)) if (ItLpQueue_isLpIntPending(&xItLpQueue))
process_iSeries_events(); process_iSeries_events();
if (!need_resched()) if (!need_resched())
yield_shared_processor(); yield_shared_processor();
...@@ -100,7 +100,7 @@ static int iSeries_idle(void) ...@@ -100,7 +100,7 @@ static int iSeries_idle(void)
while (!need_resched()) { while (!need_resched()) {
HMT_medium(); HMT_medium();
if (ItLpQueue_isLpIntPending(lpaca->lpqueue_ptr)) if (ItLpQueue_isLpIntPending(&xItLpQueue))
process_iSeries_events(); process_iSeries_events();
HMT_low(); HMT_low();
} }
......
...@@ -269,7 +269,6 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq) ...@@ -269,7 +269,6 @@ void ppc_irq_dispatch_handler(struct pt_regs *regs, int irq)
void do_IRQ(struct pt_regs *regs) void do_IRQ(struct pt_regs *regs)
{ {
struct paca_struct *lpaca; struct paca_struct *lpaca;
struct ItLpQueue *lpq;
irq_enter(); irq_enter();
...@@ -295,9 +294,8 @@ void do_IRQ(struct pt_regs *regs) ...@@ -295,9 +294,8 @@ void do_IRQ(struct pt_regs *regs)
iSeries_smp_message_recv(regs); iSeries_smp_message_recv(regs);
} }
#endif /* CONFIG_SMP */ #endif /* CONFIG_SMP */
lpq = lpaca->lpqueue_ptr; if (ItLpQueue_isLpIntPending(&xItLpQueue))
if (lpq && ItLpQueue_isLpIntPending(lpq)) lpevent_count += ItLpQueue_process(&xItLpQueue, regs);
lpevent_count += ItLpQueue_process(lpq, regs);
irq_exit(); irq_exit();
......
...@@ -802,9 +802,8 @@ int mf_get_boot_rtc(struct rtc_time *tm) ...@@ -802,9 +802,8 @@ int mf_get_boot_rtc(struct rtc_time *tm)
/* We need to poll here as we are not yet taking interrupts */ /* We need to poll here as we are not yet taking interrupts */
while (rtc_data.busy) { while (rtc_data.busy) {
extern unsigned long lpevent_count; extern unsigned long lpevent_count;
struct ItLpQueue *lpq = get_paca()->lpqueue_ptr; if (ItLpQueue_isLpIntPending(&xItLpQueue))
if (lpq && ItLpQueue_isLpIntPending(lpq)) lpevent_count += ItLpQueue_process(&xItLpQueue, NULL);
lpevent_count += ItLpQueue_process(lpq, NULL);
} }
return rtc_set_tm(rtc_data.rc, rtc_data.ce_msg.ce_msg, tm); return rtc_set_tm(rtc_data.rc, rtc_data.ce_msg.ce_msg, tm);
} }
......
...@@ -45,7 +45,6 @@ extern unsigned long __toc_start; ...@@ -45,7 +45,6 @@ extern unsigned long __toc_start;
#ifdef CONFIG_PPC_ISERIES #ifdef CONFIG_PPC_ISERIES
#define EXTRA_INITS(number, lpq) \ #define EXTRA_INITS(number, lpq) \
.lppaca_ptr = &paca[number].lppaca, \ .lppaca_ptr = &paca[number].lppaca, \
.lpqueue_ptr = (lpq), /* &xItLpQueue, */ \
.reg_save_ptr = &paca[number].reg_save, \ .reg_save_ptr = &paca[number].reg_save, \
.reg_save = { \ .reg_save = { \
.xDesc = 0xd397d9e2, /* "LpRS" */ \ .xDesc = 0xd397d9e2, /* "LpRS" */ \
......
...@@ -367,11 +367,8 @@ int timer_interrupt(struct pt_regs * regs) ...@@ -367,11 +367,8 @@ int timer_interrupt(struct pt_regs * regs)
set_dec(next_dec); set_dec(next_dec);
#ifdef CONFIG_PPC_ISERIES #ifdef CONFIG_PPC_ISERIES
{ if (ItLpQueue_isLpIntPending(&xItLpQueue))
struct ItLpQueue *lpq = lpaca->lpqueue_ptr; lpevent_count += ItLpQueue_process(&xItLpQueue, regs);
if (lpq && ItLpQueue_isLpIntPending(lpq))
lpevent_count += ItLpQueue_process(lpq, regs);
}
#endif #endif
/* collect purr register values often, for accurate calculations */ /* collect purr register values often, for accurate calculations */
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include <asm/types.h> #include <asm/types.h>
#include <asm/lppaca.h> #include <asm/lppaca.h>
#include <asm/iSeries/ItLpRegSave.h> #include <asm/iSeries/ItLpRegSave.h>
#include <asm/iSeries/ItLpQueue.h>
#include <asm/mmu.h> #include <asm/mmu.h>
register struct paca_struct *local_paca asm("r13"); register struct paca_struct *local_paca asm("r13");
...@@ -62,7 +61,6 @@ struct paca_struct { ...@@ -62,7 +61,6 @@ struct paca_struct {
u16 paca_index; /* Logical processor number */ u16 paca_index; /* Logical processor number */
u32 default_decr; /* Default decrementer value */ u32 default_decr; /* Default decrementer value */
struct ItLpQueue *lpqueue_ptr; /* LpQueue handled by this CPU */
u64 kernel_toc; /* Kernel TOC address */ u64 kernel_toc; /* Kernel TOC address */
u64 stab_real; /* Absolute address of segment table */ u64 stab_real; /* Absolute address of segment table */
u64 stab_addr; /* Virtual address of segment table */ u64 stab_addr; /* Virtual address of segment table */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment