diff --git a/arch/ppc64/kernel/htab.c b/arch/ppc64/kernel/htab.c index ece1f155f78740e76f2f58c02cd4bf4f7195820e..10e8343ad163007031a8eb6d309eb9836df528d4 100644 --- a/arch/ppc64/kernel/htab.c +++ b/arch/ppc64/kernel/htab.c @@ -18,6 +18,7 @@ * 2 of the License, or (at your option) any later version. */ +#include <linux/config.h> #include <linux/spinlock.h> #include <linux/errno.h> #include <linux/sched.h> diff --git a/arch/ppc64/kernel/idle.c b/arch/ppc64/kernel/idle.c index 7aa2a80dce97bd2e1f4b073cb764d7a83f76ac42..eb4655e7a6e38c52ce114631dd206dc0786ff2c6 100644 --- a/arch/ppc64/kernel/idle.c +++ b/arch/ppc64/kernel/idle.c @@ -46,40 +46,35 @@ extern long poll_pending(void); int (*idle_loop)(void); #ifdef CONFIG_PPC_ISERIES +unsigned long maxYieldTime = 0; +unsigned long minYieldTime = 0xffffffffffffffffUL; + static void yield_shared_processor(void) { - struct paca_struct *lpaca = get_paca(); + unsigned long tb; + unsigned long yieldTime; HvCall_setEnabledInterrupts(HvCall_MaskIPI | HvCall_MaskLpEvent | HvCall_MaskLpProd | HvCall_MaskTimeout); - if (!ItLpQueue_isLpIntPending(paca->lpQueuePtr)) { - /* - * Compute future tb value when yield should expire. - * We want to be woken up when the next decrementer is - * to fire. - */ + tb = get_tb(); + /* Compute future tb value when yield should expire */ + HvCall_yieldProcessor(HvCall_YieldTimed, tb+tb_ticks_per_jiffy); - local_irq_disable(); - lpaca->yielded = 1; /* Indicate a prod is desired */ - lpaca->xLpPaca.xIdle = 1; /* Inform the HV we are idle */ + yieldTime = get_tb() - tb; + if (yieldTime > maxYieldTime) + maxYieldTime = yieldTime; - HvCall_yieldProcessor(HvCall_YieldTimed, - lpaca->next_jiffy_update_tb); - - lpaca->yielded = 0; /* Back to IPI's */ - local_irq_enable(); + if (yieldTime < minYieldTime) + minYieldTime = yieldTime; - /* - * The decrementer stops during the yield. Force a fake - * decrementer here and let the timer_interrupt code sort - * out the actual time. - */ - lpaca->xLpPaca.xIntDword.xFields.xDecrInt = 1; - } - + /* + * The decrementer stops during the yield. Force a fake decrementer + * here and let the timer_interrupt code sort out the actual time. + */ + get_paca()->xLpPaca.xIntDword.xFields.xDecrInt = 1; process_iSeries_events(); } diff --git a/arch/ppc64/kernel/setup.c b/arch/ppc64/kernel/setup.c index 0c3e3cbe14720a30361c05d3286581c64d1451c2..6efa418bdb61f6cab9a5528894388b645ace614d 100644 --- a/arch/ppc64/kernel/setup.c +++ b/arch/ppc64/kernel/setup.c @@ -146,7 +146,9 @@ void __init disable_early_printk(void) void setup_system(unsigned long r3, unsigned long r4, unsigned long r5, unsigned long r6, unsigned long r7) { +#ifdef CONFIG_PPC_PSERIES unsigned int ret, i; +#endif #ifdef CONFIG_XMON_DEFAULT debugger = xmon; diff --git a/arch/ppc64/kernel/smp.c b/arch/ppc64/kernel/smp.c index d517ae55f7d5043f9485433f6fd890aae24ab8be..d17a06c26adbb2e1e56ec54e8efaf12fb0ac6e9c 100644 --- a/arch/ppc64/kernel/smp.c +++ b/arch/ppc64/kernel/smp.c @@ -126,6 +126,9 @@ static int smp_iSeries_numProcs(void) for (i=0; i < NR_CPUS; ++i) { lpPaca = paca[i].xLpPacaPtr; if ( lpPaca->xDynProcStatus < 2 ) { + cpu_set(i, cpu_available_map); + cpu_set(i, cpu_possible_map); + cpu_set(i, cpu_present_at_boot); ++np; } }