Peter Zijlstra 1cd5f059d9 x86,static_call: Fix __static_call_return0 for i386
Paolo reported that the instruction sequence that is used to replace:

    call __static_call_return0

namely:

    66 66 48 31 c0	data16 data16 xor %rax,%rax

decodes to something else on i386, namely:

    66 66 48		data16 dec %ax
    31 c0		xor    %eax,%eax

Which is a nonsensical sequence that happens to have the same outcome.
*However* an important distinction is that it consists of 2
instructions which is a problem when the thing needs to be overwriten
with a regular call instruction again.

As such, replace the instruction with something that decodes the same
on both i386 and x86_64.

Fixes: 3f2a8fc4b15d ("static_call/x86: Add __static_call_return0()")
Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20220318204419.GT8939@worktop.programming.kicks-ass.net
2022-04-05 09:59:37 +02:00
..
2022-01-23 06:20:44 +02:00
2022-03-28 12:41:28 -07:00
2022-01-11 10:25:36 -08:00
2022-03-15 10:32:40 +01:00
2020-11-24 16:47:49 +01:00
2021-11-02 22:22:13 -07:00
2022-02-25 09:36:05 +01:00
2022-03-15 10:32:41 +01:00
2021-03-18 15:31:53 +01:00
2022-03-15 10:32:36 +01:00
2021-12-01 00:06:43 +01:00
2022-03-28 17:29:53 -07:00
2021-03-18 15:31:53 +01:00
2022-03-10 16:51:51 -06:00
2022-02-25 09:36:05 +01:00
2020-08-20 13:12:58 +02:00
2021-10-25 23:02:36 -04:00
2022-03-21 12:28:13 -07:00