kaiser: use ALTERNATIVE instead of x86_cr3_pcid_noflush
authorHugh Dickins <hughd@google.com>
Wed, 4 Oct 2017 03:49:04 +0000 (20:49 -0700)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 7 Jan 2018 01:46:52 +0000 (01:46 +0000)
commitd5b72db20d3c252172f5bb4ea862a1a47e53c488
treec721db1a742e5260a03ba948147cabfd20ab95fd
parent95fdffcc2c581654627e79553b45180da58793a7
kaiser: use ALTERNATIVE instead of x86_cr3_pcid_noflush

Now that we're playing the ALTERNATIVE game, use that more efficient
method: instead of user-mapping an extra page, and reading an extra
cacheline each time for x86_cr3_pcid_noflush.

Neel has found that __stringify(bts $X86_CR3_PCID_NOFLUSH_BIT, %rax)
is a working substitute for the "bts $63, %rax" in these ALTERNATIVEs;
but the one line with $63 in looks clearer, so let's stick with that.

Worried about what happens with an ALTERNATIVE between the jump and
jump label in another ALTERNATIVE?  I was, but have checked the
combinations in SWITCH_KERNEL_CR3_NO_STACK at entry_SYSCALL_64,
and it does a good job.

(cherry picked from Change-Id: I46d06167615aa8d628eed9972125ab2faca93f05)

Signed-off-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/x86/include/asm/kaiser.h
arch/x86/kernel/entry_64.S
arch/x86/mm/kaiser.c