diff options
author | Paul Mackerras <paulus@ozlabs.org> | 2017-04-04 04:56:05 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-04-12 10:41:13 (GMT) |
commit | 45c2ed941c0855848fb305d1ff6201a88d74bdef (patch) | |
tree | 7a7a2577be6abef90b95c435a6de0590055f11a4 /arch/powerpc/net | |
parent | fba7546bbe659e261be8ef6f26f3ae48a4e9b85d (diff) | |
download | linux-45c2ed941c0855848fb305d1ff6201a88d74bdef.tar.xz |
powerpc: Don't try to fix up misaligned load-with-reservation instructions
commit 48fe9e9488743eec9b7c1addd3c93f12f2123d54 upstream.
In the past, there was only one load-with-reservation instruction,
lwarx, and if a program attempted a lwarx on a misaligned address, it
would take an alignment interrupt and the kernel handler would emulate
it as though it was lwzx, which was not really correct, but benign since
it is loading the right amount of data, and the lwarx should be paired
with a stwcx. to the same address, which would also cause an alignment
interrupt which would result in a SIGBUS being delivered to the process.
We now have 5 different sizes of load-with-reservation instruction. Of
those, lharx and ldarx cause an immediate SIGBUS by luck since their
entries in aligninfo[] overlap instructions which were not fixed up, but
lqarx overlaps with lhz and will be emulated as such. lbarx can never
generate an alignment interrupt since it only operates on 1 byte.
To straighten this out and fix the lqarx case, this adds code to detect
the l[hwdq]arx instructions and return without fixing them up, resulting
in a SIGBUS being delivered to the process.
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/powerpc/net')
0 files changed, 0 insertions, 0 deletions