x86/sev-es: Set x86_virt_bits to the correct value straight away, instead of a two...
authorAdam Dunlap <acdunlap@google.com>
Tue, 12 Sep 2023 00:27:03 +0000 (17:27 -0700)
committerIngo Molnar <mingo@kernel.org>
Thu, 28 Sep 2023 20:49:35 +0000 (22:49 +0200)
commitfbf6449f84bf5e4ad09f2c09ee70ed7d629b5ff6
tree27bb88c20296db7479f423dbe25bd06e7fa11ec6
parentf79936545fb122856bd78b189d3c7ee59928c751
x86/sev-es: Set x86_virt_bits to the correct value straight away, instead of a two-phase approach

Instead of setting x86_virt_bits to a possibly-correct value and then
correcting it later, do all the necessary checks before setting it.

At this point, the #VC handler references boot_cpu_data.x86_virt_bits,
and in the previous version, it would be triggered by the CPUIDs between
the point at which it is set to 48 and when it is set to the correct
value.

Suggested-by: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Adam Dunlap <acdunlap@google.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Jacob Xu <jacobhxu@google.com>
Link: https://lore.kernel.org/r/20230912002703.3924521-3-acdunlap@google.com
arch/x86/kernel/cpu/common.c