aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2006-01-12 18:26:42 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-13 05:17:39 -0500
commit3356bb9f7ba378a6e2709f9df95f4ea52111f4df (patch)
tree84f370df6e58cec63132f9acce492d585226e671 /arch/powerpc/platforms
parente58c3495e6007af59382540bb21ee941e470d88d (diff)
[PATCH] powerpc: Remove lppaca structure from the PACA
At present the lppaca - the structure shared with the iSeries hypervisor and phyp - is contained within the PACA, our own low-level per-cpu structure. This doesn't have to be so, the patch below removes it, making a separate array of lppaca structures. This saves approximately 500*NR_CPUS bytes of image size and kernel memory, because we don't need aligning gap between the Linux and hypervisor portions of every PACA. On the other hand it means an extra level of dereference in many accesses to the lppaca. The patch also gets rid of several places where we assign the paca address to a local variable for no particular reason. Signed-off-by: David Gibson <dwg@au1.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/iseries/irq.c6
-rw-r--r--arch/powerpc/platforms/iseries/misc.S3
-rw-r--r--arch/powerpc/platforms/iseries/setup.c8
-rw-r--r--arch/powerpc/platforms/iseries/smp.c2
-rw-r--r--arch/powerpc/platforms/pseries/lpar.c4
-rw-r--r--arch/powerpc/platforms/pseries/setup.c20
6 files changed, 20 insertions, 23 deletions
diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c
index 83442ea77476..be3fbfc24e6c 100644
--- a/arch/powerpc/platforms/iseries/irq.c
+++ b/arch/powerpc/platforms/iseries/irq.c
@@ -334,14 +334,12 @@ int __init iSeries_allocate_IRQ(HvBusNumber bus,
334 */ 334 */
335int iSeries_get_irq(struct pt_regs *regs) 335int iSeries_get_irq(struct pt_regs *regs)
336{ 336{
337 struct paca_struct *lpaca;
338 /* -2 means ignore this interrupt */ 337 /* -2 means ignore this interrupt */
339 int irq = -2; 338 int irq = -2;
340 339
341 lpaca = get_paca();
342#ifdef CONFIG_SMP 340#ifdef CONFIG_SMP
343 if (lpaca->lppaca.int_dword.fields.ipi_cnt) { 341 if (get_lppaca()->int_dword.fields.ipi_cnt) {
344 lpaca->lppaca.int_dword.fields.ipi_cnt = 0; 342 get_lppaca()->int_dword.fields.ipi_cnt = 0;
345 iSeries_smp_message_recv(regs); 343 iSeries_smp_message_recv(regs);
346 } 344 }
347#endif /* CONFIG_SMP */ 345#endif /* CONFIG_SMP */
diff --git a/arch/powerpc/platforms/iseries/misc.S b/arch/powerpc/platforms/iseries/misc.S
index dfe7aa1ba098..7641fc7e550a 100644
--- a/arch/powerpc/platforms/iseries/misc.S
+++ b/arch/powerpc/platforms/iseries/misc.S
@@ -44,7 +44,8 @@ _GLOBAL(local_irq_restore)
44 /* Check pending interrupts */ 44 /* Check pending interrupts */
45 /* A decrementer, IPI or PMC interrupt may have occurred 45 /* A decrementer, IPI or PMC interrupt may have occurred
46 * while we were in the hypervisor (which enables) */ 46 * while we were in the hypervisor (which enables) */
47 ld r4,PACALPPACA+LPPACAANYINT(r13) 47 ld r4,PACALPPACAPTR(r13)
48 ld r4,LPPACAANYINT(r4)
48 cmpdi r4,0 49 cmpdi r4,0
49 beqlr 50 beqlr
50 51
diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c
index c6bbe5c25107..3f8790146b00 100644
--- a/arch/powerpc/platforms/iseries/setup.c
+++ b/arch/powerpc/platforms/iseries/setup.c
@@ -538,7 +538,7 @@ static unsigned long __init build_iSeries_Memory_Map(void)
538 */ 538 */
539static void __init iSeries_setup_arch(void) 539static void __init iSeries_setup_arch(void)
540{ 540{
541 if (get_paca()->lppaca.shared_proc) { 541 if (get_lppaca()->shared_proc) {
542 ppc_md.idle_loop = iseries_shared_idle; 542 ppc_md.idle_loop = iseries_shared_idle;
543 printk(KERN_INFO "Using shared processor idle loop\n"); 543 printk(KERN_INFO "Using shared processor idle loop\n");
544 } else { 544 } else {
@@ -647,7 +647,7 @@ static void yield_shared_processor(void)
647 * The decrementer stops during the yield. Force a fake decrementer 647 * The decrementer stops during the yield. Force a fake decrementer
648 * here and let the timer_interrupt code sort out the actual time. 648 * here and let the timer_interrupt code sort out the actual time.
649 */ 649 */
650 get_paca()->lppaca.int_dword.fields.decr_int = 1; 650 get_lppaca()->int_dword.fields.decr_int = 1;
651 process_iSeries_events(); 651 process_iSeries_events();
652} 652}
653 653
@@ -883,7 +883,7 @@ void dt_cpus(struct iseries_flat_dt *dt)
883 pft_size[1] = __ilog2(HvCallHpt_getHptPages() * HW_PAGE_SIZE); 883 pft_size[1] = __ilog2(HvCallHpt_getHptPages() * HW_PAGE_SIZE);
884 884
885 for (i = 0; i < NR_CPUS; i++) { 885 for (i = 0; i < NR_CPUS; i++) {
886 if (paca[i].lppaca.dyn_proc_status >= 2) 886 if (lppaca[i].dyn_proc_status >= 2)
887 continue; 887 continue;
888 888
889 snprintf(p, 32 - (p - buf), "@%d", i); 889 snprintf(p, 32 - (p - buf), "@%d", i);
@@ -891,7 +891,7 @@ void dt_cpus(struct iseries_flat_dt *dt)
891 891
892 dt_prop_str(dt, "device_type", "cpu"); 892 dt_prop_str(dt, "device_type", "cpu");
893 893
894 index = paca[i].lppaca.dyn_hv_phys_proc_index; 894 index = lppaca[i].dyn_hv_phys_proc_index;
895 d = &xIoHriProcessorVpd[index]; 895 d = &xIoHriProcessorVpd[index];
896 896
897 dt_prop_u32(dt, "i-cache-size", d->xInstCacheSize * 1024); 897 dt_prop_u32(dt, "i-cache-size", d->xInstCacheSize * 1024);
diff --git a/arch/powerpc/platforms/iseries/smp.c b/arch/powerpc/platforms/iseries/smp.c
index fcb094ec6aec..6f9d407a709f 100644
--- a/arch/powerpc/platforms/iseries/smp.c
+++ b/arch/powerpc/platforms/iseries/smp.c
@@ -91,7 +91,7 @@ static void smp_iSeries_kick_cpu(int nr)
91 BUG_ON((nr < 0) || (nr >= NR_CPUS)); 91 BUG_ON((nr < 0) || (nr >= NR_CPUS));
92 92
93 /* Verify that our partition has a processor nr */ 93 /* Verify that our partition has a processor nr */
94 if (paca[nr].lppaca.dyn_proc_status >= 2) 94 if (lppaca[nr].dyn_proc_status >= 2)
95 return; 95 return;
96 96
97 /* The processor is currently spinning, waiting 97 /* The processor is currently spinning, waiting
diff --git a/arch/powerpc/platforms/pseries/lpar.c b/arch/powerpc/platforms/pseries/lpar.c
index 1fe445ab78a6..8952528d31ac 100644
--- a/arch/powerpc/platforms/pseries/lpar.c
+++ b/arch/powerpc/platforms/pseries/lpar.c
@@ -254,11 +254,11 @@ out:
254void vpa_init(int cpu) 254void vpa_init(int cpu)
255{ 255{
256 int hwcpu = get_hard_smp_processor_id(cpu); 256 int hwcpu = get_hard_smp_processor_id(cpu);
257 unsigned long vpa = __pa(&paca[cpu].lppaca); 257 unsigned long vpa = __pa(&lppaca[cpu]);
258 long ret; 258 long ret;
259 259
260 if (cpu_has_feature(CPU_FTR_ALTIVEC)) 260 if (cpu_has_feature(CPU_FTR_ALTIVEC))
261 paca[cpu].lppaca.vmxregs_in_use = 1; 261 lppaca[cpu].vmxregs_in_use = 1;
262 262
263 ret = register_vpa(hwcpu, vpa); 263 ret = register_vpa(hwcpu, vpa);
264 264
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index 68b7f086d63d..da6cebaf72cd 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -190,7 +190,7 @@ static void pseries_lpar_enable_pmcs(void)
190 190
191 /* instruct hypervisor to maintain PMCs */ 191 /* instruct hypervisor to maintain PMCs */
192 if (firmware_has_feature(FW_FEATURE_SPLPAR)) 192 if (firmware_has_feature(FW_FEATURE_SPLPAR))
193 get_paca()->lppaca.pmcregs_in_use = 1; 193 get_lppaca()->pmcregs_in_use = 1;
194} 194}
195 195
196static void __init pSeries_setup_arch(void) 196static void __init pSeries_setup_arch(void)
@@ -234,7 +234,7 @@ static void __init pSeries_setup_arch(void)
234 /* Choose an idle loop */ 234 /* Choose an idle loop */
235 if (firmware_has_feature(FW_FEATURE_SPLPAR)) { 235 if (firmware_has_feature(FW_FEATURE_SPLPAR)) {
236 vpa_init(boot_cpuid); 236 vpa_init(boot_cpuid);
237 if (get_paca()->lppaca.shared_proc) { 237 if (get_lppaca()->shared_proc) {
238 printk(KERN_INFO "Using shared processor idle loop\n"); 238 printk(KERN_INFO "Using shared processor idle loop\n");
239 ppc_md.idle_loop = pseries_shared_idle; 239 ppc_md.idle_loop = pseries_shared_idle;
240 } else { 240 } else {
@@ -444,10 +444,10 @@ DECLARE_PER_CPU(unsigned long, smt_snooze_delay);
444 444
445static inline void dedicated_idle_sleep(unsigned int cpu) 445static inline void dedicated_idle_sleep(unsigned int cpu)
446{ 446{
447 struct paca_struct *ppaca = &paca[cpu ^ 1]; 447 struct lppaca *plppaca = &lppaca[cpu ^ 1];
448 448
449 /* Only sleep if the other thread is not idle */ 449 /* Only sleep if the other thread is not idle */
450 if (!(ppaca->lppaca.idle)) { 450 if (!(plppaca->idle)) {
451 local_irq_disable(); 451 local_irq_disable();
452 452
453 /* 453 /*
@@ -480,7 +480,6 @@ static inline void dedicated_idle_sleep(unsigned int cpu)
480 480
481static void pseries_dedicated_idle(void) 481static void pseries_dedicated_idle(void)
482{ 482{
483 struct paca_struct *lpaca = get_paca();
484 unsigned int cpu = smp_processor_id(); 483 unsigned int cpu = smp_processor_id();
485 unsigned long start_snooze; 484 unsigned long start_snooze;
486 unsigned long *smt_snooze_delay = &__get_cpu_var(smt_snooze_delay); 485 unsigned long *smt_snooze_delay = &__get_cpu_var(smt_snooze_delay);
@@ -491,7 +490,7 @@ static void pseries_dedicated_idle(void)
491 * Indicate to the HV that we are idle. Now would be 490 * Indicate to the HV that we are idle. Now would be
492 * a good time to find other work to dispatch. 491 * a good time to find other work to dispatch.
493 */ 492 */
494 lpaca->lppaca.idle = 1; 493 get_lppaca()->idle = 1;
495 494
496 if (!need_resched()) { 495 if (!need_resched()) {
497 start_snooze = get_tb() + 496 start_snooze = get_tb() +
@@ -518,7 +517,7 @@ static void pseries_dedicated_idle(void)
518 HMT_medium(); 517 HMT_medium();
519 } 518 }
520 519
521 lpaca->lppaca.idle = 0; 520 get_lppaca()->idle = 0;
522 ppc64_runlatch_on(); 521 ppc64_runlatch_on();
523 522
524 preempt_enable_no_resched(); 523 preempt_enable_no_resched();
@@ -532,7 +531,6 @@ static void pseries_dedicated_idle(void)
532 531
533static void pseries_shared_idle(void) 532static void pseries_shared_idle(void)
534{ 533{
535 struct paca_struct *lpaca = get_paca();
536 unsigned int cpu = smp_processor_id(); 534 unsigned int cpu = smp_processor_id();
537 535
538 while (1) { 536 while (1) {
@@ -540,7 +538,7 @@ static void pseries_shared_idle(void)
540 * Indicate to the HV that we are idle. Now would be 538 * Indicate to the HV that we are idle. Now would be
541 * a good time to find other work to dispatch. 539 * a good time to find other work to dispatch.
542 */ 540 */
543 lpaca->lppaca.idle = 1; 541 get_lppaca()->idle = 1;
544 542
545 while (!need_resched() && !cpu_is_offline(cpu)) { 543 while (!need_resched() && !cpu_is_offline(cpu)) {
546 local_irq_disable(); 544 local_irq_disable();
@@ -564,7 +562,7 @@ static void pseries_shared_idle(void)
564 HMT_medium(); 562 HMT_medium();
565 } 563 }
566 564
567 lpaca->lppaca.idle = 0; 565 get_lppaca()->idle = 0;
568 ppc64_runlatch_on(); 566 ppc64_runlatch_on();
569 567
570 preempt_enable_no_resched(); 568 preempt_enable_no_resched();
@@ -588,7 +586,7 @@ static void pseries_kexec_cpu_down(int crash_shutdown, int secondary)
588{ 586{
589 /* Don't risk a hypervisor call if we're crashing */ 587 /* Don't risk a hypervisor call if we're crashing */
590 if (!crash_shutdown) { 588 if (!crash_shutdown) {
591 unsigned long vpa = __pa(&get_paca()->lppaca); 589 unsigned long vpa = __pa(get_lppaca());
592 590
593 if (unregister_vpa(hard_smp_processor_id(), vpa)) { 591 if (unregister_vpa(hard_smp_processor_id(), vpa)) {
594 printk("VPA deregistration of cpu %u (hw_cpu_id %d) " 592 printk("VPA deregistration of cpu %u (hw_cpu_id %d) "