x86/entry/64: Switch CR3 before SWAPGS in paranoid entry
authorChang S. Bae <chang.seok.bae@intel.com>
Thu, 28 May 2020 20:13:55 +0000 (16:13 -0400)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 18 Jun 2020 13:47:03 +0000 (15:47 +0200)
commit96b2371413e8f636a5f25c42a933af21c35a2a41
treedd8db560ea94d2a7df4478b2abade4f266a5fd49
parent978e1342c3c4d7b20808fd5875d9ac0d57db22ee
x86/entry/64: Switch CR3 before SWAPGS in paranoid entry

When FSGSBASE is enabled, the GSBASE handling in paranoid entry will need
to retrieve the kernel GSBASE which requires that the kernel page table is
active.

As the CR3 switch to the kernel page tables (PTI is active) does not depend
on kernel GSBASE, move the CR3 switch in front of the GSBASE handling.

Comment the EBX content while at it.

No functional change.

[ tglx: Rewrote changelog and comments ]

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lkml.kernel.org/r/1557309753-24073-11-git-send-email-chang.seok.bae@intel.com
Link: https://lkml.kernel.org/r/20200528201402.1708239-10-sashal@kernel.org
arch/x86/entry/entry_64.S