x86/mm: avoid inadvertently degrading a TLB flush to local only
authorDavid Vrabel <dvrabel@amazon.co.uk>
Wed, 20 Apr 2022 08:55:01 +0000 (10:55 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 20 Apr 2022 08:55:01 +0000 (10:55 +0200)
commit78e072bc375043e81691a59454e09f0b38241ddd
treee162cdd2e010bf505cba1d7e013d972cc2d3d2a8
parenta1545fbf45c689aff39ce76a6eaa609d32ef72a7
x86/mm: avoid inadvertently degrading a TLB flush to local only

If the direct map is incorrectly modified with interrupts disabled,
the required TLB flushes are degraded to flushing the local CPU only.

This could lead to very hard to diagnose problems as different CPUs will
end up with different views of memory. Although, no such issues have yet
been identified.

Change the check in the flush_area() macro to look at system_state
instead. This defers the switch from local to all later in the boot
(see xen/arch/x86/setup.c:__start_xen()). This is fine because
additional PCPUs are not brought up until after the system state is
SYS_STATE_smp_boot.

Signed-off-by: David Vrabel <dvrabel@amazon.co.uk>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/mm.c