x86/shadow: shrink struct page_info's shadow_flags to 16 bits
authorJan Beulich <jbeulich@suse.com>
Tue, 20 Nov 2018 14:34:51 +0000 (15:34 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 20 Nov 2018 14:34:51 +0000 (15:34 +0100)
commitbbe48b5b67ccebbc73342bfd34603c4859cde4df
tree2a79e14443e9ce35c009f55f80ac4d7d20155b47
parent93177f1f0fe543e310098938eeabec6c2db14c27
x86/shadow: shrink struct page_info's shadow_flags to 16 bits

This is to avoid it overlapping the linear_pt_count field needed for PV
domains. Introduce a separate, HVM-only pagetable_dying field to replace
the sole one left in the upper 16 bits.

Note that the accesses to ->shadow_flags in shadow_{pro,de}mote() get
switched to non-atomic, non-bitops operations, as {test,set,clear}_bit()
are not allowed on uint16_t fields and hence their use would have
required ugly casts. This is fine because all updates of the field ought
to occur with the paging lock held, and other updates of it use |= and
&= as well (i.e. using atomic operations here didn't really guard
against potentially racing updates elsewhere).

This is part of XSA-280.

Reported-by: Prgmr.com Security <security@prgmr.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Tim Deegan <tim@xen.org>
master commit: 789589968ed90e82a832dbc60e958c76b787be7e
master date: 2018-11-20 14:59:54 +0100
xen/arch/x86/mm/shadow/common.c
xen/arch/x86/mm/shadow/multi.c
xen/arch/x86/mm/shadow/private.h
xen/include/asm-x86/mm.h