aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/sfp-machine.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-12-27 13:43:24 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-12-27 13:43:24 -0500
commit8d6973327ee84c2f40dd9efd8928d4a1186c96e2 (patch)
tree1c6accd71b6e9c4e05d5aaae766b958ad440d320 /arch/powerpc/include/asm/sfp-machine.h
parent6d101ba6be2a26a3e1f513b5e293f0fd2b79ec5c (diff)
parent12526b0d6c580df860b31e59d68e5696e16c6e5b (diff)
Merge tag 'powerpc-4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc updates from Michael Ellerman: "Notable changes: - Mitigations for Spectre v2 on some Freescale (NXP) CPUs. - A large series adding support for pass-through of Nvidia V100 GPUs to guests on Power9. - Another large series to enable hardware assistance for TLB table walk on MPC8xx CPUs. - Some preparatory changes to our DMA code, to make way for further cleanups from Christoph. - Several fixes for our Transactional Memory handling discovered by fuzzing the signal return path. - Support for generating our system call table(s) from a text file like other architectures. - A fix to our page fault handler so that instead of generating a WARN_ON_ONCE, user accesses of kernel addresses instead print a ratelimited and appropriately scary warning. - A cosmetic change to make our unhandled page fault messages more similar to other arches and also more compact and informative. - Freescale updates from Scott: "Highlights include elimination of legacy clock bindings use from dts files, an 83xx watchdog handler, fixes to old dts interrupt errors, and some minor cleanup." And many clean-ups, reworks and minor fixes etc. Thanks to: Alexandre Belloni, Alexey Kardashevskiy, Andrew Donnellan, Aneesh Kumar K.V, Arnd Bergmann, Benjamin Herrenschmidt, Breno Leitao, Christian Lamparter, Christophe Leroy, Christoph Hellwig, Daniel Axtens, Darren Stevens, David Gibson, Diana Craciun, Dmitry V. Levin, Firoz Khan, Geert Uytterhoeven, Greg Kurz, Gustavo Romero, Hari Bathini, Joel Stanley, Kees Cook, Madhavan Srinivasan, Mahesh Salgaonkar, Markus Elfring, Mathieu Malaterre, Michal Suchánek, Naveen N. Rao, Nick Desaulniers, Oliver O'Halloran, Paul Mackerras, Ram Pai, Ravi Bangoria, Rob Herring, Russell Currey, Sabyasachi Gupta, Sam Bobroff, Satheesh Rajendran, Scott Wood, Segher Boessenkool, Stephen Rothwell, Tang Yuantian, Thiago Jung Bauermann, Yangtao Li, Yuantian Tang, Yue Haibing" * tag 'powerpc-4.21-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (201 commits) Revert "powerpc/fsl_pci: simplify fsl_pci_dma_set_mask" powerpc/zImage: Also check for stdout-path powerpc: Fix HMIs on big-endian with CONFIG_RELOCATABLE=y macintosh: Use of_node_name_{eq, prefix} for node name comparisons ide: Use of_node_name_eq for node name comparisons powerpc: Use of_node_name_eq for node name comparisons powerpc/pseries/pmem: Convert to %pOFn instead of device_node.name powerpc/mm: Remove very old comment in hash-4k.h powerpc/pseries: Fix node leak in update_lmb_associativity_index() powerpc/configs/85xx: Enable CONFIG_DEBUG_KERNEL powerpc/dts/fsl: Fix dtc-flagged interrupt errors clk: qoriq: add more compatibles strings powerpc/fsl: Use new clockgen binding powerpc/83xx: handle machine check caused by watchdog timer powerpc/fsl-rio: fix spelling mistake "reserverd" -> "reserved" powerpc/fsl_pci: simplify fsl_pci_dma_set_mask arch/powerpc/fsl_rmu: Use dma_zalloc_coherent vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] subdriver vfio_pci: Allow regions to add own capabilities vfio_pci: Allow mapping extra regions ...
Diffstat (limited to 'arch/powerpc/include/asm/sfp-machine.h')
-rw-r--r--arch/powerpc/include/asm/sfp-machine.h92
1 files changed, 29 insertions, 63 deletions
diff --git a/arch/powerpc/include/asm/sfp-machine.h b/arch/powerpc/include/asm/sfp-machine.h
index d89beaba26ff..8b957aabb826 100644
--- a/arch/powerpc/include/asm/sfp-machine.h
+++ b/arch/powerpc/include/asm/sfp-machine.h
@@ -213,30 +213,18 @@
213 * respectively. The result is placed in HIGH_SUM and LOW_SUM. Overflow 213 * respectively. The result is placed in HIGH_SUM and LOW_SUM. Overflow
214 * (i.e. carry out) is not stored anywhere, and is lost. 214 * (i.e. carry out) is not stored anywhere, and is lost.
215 */ 215 */
216#define add_ssaaaa(sh, sl, ah, al, bh, bl) \ 216#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
217 do { \ 217 do { \
218 if (__builtin_constant_p (bh) && (bh) == 0) \ 218 if (__builtin_constant_p (bh) && (bh) == 0) \
219 __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \ 219 __asm__ ("add%I4c %1,%3,%4\n\taddze %0,%2" \
220 : "=r" ((USItype)(sh)), \ 220 : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\
221 "=&r" ((USItype)(sl)) \ 221 else if (__builtin_constant_p (bh) && (bh) == ~(USItype) 0) \
222 : "%r" ((USItype)(ah)), \ 222 __asm__ ("add%I4c %1,%3,%4\n\taddme %0,%2" \
223 "%r" ((USItype)(al)), \ 223 : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\
224 "rI" ((USItype)(bl))); \
225 else if (__builtin_constant_p (bh) && (bh) ==~(USItype) 0) \
226 __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \
227 : "=r" ((USItype)(sh)), \
228 "=&r" ((USItype)(sl)) \
229 : "%r" ((USItype)(ah)), \
230 "%r" ((USItype)(al)), \
231 "rI" ((USItype)(bl))); \
232 else \ 224 else \
233 __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \ 225 __asm__ ("add%I5c %1,%4,%5\n\tadde %0,%2,%3" \
234 : "=r" ((USItype)(sh)), \ 226 : "=r" (sh), "=&r" (sl) \
235 "=&r" ((USItype)(sl)) \ 227 : "%r" (ah), "r" (bh), "%r" (al), "rI" (bl)); \
236 : "%r" ((USItype)(ah)), \
237 "r" ((USItype)(bh)), \
238 "%r" ((USItype)(al)), \
239 "rI" ((USItype)(bl))); \
240 } while (0) 228 } while (0)
241 229
242/* sub_ddmmss is used in op-2.h and udivmodti4.c and should be equivalent to 230/* sub_ddmmss is used in op-2.h and udivmodti4.c and should be equivalent to
@@ -248,44 +236,24 @@
248 * and LOW_DIFFERENCE. Overflow (i.e. carry out) is not stored anywhere, 236 * and LOW_DIFFERENCE. Overflow (i.e. carry out) is not stored anywhere,
249 * and is lost. 237 * and is lost.
250 */ 238 */
251#define sub_ddmmss(sh, sl, ah, al, bh, bl) \ 239#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
252 do { \ 240 do { \
253 if (__builtin_constant_p (ah) && (ah) == 0) \ 241 if (__builtin_constant_p (ah) && (ah) == 0) \
254 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \ 242 __asm__ ("subf%I3c %1,%4,%3\n\tsubfze %0,%2" \
255 : "=r" ((USItype)(sh)), \ 243 : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
256 "=&r" ((USItype)(sl)) \ 244 else if (__builtin_constant_p (ah) && (ah) == ~(USItype) 0) \
257 : "r" ((USItype)(bh)), \ 245 __asm__ ("subf%I3c %1,%4,%3\n\tsubfme %0,%2" \
258 "rI" ((USItype)(al)), \ 246 : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
259 "r" ((USItype)(bl))); \
260 else if (__builtin_constant_p (ah) && (ah) ==~(USItype) 0) \
261 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \
262 : "=r" ((USItype)(sh)), \
263 "=&r" ((USItype)(sl)) \
264 : "r" ((USItype)(bh)), \
265 "rI" ((USItype)(al)), \
266 "r" ((USItype)(bl))); \
267 else if (__builtin_constant_p (bh) && (bh) == 0) \ 247 else if (__builtin_constant_p (bh) && (bh) == 0) \
268 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \ 248 __asm__ ("subf%I3c %1,%4,%3\n\taddme %0,%2" \
269 : "=r" ((USItype)(sh)), \ 249 : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
270 "=&r" ((USItype)(sl)) \ 250 else if (__builtin_constant_p (bh) && (bh) == ~(USItype) 0) \
271 : "r" ((USItype)(ah)), \ 251 __asm__ ("subf%I3c %1,%4,%3\n\taddze %0,%2" \
272 "rI" ((USItype)(al)), \ 252 : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
273 "r" ((USItype)(bl))); \
274 else if (__builtin_constant_p (bh) && (bh) ==~(USItype) 0) \
275 __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \
276 : "=r" ((USItype)(sh)), \
277 "=&r" ((USItype)(sl)) \
278 : "r" ((USItype)(ah)), \
279 "rI" ((USItype)(al)), \
280 "r" ((USItype)(bl))); \
281 else \ 253 else \
282 __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \ 254 __asm__ ("subf%I4c %1,%5,%4\n\tsubfe %0,%3,%2" \
283 : "=r" ((USItype)(sh)), \ 255 : "=r" (sh), "=&r" (sl) \
284 "=&r" ((USItype)(sl)) \ 256 : "r" (ah), "r" (bh), "rI" (al), "r" (bl)); \
285 : "r" ((USItype)(ah)), \
286 "r" ((USItype)(bh)), \
287 "rI" ((USItype)(al)), \
288 "r" ((USItype)(bl))); \
289 } while (0) 257 } while (0)
290 258
291/* asm fragments for mul and div */ 259/* asm fragments for mul and div */
@@ -294,13 +262,10 @@
294 * UWtype integers MULTIPLER and MULTIPLICAND, and generates a two UWtype 262 * UWtype integers MULTIPLER and MULTIPLICAND, and generates a two UWtype
295 * word product in HIGH_PROD and LOW_PROD. 263 * word product in HIGH_PROD and LOW_PROD.
296 */ 264 */
297#define umul_ppmm(ph, pl, m0, m1) \ 265#define umul_ppmm(ph, pl, m0, m1) \
298 do { \ 266 do { \
299 USItype __m0 = (m0), __m1 = (m1); \ 267 USItype __m0 = (m0), __m1 = (m1); \
300 __asm__ ("mulhwu %0,%1,%2" \ 268 __asm__ ("mulhwu %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1)); \
301 : "=r" ((USItype)(ph)) \
302 : "%r" (__m0), \
303 "r" (__m1)); \
304 (pl) = __m0 * __m1; \ 269 (pl) = __m0 * __m1; \
305 } while (0) 270 } while (0)
306 271
@@ -312,9 +277,10 @@
312 * significant bit of DENOMINATOR must be 1, then the pre-processor symbol 277 * significant bit of DENOMINATOR must be 1, then the pre-processor symbol
313 * UDIV_NEEDS_NORMALIZATION is defined to 1. 278 * UDIV_NEEDS_NORMALIZATION is defined to 1.
314 */ 279 */
315#define udiv_qrnnd(q, r, n1, n0, d) \ 280#define udiv_qrnnd(q, r, n1, n0, d) \
316 do { \ 281 do { \
317 UWtype __d1, __d0, __q1, __q0, __r1, __r0, __m; \ 282 UWtype __d1, __d0, __q1, __q0; \
283 UWtype __r1, __r0, __m; \
318 __d1 = __ll_highpart (d); \ 284 __d1 = __ll_highpart (d); \
319 __d0 = __ll_lowpart (d); \ 285 __d0 = __ll_lowpart (d); \
320 \ 286 \
@@ -325,7 +291,7 @@
325 if (__r1 < __m) \ 291 if (__r1 < __m) \
326 { \ 292 { \
327 __q1--, __r1 += (d); \ 293 __q1--, __r1 += (d); \
328 if (__r1 >= (d)) /* we didn't get carry when adding to __r1 */ \ 294 if (__r1 >= (d)) /* i.e. we didn't get carry when adding to __r1 */\
329 if (__r1 < __m) \ 295 if (__r1 < __m) \
330 __q1--, __r1 += (d); \ 296 __q1--, __r1 += (d); \
331 } \ 297 } \