Files
linux/arch/powerpc/include/asm
Michael Ellerman 50934945d5 powerpc/uaccess: Use YZ asm constraint for ld
The 'ld' instruction requires a 4-byte aligned displacement because it
is a DS-form instruction. But the "m" asm constraint doesn't enforce
that.

Add a special case of __get_user_asm2_goto() so that the "YZ" constraint
can be used for "ld".

The "Z" constraint is documented in the GCC manual PowerPC machine
constraints, and specifies a "memory operand accessed with indexed or
indirect addressing". "Y" is not documented in the manual but specifies
a "memory operand for a DS-form instruction". Using both allows the
compiler to generate a DS-form "ld" or X-form "ldx" as appropriate.

The change has to be conditional on CONFIG_PPC_KERNEL_PREFIXED because
the "Y" constraint does not guarantee 4-byte alignment when prefixed
instructions are enabled.

No build errors have been reported due to this, but the possibility is
there depending on compiler code generation decisions.

Fixes: c20beffeec ("powerpc/uaccess: Use flexible addressing with __put_user()/__get_user()")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240529123029.146953-2-mpe@ellerman.id.au
2024-05-30 22:57:27 +10:00
..
2024-04-25 20:55:47 -07:00
2024-04-25 20:55:47 -07:00
2024-04-08 15:03:06 +02:00
2023-10-20 23:18:07 +11:00
2023-10-20 23:18:07 +11:00
2023-12-08 12:02:37 +01:00
2023-12-08 12:02:37 +01:00
2023-02-12 22:11:56 +11:00
2021-03-24 14:09:29 +11:00
2022-06-29 19:37:07 +10:00
2024-05-08 00:21:30 +10:00
2024-02-15 00:14:06 +11:00
2024-05-08 00:21:30 +10:00
2023-12-08 12:02:37 +01:00
2024-03-06 13:04:19 -08:00
2021-02-09 01:09:44 +11:00
2024-05-08 00:21:30 +10:00
2022-05-08 22:15:40 +10:00
2022-12-07 20:14:49 +11:00
2018-05-25 12:04:43 +10:00
2023-08-24 22:33:16 +10:00
2021-12-09 22:41:21 +11:00
2022-09-28 19:22:09 +10:00
2018-07-30 22:48:21 +10:00
2023-08-02 22:49:43 +10:00
2024-05-08 00:21:30 +10:00
2022-07-27 21:36:05 +10:00
2022-01-30 21:17:00 -05:00
2024-02-15 00:14:06 +11:00