x86/shadow: encode full GFN in magic MMIO entries
authorJan Beulich <jbeulich@suse.com>
Fri, 9 Apr 2021 07:20:15 +0000 (09:20 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 9 Apr 2021 07:20:15 +0000 (09:20 +0200)
commite113ed7134118757980a1d12837fa0f118f81a05
treee2616f8922fd122f3ed8728574dd2c9df658592c
parentbed7e6cad30ec8db0c9ce9a1676856e9dc4c39da
x86/shadow: encode full GFN in magic MMIO entries

Since we don't need to encode all of the PTE flags, we have enough bits
in the shadow entry to store the full GFN. Limit use of literal numbers
a little and instead derive some of the involved values. Sanity-check
the result via BUILD_BUG_ON()s.

This then allows dropping from sh_l1e_mmio() again the guarding against
too large GFNs. It needs replacing by an L1TF safety check though, which
in turn requires exposing cpu_has_bug_l1tf.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/shadow/types.h
xen/arch/x86/spec_ctrl.c
xen/include/asm-x86/spec_ctrl.h