diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2024-05-29 22:30:29 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2024-05-30 22:57:27 +1000 |
commit | 50934945d54238d2d6d8db4b7c1d4c90d2696c57 (patch) | |
tree | 4a8fe4c9ac37e543bcb780f04f7455c2e7e05fa6 /arch/powerpc/Kconfig | |
parent | 2d43cc701b96f910f50915ac4c2a0cae5deb734c (diff) |
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: c20beffeec3c ("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
Diffstat (limited to 'arch/powerpc/Kconfig')
0 files changed, 0 insertions, 0 deletions