nova/nova/virt/libvirt
Boris Bobrov cedc850e4e Apply SEV-specific guest config when SEV is required
Add a new sev_enabled() function to the libvirt utils to detect that
SEV is required and return True if and only if the following are both
true:

  a) the supports_amd_sev instance variable in the host is
     true, *and*

  b) the instance extra specs and/or image properties request
     memory encryption to be enabled.

In this case we know that SEV functionality is required, so tweak the
guest config accordingly in various ways:

- Ensure that the machine type is some q35 variant.  If the image had
  an hw_machine_type property requesting some other type, an
  InvalidMachineType exception will be raised.

- Set the "iommu" attribute to "on" for all relevant devices including
  disk / network devices, but excluding input/graphics/video/serial
  devices.  This is achieved via a new set_driver_iommu_for_sev()
  method added to nova.virt.libvirt.designer.  In order to test this
  thoroughly, beef up the fake KVM guest fixture with extra devices
  of each type.

- Add the <launchSecurity> element to enable use of SEV.  Two related
  configuration values are extracted from domain capabilities and set
  on the element.

- Enable memory locking.  All the memory pages allocated by QEMU must
  be pinned for SEV, which is achieved via <memoryBacking> and <locked />
  elements.

blueprint: amd-sev-libvirt-support
Change-Id: Ie54fca066f3333d1d5d18a2c0e8f6c7d5042490b
2019-09-10 13:59:02 +01:00
..
storage Merge "rbd: use MAX_AVAIL stat for reporting bytes available" 2019-08-29 13:49:46 +00:00
volume libvirt: use native AIO mode for StorPool Cinder volumes. 2019-08-27 15:21:51 +03:00
__init__.py Remove vi modelines 2014-02-03 14:19:44 +00:00
blockinfo.py libvirt: Use SATA bus for cdrom devices when using Q35 machine type 2019-06-12 08:00:45 +00:00
config.py Apply SEV-specific guest config when SEV is required 2019-09-10 13:59:02 +01:00
designer.py Apply SEV-specific guest config when SEV is required 2019-09-10 13:59:02 +01:00
driver.py Apply SEV-specific guest config when SEV is required 2019-09-10 13:59:02 +01:00
firewall.py Add missing ws seperator between words 2018-11-26 23:42:18 +00:00
guest.py Avoid logging traceback when detach device not found 2019-07-19 00:04:37 +00:00
host.py Merge "Provide HW_CPU_X86_AMD_SEV trait when SEV is supported" 2019-08-31 16:07:44 +00:00
imagebackend.py Get rid of args to RBDDriver.__init__() 2019-07-29 08:02:19 +00:00
imagecache.py config: remove deprecated checksum options 2019-08-15 11:47:51 -04:00
instancejobtracker.py Remove translation of log messages 2017-06-13 11:20:28 +07:00
migration.py hacking: Resolve W503 (line break occurred before a binary operator) 2019-06-24 14:24:06 -05:00
utils.py Merge "Add the support of CPU feature 'AVX512-VNNI'" 2019-08-05 11:54:46 +00:00
vif.py [Trivial]Remove unused helper get_vif_devname_with_prefix 2019-08-23 13:28:38 +08:00