VT-x: simplify/clarify vmx_load_pdptrs()
authorJan Beulich <jbeulich@suse.com>
Tue, 14 Jul 2020 08:00:45 +0000 (10:00 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 14 Jul 2020 08:00:45 +0000 (10:00 +0200)
commit1969576661f3e34318e9b0a61a1a38f9a5aee16f
tree6a20e7a5119947133c03b763c8ea0288b6110be6
parentf36f4bf582d353d8424154b14b663b075a0276e3
VT-x: simplify/clarify vmx_load_pdptrs()

* Guests outside of long mode can't have PCID enabled. Drop the
  respective check to make more obvious that there's no security issue
  (from potentially accessing past the mapped page's boundary).

* Only bits 5...31 of CR3 are relevant in 32-bit PAE mode; all others
  are ignored. The high 32 ones may in particular have remained
  unchanged after leaving long mode.

* Drop the unnecessary and badly typed local variable p.

* Don't open-code hvm_long_mode_active() (and extend this to the related
  nested VT-x code).

* Constify guest_pdptes to clarify that we're only reading from the
  page.

* Drop the "crash" label now that there's only a single path leading
  there.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/hvm/vmx/vvmx.c