aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/include/asm/lppaca.h18
-rw-r--r--arch/powerpc/include/asm/spinlock.h2
-rw-r--r--arch/powerpc/kernel/lparcfg.c5
-rw-r--r--arch/powerpc/kvm/book3s_hv.c2
-rw-r--r--arch/powerpc/mm/numa.c2
-rw-r--r--arch/powerpc/platforms/pseries/hotplug-cpu.c4
-rw-r--r--arch/powerpc/platforms/pseries/processor_idle.c2
7 files changed, 23 insertions, 12 deletions
diff --git a/arch/powerpc/include/asm/lppaca.h b/arch/powerpc/include/asm/lppaca.h
index 9b12f88d4adb..bc8def08d5d8 100644
--- a/arch/powerpc/include/asm/lppaca.h
+++ b/arch/powerpc/include/asm/lppaca.h
@@ -50,10 +50,8 @@ struct lppaca {
50 50
51 u32 desc; /* Eye catcher 0xD397D781 */ 51 u32 desc; /* Eye catcher 0xD397D781 */
52 u16 size; /* Size of this struct */ 52 u16 size; /* Size of this struct */
53 u16 reserved1; 53 u8 reserved1[3];
54 u16 reserved2:14; 54 u8 __old_status; /* Old status, including shared proc */
55 u8 shared_proc:1; /* Shared processor indicator */
56 u8 secondary_thread:1; /* Secondary thread indicator */
57 u8 reserved3[14]; 55 u8 reserved3[14];
58 volatile u32 dyn_hw_node_id; /* Dynamic hardware node id */ 56 volatile u32 dyn_hw_node_id; /* Dynamic hardware node id */
59 volatile u32 dyn_hw_proc_id; /* Dynamic hardware proc id */ 57 volatile u32 dyn_hw_proc_id; /* Dynamic hardware proc id */
@@ -108,6 +106,18 @@ extern struct lppaca lppaca[];
108#define lppaca_of(cpu) (*paca[cpu].lppaca_ptr) 106#define lppaca_of(cpu) (*paca[cpu].lppaca_ptr)
109 107
110/* 108/*
109 * Old kernels used a reserved bit in the VPA to determine if it was running
110 * in shared processor mode. New kernels look for a non zero yield count
111 * but KVM still needs to set the bit to keep the old stuff happy.
112 */
113#define LPPACA_OLD_SHARED_PROC 2
114
115static inline bool lppaca_shared_proc(struct lppaca *l)
116{
117 return l->yield_count != 0;
118}
119
120/*
111 * SLB shadow buffer structure as defined in the PAPR. The save_area 121 * SLB shadow buffer structure as defined in the PAPR. The save_area
112 * contains adjacent ESID and VSID pairs for each shadowed SLB. The 122 * contains adjacent ESID and VSID pairs for each shadowed SLB. The
113 * ESID is stored in the lower 64bits, then the VSID. 123 * ESID is stored in the lower 64bits, then the VSID.
diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h
index 5b23f910ee57..7c345b6518db 100644
--- a/arch/powerpc/include/asm/spinlock.h
+++ b/arch/powerpc/include/asm/spinlock.h
@@ -96,7 +96,7 @@ static inline int arch_spin_trylock(arch_spinlock_t *lock)
96 96
97#if defined(CONFIG_PPC_SPLPAR) 97#if defined(CONFIG_PPC_SPLPAR)
98/* We only yield to the hypervisor if we are in shared processor mode */ 98/* We only yield to the hypervisor if we are in shared processor mode */
99#define SHARED_PROCESSOR (local_paca->lppaca_ptr->shared_proc) 99#define SHARED_PROCESSOR (lppaca_shared_proc(local_paca->lppaca_ptr))
100extern void __spin_yield(arch_spinlock_t *lock); 100extern void __spin_yield(arch_spinlock_t *lock);
101extern void __rw_yield(arch_rwlock_t *lock); 101extern void __rw_yield(arch_rwlock_t *lock);
102#else /* SPLPAR */ 102#else /* SPLPAR */
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c
index d92f3871e9cf..e6024c2ed5c7 100644
--- a/arch/powerpc/kernel/lparcfg.c
+++ b/arch/powerpc/kernel/lparcfg.c
@@ -165,7 +165,7 @@ static void parse_ppp_data(struct seq_file *m)
165 ppp_data.active_system_procs); 165 ppp_data.active_system_procs);
166 166
167 /* pool related entries are appropriate for shared configs */ 167 /* pool related entries are appropriate for shared configs */
168 if (lppaca_of(0).shared_proc) { 168 if (lppaca_shared_proc(get_lppaca())) {
169 unsigned long pool_idle_time, pool_procs; 169 unsigned long pool_idle_time, pool_procs;
170 170
171 seq_printf(m, "pool=%d\n", ppp_data.pool_num); 171 seq_printf(m, "pool=%d\n", ppp_data.pool_num);
@@ -473,7 +473,8 @@ static int pseries_lparcfg_data(struct seq_file *m, void *v)
473 seq_printf(m, "partition_potential_processors=%d\n", 473 seq_printf(m, "partition_potential_processors=%d\n",
474 partition_potential_processors); 474 partition_potential_processors);
475 475
476 seq_printf(m, "shared_processor_mode=%d\n", lppaca_of(0).shared_proc); 476 seq_printf(m, "shared_processor_mode=%d\n",
477 lppaca_shared_proc(get_lppaca()));
477 478
478 seq_printf(m, "slb_size=%d\n", mmu_slb_size); 479 seq_printf(m, "slb_size=%d\n", mmu_slb_size);
479 480
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 2efa9dde741a..cf39bf4f3c7d 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -217,7 +217,7 @@ struct kvm_vcpu *kvmppc_find_vcpu(struct kvm *kvm, int id)
217 217
218static void init_vpa(struct kvm_vcpu *vcpu, struct lppaca *vpa) 218static void init_vpa(struct kvm_vcpu *vcpu, struct lppaca *vpa)
219{ 219{
220 vpa->shared_proc = 1; 220 vpa->__old_status |= LPPACA_OLD_SHARED_PROC;
221 vpa->yield_count = 1; 221 vpa->yield_count = 1;
222} 222}
223 223
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 5850798826cd..501e32ca43b4 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1609,7 +1609,7 @@ int start_topology_update(void)
1609#endif 1609#endif
1610 } 1610 }
1611 } else if (firmware_has_feature(FW_FEATURE_VPHN) && 1611 } else if (firmware_has_feature(FW_FEATURE_VPHN) &&
1612 get_lppaca()->shared_proc) { 1612 lppaca_shared_proc(get_lppaca())) {
1613 if (!vphn_enabled) { 1613 if (!vphn_enabled) {
1614 prrn_enabled = 0; 1614 prrn_enabled = 0;
1615 vphn_enabled = 1; 1615 vphn_enabled = 1;
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 217ca5c75b20..1e490cf63a0d 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -123,7 +123,7 @@ static void pseries_mach_cpu_die(void)
123 cede_latency_hint = 2; 123 cede_latency_hint = 2;
124 124
125 get_lppaca()->idle = 1; 125 get_lppaca()->idle = 1;
126 if (!get_lppaca()->shared_proc) 126 if (!lppaca_shared_proc(get_lppaca()))
127 get_lppaca()->donate_dedicated_cpu = 1; 127 get_lppaca()->donate_dedicated_cpu = 1;
128 128
129 while (get_preferred_offline_state(cpu) == CPU_STATE_INACTIVE) { 129 while (get_preferred_offline_state(cpu) == CPU_STATE_INACTIVE) {
@@ -137,7 +137,7 @@ static void pseries_mach_cpu_die(void)
137 137
138 local_irq_disable(); 138 local_irq_disable();
139 139
140 if (!get_lppaca()->shared_proc) 140 if (!lppaca_shared_proc(get_lppaca()))
141 get_lppaca()->donate_dedicated_cpu = 0; 141 get_lppaca()->donate_dedicated_cpu = 0;
142 get_lppaca()->idle = 0; 142 get_lppaca()->idle = 0;
143 143
diff --git a/arch/powerpc/platforms/pseries/processor_idle.c b/arch/powerpc/platforms/pseries/processor_idle.c
index 4644efa06941..92db881be27e 100644
--- a/arch/powerpc/platforms/pseries/processor_idle.c
+++ b/arch/powerpc/platforms/pseries/processor_idle.c
@@ -308,7 +308,7 @@ static int pseries_idle_probe(void)
308 return -EPERM; 308 return -EPERM;
309 } 309 }
310 310
311 if (get_lppaca()->shared_proc) 311 if (lppaca_shared_proc(get_lppaca()))
312 cpuidle_state_table = shared_states; 312 cpuidle_state_table = shared_states;
313 else 313 else
314 cpuidle_state_table = dedicated_states; 314 cpuidle_state_table = dedicated_states;