is_control_domain: block speculation
authorNorbert Manthey <nmanthey@amazon.de>
Thu, 14 Mar 2019 12:56:00 +0000 (13:56 +0100)
committerJan Beulich <jbeulich@suse.com>
Fri, 5 Apr 2019 10:15:04 +0000 (12:15 +0200)
commit3a6db700619b049564d14688d711e0e69691b181
tree9a2c1b957771e4cdc7d1467aad84c0ae970453b6
parentdb591d6e76ed33750039e44a75108809681ed672
is_control_domain: block speculation

Checks of domain properties, such as is_hardware_domain or is_hvm_domain,
might be bypassed by speculatively executing these instructions. A reason
for bypassing these checks is that these macros access the domain
structure via a pointer, and check a certain field. Since this memory
access is slow, the CPU assumes a returned value and continues the
execution.

In case an is_control_domain check is bypassed, for example during a
hypercall, data that should only be accessible by the control domain could
be loaded into the cache.

This is part of the speculative hardening effort.

Signed-off-by: Norbert Manthey <nmanthey@amazon.de>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/include/xen/sched.h