]> xenbits.xensource.com Git - xen.git/commit
x86/tboot: disable interrupts after map_pages_to_xen() in tboot_shutdown()
authorChristopher Clark <christopher.clark6@baesystems.com>
Thu, 10 Aug 2017 10:34:58 +0000 (12:34 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 10 Aug 2017 10:34:58 +0000 (12:34 +0200)
commit80eb3da01bc4378af537d60e3d55767acf0d16ea
treebcbe34ba57b052a0353c9938f932be1dd5117329
parent7c275549f46c5c46611592f7107c1345e93ed457
x86/tboot: disable interrupts after map_pages_to_xen() in tboot_shutdown()

Move the point where interrupts are disabled in tboot_shutdown
to slightly later, to after the call to map_pages_to_xen.

This patch originated in OpenXT with the following report:

"Disabling interrupts early causes debug assertions.

This is only seen with debug builds but since it causes assertions it is
probably a bigger problem. It clearly says in map_pages_to_xen that it
should not be called with interrupts disabled. Moved disabling to just
after that call."

The Xen code comment ahead of map_pages_to_xen notes that the CPU cache
flushing in map_pages_to_xen differs depending on whether interrupts are
enabled or not. The flush logic with interrupts enabled is more
conservative, flushing all CPUs' TLBs/caches, rather than just local.
This is just before the tboot memory integrity MAC calculation is performed
in the case of entering S3.

Original patch author credit: Ross Philipson.

Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/tboot.c