mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
XSA-273 involves one hyperthread being able to use Spectre-like
techniques to "spy" on another thread. The details are somewhat
complicated, but the upshot is that after all Xen-based mitigations
have been applied:
* PV guests cannot spy on sibling threads
* HVM guests can spy on sibling threads
(NB that for purposes of this vulnerability, PVH and HVM guests are
identical. Whenever this comment refers to 'HVM', this includes PVH.)
There are many possible mitigations to this, including disabling
hyperthreading entirely. But another solution would be:
* Specify some cores as PV-only, others as PV or HVM
* Allow HVM guests to only run on thread 0 of the "HVM-or-PV" cores
* Allow PV guests to run on the above cores, as well as any thread of the PV-only cores.
For example, suppose you had 16 threads across 8 cores (0-7). You
could specify 0-3 as PV-only, and 4-7 as HVM-or-PV. Then you'd set
the affinity of the HVM guests as follows (binary representation):
0000000010101010
And the affinity of the PV guests as follows:
1111111110101010
In order to make this easy, this patches introduces three "global affinity
masks", placed in xl.conf:
vm.cpumask
vm.hvm.cpumask
vm.pv.cpumask
These are parsed just like the 'cpus' and 'cpus_soft' options in the
per-domain xl configuration files. The resulting mask is AND-ed with
whatever mask results at the end of the xl configuration file.
`vm.cpumask` would be applied to all guest types, `vm.hvm.cpumask`
would be applied to HVM and PVH guest types, and `vm.pv.cpumask`
would be applied to PV guest types.
The idea would be that to implement the above mask across all your
VMs, you'd simply add the following two lines to the configuration
file:
vm.hvm.cpumask=8,10,12,14
vm.pv.cpumask=0-8,10,12,14
See xl.conf manpage for details.
This is part of XSA-273 / CVE-2018-3646.
Signed-off-by: George Dunlap <george.dunlap@citrix.com>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
(cherry picked from commit aa67b97ed3)
PVH guest type in toolstack is not available in this version of Xen.
Change code and manpage to cope.
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Xen Control Tools - Examples
===================================
This directory contains example scripts and configurations for Xen.
For many operations you will either be able to use these scripts directly, or
incorporate code from them into your own scripts.
If you write a useful script and would like to share it, please do
send it (preferably with a little summary to go in this file) to
<xen-devel@lists.sourceforge.net> so we can add it to this directory.
block - called by xen-backend.agent to bind/unbind dev
block-common.sh - sourced by block, block-*
block-enbd - binds/unbinds network block devices
block-nbd - binds/unbinds network block devices
cpupool - example configuration script for 'xm cpupool-create'
external-device-migrate - called by xend for migrating external devices
locking.sh - locking functions to prevent concurrent access to
critical sections inside script files
logging.sh - logging function to log output using syslog
vif-bridge - virtual network start/stop script in bridged mode
vif-common.sh - sourced by vif-bridge
vif-nat - xen virtual network start/stop script in NAT mode
vif-route - xen virtual network start/stop script in routed mode
xen-backend.agent - calls block, vif-* scripts to add, remove, hotplug
devices
xen-hotplug-common.sh - sourced by vif-common.sh
xen-network-common.sh - sourced by vif-common.sh
xen-script-common.sh - sourced by xen-hotplug-common.sh
xmexample1 - example configuration script for 'xm create'
xmexample2 - a more complex configuration script for 'xm create'
xmexample3 - an advanced configuration script for 'xm create'
that utilizes the vmid
xmexample.nbd - configuration script that uses NBD filesystems
xmexample.hvm - a configuration script for creating a hvm domain with
'xm create'
xmexample.hvm-stubdom - a configuration script for creating a hvm domain with
'xm create' that utilizes a stubdomain for device model
xmexample.pv-grub - a configuration script for creating a domain with 'xm create'
which boots PV-GRUB.
xmexample.vti - a configuration script for creating a domain on vti