aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/ppc64/kernel/iSeries_smp.c1
-rw-r--r--arch/ppc64/kernel/viopath.c3
-rw-r--r--include/asm-ppc64/iSeries/HvCallCfg.h53
-rw-r--r--include/asm-ppc64/iSeries/HvLpConfig.h188
4 files changed, 3 insertions, 242 deletions
diff --git a/arch/ppc64/kernel/iSeries_smp.c b/arch/ppc64/kernel/iSeries_smp.c
index ff2281b457ed..f74386e31638 100644
--- a/arch/ppc64/kernel/iSeries_smp.c
+++ b/arch/ppc64/kernel/iSeries_smp.c
@@ -39,7 +39,6 @@
39#include <asm/smp.h> 39#include <asm/smp.h>
40#include <asm/paca.h> 40#include <asm/paca.h>
41#include <asm/iSeries/HvCall.h> 41#include <asm/iSeries/HvCall.h>
42#include <asm/iSeries/HvCallCfg.h>
43#include <asm/time.h> 42#include <asm/time.h>
44#include <asm/ppcdebug.h> 43#include <asm/ppcdebug.h>
45#include <asm/machdep.h> 44#include <asm/machdep.h>
diff --git a/arch/ppc64/kernel/viopath.c b/arch/ppc64/kernel/viopath.c
index 4e5c36e81f48..ef524042e496 100644
--- a/arch/ppc64/kernel/viopath.c
+++ b/arch/ppc64/kernel/viopath.c
@@ -46,7 +46,6 @@
46#include <asm/iSeries/ItExtVpdPanel.h> 46#include <asm/iSeries/ItExtVpdPanel.h>
47#include <asm/iSeries/HvLpEvent.h> 47#include <asm/iSeries/HvLpEvent.h>
48#include <asm/iSeries/HvLpConfig.h> 48#include <asm/iSeries/HvLpConfig.h>
49#include <asm/iSeries/HvCallCfg.h>
50#include <asm/iSeries/mf.h> 49#include <asm/iSeries/mf.h>
51#include <asm/iSeries/vio.h> 50#include <asm/iSeries/vio.h>
52 51
@@ -364,7 +363,7 @@ void vio_set_hostlp(void)
364 * while we're active 363 * while we're active
365 */ 364 */
366 viopath_ourLp = HvLpConfig_getLpIndex(); 365 viopath_ourLp = HvLpConfig_getLpIndex();
367 viopath_hostLp = HvCallCfg_getHostingLpIndex(viopath_ourLp); 366 viopath_hostLp = HvLpConfig_getHostingLpIndex(viopath_ourLp);
368 367
369 if (viopath_hostLp != HvLpIndexInvalid) 368 if (viopath_hostLp != HvLpIndexInvalid)
370 vio_setHandler(viomajorsubtype_config, handleConfig); 369 vio_setHandler(viomajorsubtype_config, handleConfig);
diff --git a/include/asm-ppc64/iSeries/HvCallCfg.h b/include/asm-ppc64/iSeries/HvCallCfg.h
index aa491c3ad0a2..ddf2bb59d73c 100644
--- a/include/asm-ppc64/iSeries/HvCallCfg.h
+++ b/include/asm-ppc64/iSeries/HvCallCfg.h
@@ -67,31 +67,11 @@ enum HvCallCfg_ReqQual {
67#define HvCallCfgGetLpExecutionMode HvCallCfg + 31 67#define HvCallCfgGetLpExecutionMode HvCallCfg + 31
68#define HvCallCfgGetHostingLpIndex HvCallCfg + 32 68#define HvCallCfgGetHostingLpIndex HvCallCfg + 32
69 69
70static inline HvLpIndex HvCallCfg_getLps(void)
71{
72 return HvCall0(HvCallCfgGetLps);
73}
74
75static inline int HvCallCfg_isBusDedicated(u64 busIndex)
76{
77 return HvCall1(HvCallCfgIsBusDedicated, busIndex);
78}
79
80static inline HvLpIndex HvCallCfg_getBusOwner(u64 busIndex) 70static inline HvLpIndex HvCallCfg_getBusOwner(u64 busIndex)
81{ 71{
82 return HvCall1(HvCallCfgGetBusOwner, busIndex); 72 return HvCall1(HvCallCfgGetBusOwner, busIndex);
83} 73}
84 74
85static inline HvLpIndexMap HvCallCfg_getBusAllocation(u64 busIndex)
86{
87 return HvCall1(HvCallCfgGetBusAllocation, busIndex);
88}
89
90static inline HvLpIndexMap HvCallCfg_getActiveLpMap(void)
91{
92 return HvCall0(HvCallCfgGetActiveLpMap);
93}
94
95static inline HvLpVirtualLanIndexMap HvCallCfg_getVirtualLanIndexMap( 75static inline HvLpVirtualLanIndexMap HvCallCfg_getVirtualLanIndexMap(
96 HvLpIndex lp) 76 HvLpIndex lp)
97{ 77{
@@ -105,31 +85,12 @@ static inline HvLpVirtualLanIndexMap HvCallCfg_getVirtualLanIndexMap(
105 return retVal; 85 return retVal;
106} 86}
107 87
108static inline u64 HvCallCfg_getSystemMsChunks(void)
109{
110 return HvCall0(HvCallCfgGetSystemMsChunks);
111}
112
113static inline u64 HvCallCfg_getMsChunks(HvLpIndex lp, 88static inline u64 HvCallCfg_getMsChunks(HvLpIndex lp,
114 enum HvCallCfg_ReqQual qual) 89 enum HvCallCfg_ReqQual qual)
115{ 90{
116 return HvCall2(HvCallCfgGetMsChunks, lp, qual); 91 return HvCall2(HvCallCfgGetMsChunks, lp, qual);
117} 92}
118 93
119static inline u64 HvCallCfg_getMinRuntimeMsChunks(HvLpIndex lp)
120{
121 /*
122 * NOTE: This function was added in v5r1 so older hypervisors
123 * will return a -1 value
124 */
125 return HvCall1(HvCallCfgGetMinRuntimeMsChunks, lp);
126}
127
128static inline u64 HvCallCfg_setMinRuntimeMsChunks(u64 chunks)
129{
130 return HvCall1(HvCallCfgSetMinRuntimeMsChunks, chunks);
131}
132
133static inline u64 HvCallCfg_getSystemPhysicalProcessors(void) 94static inline u64 HvCallCfg_getSystemPhysicalProcessors(void)
134{ 95{
135 return HvCall0(HvCallCfgGetSystemPhysicalProcessors); 96 return HvCall0(HvCallCfgGetSystemPhysicalProcessors);
@@ -141,14 +102,6 @@ static inline u64 HvCallCfg_getPhysicalProcessors(HvLpIndex lp,
141 return HvCall2(HvCallCfgGetPhysicalProcessors, lp, qual); 102 return HvCall2(HvCallCfgGetPhysicalProcessors, lp, qual);
142} 103}
143 104
144static inline u64 HvCallCfg_getConfiguredBusUnitsForInterruptProc(HvLpIndex lp,
145 u16 hvLogicalProcIndex)
146{
147 return HvCall2(HvCallCfgGetConfiguredBusUnitsForIntProc, lp,
148 hvLogicalProcIndex);
149
150}
151
152static inline HvLpSharedPoolIndex HvCallCfg_getSharedPoolIndex(HvLpIndex lp) 105static inline HvLpSharedPoolIndex HvCallCfg_getSharedPoolIndex(HvLpIndex lp)
153{ 106{
154 return HvCall1(HvCallCfgGetSharedPoolIndex, lp); 107 return HvCall1(HvCallCfgGetSharedPoolIndex, lp);
@@ -164,15 +117,13 @@ static inline u64 HvCallCfg_getSharedProcUnits(HvLpIndex lp,
164 117
165static inline u64 HvCallCfg_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI) 118static inline u64 HvCallCfg_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI)
166{ 119{
167 u16 retVal = HvCall1(HvCallCfgGetNumProcsInSharedPool, sPI); 120 return (u16)HvCall1(HvCallCfgGetNumProcsInSharedPool, sPI);
168 return retVal;
169 121
170} 122}
171 123
172static inline HvLpIndex HvCallCfg_getHostingLpIndex(HvLpIndex lp) 124static inline HvLpIndex HvCallCfg_getHostingLpIndex(HvLpIndex lp)
173{ 125{
174 u64 retVal = HvCall1(HvCallCfgGetHostingLpIndex, lp); 126 return HvCall1(HvCallCfgGetHostingLpIndex, lp);
175 return retVal;
176} 127}
177 128
178#endif /* _HVCALLCFG_H */ 129#endif /* _HVCALLCFG_H */
diff --git a/include/asm-ppc64/iSeries/HvLpConfig.h b/include/asm-ppc64/iSeries/HvLpConfig.h
index 9411b5a04d00..78d68281cc8b 100644
--- a/include/asm-ppc64/iSeries/HvLpConfig.h
+++ b/include/asm-ppc64/iSeries/HvLpConfig.h
@@ -40,127 +40,16 @@ static inline HvLpIndex HvLpConfig_getPrimaryLpIndex(void)
40 return itLpNaca.xPrimaryLpIndex; 40 return itLpNaca.xPrimaryLpIndex;
41} 41}
42 42
43static inline HvLpIndex HvLpConfig_getLps(void)
44{
45 return HvCallCfg_getLps();
46}
47
48static inline HvLpIndexMap HvLpConfig_getActiveLpMap(void)
49{
50 return HvCallCfg_getActiveLpMap();
51}
52
53static inline u64 HvLpConfig_getSystemMsMegs(void)
54{
55 return HvCallCfg_getSystemMsChunks() / HVCHUNKSPERMEG;
56}
57
58static inline u64 HvLpConfig_getSystemMsChunks(void)
59{
60 return HvCallCfg_getSystemMsChunks();
61}
62
63static inline u64 HvLpConfig_getSystemMsPages(void)
64{
65 return HvCallCfg_getSystemMsChunks() * HVPAGESPERCHUNK;
66}
67
68static inline u64 HvLpConfig_getMsMegs(void)
69{
70 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Cur)
71 / HVCHUNKSPERMEG;
72}
73
74static inline u64 HvLpConfig_getMsChunks(void) 43static inline u64 HvLpConfig_getMsChunks(void)
75{ 44{
76 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Cur); 45 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Cur);
77} 46}
78 47
79static inline u64 HvLpConfig_getMsPages(void)
80{
81 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Cur)
82 * HVPAGESPERCHUNK;
83}
84
85static inline u64 HvLpConfig_getMinMsMegs(void)
86{
87 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Min)
88 / HVCHUNKSPERMEG;
89}
90
91static inline u64 HvLpConfig_getMinMsChunks(void)
92{
93 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Min);
94}
95
96static inline u64 HvLpConfig_getMinMsPages(void)
97{
98 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Min)
99 * HVPAGESPERCHUNK;
100}
101
102static inline u64 HvLpConfig_getMinRuntimeMsMegs(void)
103{
104 return HvCallCfg_getMinRuntimeMsChunks(HvLpConfig_getLpIndex())
105 / HVCHUNKSPERMEG;
106}
107
108static inline u64 HvLpConfig_getMinRuntimeMsChunks(void)
109{
110 return HvCallCfg_getMinRuntimeMsChunks(HvLpConfig_getLpIndex());
111}
112
113static inline u64 HvLpConfig_getMinRuntimeMsPages(void)
114{
115 return HvCallCfg_getMinRuntimeMsChunks(HvLpConfig_getLpIndex())
116 * HVPAGESPERCHUNK;
117}
118
119static inline u64 HvLpConfig_getMaxMsMegs(void)
120{
121 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Max)
122 / HVCHUNKSPERMEG;
123}
124
125static inline u64 HvLpConfig_getMaxMsChunks(void)
126{
127 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Max);
128}
129
130static inline u64 HvLpConfig_getMaxMsPages(void)
131{
132 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Max)
133 * HVPAGESPERCHUNK;
134}
135
136static inline u64 HvLpConfig_getInitMsMegs(void)
137{
138 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Init)
139 / HVCHUNKSPERMEG;
140}
141
142static inline u64 HvLpConfig_getInitMsChunks(void)
143{
144 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Init);
145}
146
147static inline u64 HvLpConfig_getInitMsPages(void)
148{
149 return HvCallCfg_getMsChunks(HvLpConfig_getLpIndex(), HvCallCfg_Init)
150 * HVPAGESPERCHUNK;
151}
152
153static inline u64 HvLpConfig_getSystemPhysicalProcessors(void) 48static inline u64 HvLpConfig_getSystemPhysicalProcessors(void)
154{ 49{
155 return HvCallCfg_getSystemPhysicalProcessors(); 50 return HvCallCfg_getSystemPhysicalProcessors();
156} 51}
157 52
158static inline u64 HvLpConfig_getSystemLogicalProcessors(void)
159{
160 return HvCallCfg_getSystemPhysicalProcessors()
161 * (/*getPaca()->getSecondaryThreadCount() +*/ 1);
162}
163
164static inline u64 HvLpConfig_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI) 53static inline u64 HvLpConfig_getNumProcsInSharedPool(HvLpSharedPoolIndex sPI)
165{ 54{
166 return HvCallCfg_getNumProcsInSharedPool(sPI); 55 return HvCallCfg_getNumProcsInSharedPool(sPI);
@@ -172,13 +61,6 @@ static inline u64 HvLpConfig_getPhysicalProcessors(void)
172 HvCallCfg_Cur); 61 HvCallCfg_Cur);
173} 62}
174 63
175static inline u64 HvLpConfig_getLogicalProcessors(void)
176{
177 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),
178 HvCallCfg_Cur)
179 * (/*getPaca()->getSecondaryThreadCount() +*/ 1);
180}
181
182static inline HvLpSharedPoolIndex HvLpConfig_getSharedPoolIndex(void) 64static inline HvLpSharedPoolIndex HvLpConfig_getSharedPoolIndex(void)
183{ 65{
184 return HvCallCfg_getSharedPoolIndex(HvLpConfig_getLpIndex()); 66 return HvCallCfg_getSharedPoolIndex(HvLpConfig_getLpIndex());
@@ -190,57 +72,18 @@ static inline u64 HvLpConfig_getSharedProcUnits(void)
190 HvCallCfg_Cur); 72 HvCallCfg_Cur);
191} 73}
192 74
193static inline u64 HvLpConfig_getMinSharedProcUnits(void)
194{
195 return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(),
196 HvCallCfg_Min);
197}
198
199static inline u64 HvLpConfig_getMaxSharedProcUnits(void) 75static inline u64 HvLpConfig_getMaxSharedProcUnits(void)
200{ 76{
201 return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(), 77 return HvCallCfg_getSharedProcUnits(HvLpConfig_getLpIndex(),
202 HvCallCfg_Max); 78 HvCallCfg_Max);
203} 79}
204 80
205static inline u64 HvLpConfig_getMinPhysicalProcessors(void)
206{
207 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),
208 HvCallCfg_Min);
209}
210
211static inline u64 HvLpConfig_getMinLogicalProcessors(void)
212{
213 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),
214 HvCallCfg_Min)
215 * (/*getPaca()->getSecondaryThreadCount() +*/ 1);
216}
217
218static inline u64 HvLpConfig_getMaxPhysicalProcessors(void) 81static inline u64 HvLpConfig_getMaxPhysicalProcessors(void)
219{ 82{
220 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(), 83 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),
221 HvCallCfg_Max); 84 HvCallCfg_Max);
222} 85}
223 86
224static inline u64 HvLpConfig_getMaxLogicalProcessors(void)
225{
226 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),
227 HvCallCfg_Max)
228 * (/*getPaca()->getSecondaryThreadCount() +*/ 1);
229}
230
231static inline u64 HvLpConfig_getInitPhysicalProcessors(void)
232{
233 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),
234 HvCallCfg_Init);
235}
236
237static inline u64 HvLpConfig_getInitLogicalProcessors(void)
238{
239 return HvCallCfg_getPhysicalProcessors(HvLpConfig_getLpIndex(),
240 HvCallCfg_Init)
241 * (/*getPaca()->getSecondaryThreadCount() +*/ 1);
242}
243
244static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMap(void) 87static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMap(void)
245{ 88{
246 return HvCallCfg_getVirtualLanIndexMap(HvLpConfig_getLpIndex_outline()); 89 return HvCallCfg_getVirtualLanIndexMap(HvLpConfig_getLpIndex_outline());
@@ -252,37 +95,6 @@ static inline HvLpVirtualLanIndexMap HvLpConfig_getVirtualLanIndexMapForLp(
252 return HvCallCfg_getVirtualLanIndexMap(lp); 95 return HvCallCfg_getVirtualLanIndexMap(lp);
253} 96}
254 97
255static inline HvLpIndex HvLpConfig_getBusOwner(HvBusNumber busNumber)
256{
257 return HvCallCfg_getBusOwner(busNumber);
258}
259
260static inline int HvLpConfig_isBusDedicated(HvBusNumber busNumber)
261{
262 return HvCallCfg_isBusDedicated(busNumber);
263}
264
265static inline HvLpIndexMap HvLpConfig_getBusAllocation(HvBusNumber busNumber)
266{
267 return HvCallCfg_getBusAllocation(busNumber);
268}
269
270/* returns the absolute real address of the load area */
271static inline u64 HvLpConfig_getLoadAddress(void)
272{
273 return itLpNaca.xLoadAreaAddr & 0x7fffffffffffffff;
274}
275
276static inline u64 HvLpConfig_getLoadPages(void)
277{
278 return itLpNaca.xLoadAreaChunks * HVPAGESPERCHUNK;
279}
280
281static inline int HvLpConfig_isBusOwnedByThisLp(HvBusNumber busNumber)
282{
283 return (HvLpConfig_getBusOwner(busNumber) == HvLpConfig_getLpIndex());
284}
285
286static inline int HvLpConfig_doLpsCommunicateOnVirtualLan(HvLpIndex lp1, 98static inline int HvLpConfig_doLpsCommunicateOnVirtualLan(HvLpIndex lp1,
287 HvLpIndex lp2) 99 HvLpIndex lp2)
288{ 100{