Volumes and vNICs are being hot plugged into SEV based instances without iommu='on' causing failures to attach and later detach within the guest OS
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Undecided
|
Lee Yarwood | ||
Train |
New
|
Undecided
|
Unassigned | ||
Ussuri |
New
|
Undecided
|
Unassigned | ||
Victoria |
New
|
Undecided
|
Unassigned | ||
Wallaby |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Description
===========
After successfully attaching a disk to a SEV enabled instance the request to detach the disk never completes with the following trace eventually logged regarding the initial attach:
[ 7.773877] pcieport 0000:00:02.5: Slot(0-5): Attention button pressed
[ 7.774743] pcieport 0000:00:02.5: Slot(0-5) Powering on due to button press
[ 7.775714] pcieport 0000:00:02.5: Slot(0-5): Card present
[ 7.776403] pcieport 0000:00:02.5: Slot(0-5): Link Up
[ 7.903183] pci 0000:06:00.0: [1af4:1042] type 00 class 0x010000
[ 7.904095] pci 0000:06:00.0: reg 0x14: [mem 0x00000000-
[ 7.905024] pci 0000:06:00.0: reg 0x20: [mem 0x00000000-
[ 7.906977] pcieport 0000:00:02.5: bridge window [io 0x1000-0x0fff] to [bus 06] add_size 1000
[ 7.908069] pcieport 0000:00:02.5: BAR 13: no space for [io size 0x1000]
[ 7.908917] pcieport 0000:00:02.5: BAR 13: failed to assign [io size 0x1000]
[ 7.909832] pcieport 0000:00:02.5: BAR 13: no space for [io size 0x1000]
[ 7.910667] pcieport 0000:00:02.5: BAR 13: failed to assign [io size 0x1000]
[ 7.911586] pci 0000:06:00.0: BAR 4: assigned [mem 0x800600000-
[ 7.912616] pci 0000:06:00.0: BAR 1: assigned [mem 0x80400000-
[ 7.913472] pcieport 0000:00:02.5: PCI bridge to [bus 06]
[ 7.915762] pcieport 0000:00:02.5: bridge window [mem 0x80400000-
[ 7.917525] pcieport 0000:00:02.5: bridge window [mem 0x800600000-
[ 7.920252] virtio-pci 0000:06:00.0: enabling device (0000 -> 0002)
[ 7.924487] virtio_blk virtio4: [vdb] 2097152 512-byte logical blocks (1.07 GB/1.00 GiB)
[ 7.926616] vdb: detected capacity change from 0 to 1073741824
[ .. ]
[ 246.751028] INFO: task irq/29-pciehp:173 blocked for more than 120 seconds.
[ 246.752801] Not tainted 4.18.0-
[ 246.753902] "echo 0 > /proc/sys/
[ 246.755457] irq/29-pciehp D 0 173 2 0x80004000
[ 246.756616] Call Trace:
[ 246.757328] __schedule+
[ 246.758185] schedule+0x38/0xa0
[ 246.758966] io_schedule+
[ 246.759801] do_read_
[ 246.760761] ? blkdev_
[ 246.761692] ? file_fdatawait_
[ 246.762659] read_part_
[ 246.763554] read_lba+
[ 246.764367] efi_partition+
[ 246.765245] ? snprintf+0x49/0x60
[ 246.766046] ? is_gpt_
[ 246.766991] blk_add_
[ 246.767915] ? blk_drop_
[ 246.768863] bdev_disk_
[ 246.769748] __blkdev_
[ 246.770595] blkdev_
[ 246.771394] __device_
[ 246.772302] virtblk_
[ 246.773313] virtio_
[ 246.774208] really_
[ 246.775046] ? __driver_
[ 246.776091] driver_
[ 246.776965] bus_for_
[ 246.777813] __device_
[ 246.778669] bus_probe_
[ 246.779523] device_
[ 246.780321] register_
[ 246.781254] virtio_
[ 246.782124] local_pci_
[ 246.782937] pci_device_
[ 246.783807] really_
[ 246.784623] ? __driver_
[ 246.785647] driver_
[ 246.786526] bus_for_
[ 246.787364] __device_
[ 246.788205] pci_bus_
[ 246.789063] pci_bus_
[ 246.789916] pciehp_
[ 246.790855] pciehp_
[ 246.791985] pciehp_
[ 246.792768] ? irq_finalize_
[ 246.793768] irq_thread_
[ 246.794550] irq_thread+
[ 246.795299] ? irq_forced_
[ 246.796190] ? irq_thread_
[ 246.797147] kthread+0x116/0x130
[ 246.797841] ? kthread_
[ 246.798735] ret_from_
[ 246.799523] INFO: task sfdisk:1129 blocked for more than 120 seconds.
[ 246.800717] Not tainted 4.18.0-
[ 246.801733] "echo 0 > /proc/sys/
[ 246.803155] sfdisk D 0 1129 1107 0x00004080
[ 246.804225] Call Trace:
[ 246.804827] __schedule+
[ 246.805590] ? submit_
[ 246.806373] schedule+0x38/0xa0
[ 246.807089] schedule_
[ 246.807990] __mutex_
[ 246.808876] ? wake_up_q+0x80/0x80
[ 246.809636] ? fdatawait_
[ 246.810508] iterate_
[ 246.811304] ksys_sync+0x6e/0xb0
[ 246.812041] __ia32_
[ 246.812820] do_syscall_
[ 246.813613] entry_SYSCALL_
[ 246.814652] RIP: 0033:0x7fa9c04924fb
[ 246.815431] Code: Unable to access opcode bytes at RIP 0x7fa9c04924d1.
[ 246.816655] RSP: 002b:00007fff47
[ 246.818047] RAX: ffffffffffffffda RBX: 000055d79fc512f0 RCX: 00007fa9c04924fb
[ 246.824526] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 000055d79fc512f0
[ 246.825714] RBP: 0000000000000000 R08: 000055d79fc51012 R09: 0000000000000006
[ 246.826941] R10: 000000000000000a R11: 0000000000000246 R12: 00007fa9c075e6e0
[ 246.828169] R13: 000055d79fc58c80 R14: 0000000000000001 R15: 00007fff47661590
This is caused by the device XML supplied to libvirt missing the driver iommu attribute:
<disk type="block" device="disk">
<driver name="qemu" type="raw" cache="none" io="native"/>
<source dev="/dev/sdc"/>
<target bus="virtio" dev="vdb"/>
<serial>
</disk>
As called out in the original SEV spec this is required:
https:/
> The iommu attribute is on for all virtio devices.
> Despite the name, this does not require the guest
> or host to have an IOMMU device, but merely enables
> the virtio flag which indicates that virtualized DMA
> should be used. This ties into the SEV code to handle
> memory encryption/
> being shared between host and guest.
>
> The DMA will go through bounce buffers, so some
> overhead is expected compared to non-SEV guests.
>
> (Note: virtio-net device queues are not encrypted.)
Steps to reproduce
==================
1. Hot plug a PCIe device into a SEV enabled instance.
Expected result
===============
Hot plug succeeds and the device is visible within the instance.
Actual result
=============
Hot plug appears to succeed but the device is never present within the instance and a trace is later logged.
Environment
===========
1. Exact version of OpenStack you are running. See the following
list for all releases: http://
master
2. Which hypervisor did you use?
(For example: Libvirt + KVM, Libvirt + XEN, Hyper-V, PowerKVM, ...)
What's the version of that?
libvirt + KVM
2. Which storage type did you use?
(For example: Ceph, LVM, GPFS, ...)
What's the version of that?
N/A
3. Which networking type did you use?
(For example: nova-network, Neutron with OpenVSwitch, ...)
N/A
Logs & Configs
==============
[OSP 16.2] Volumes and vNICs are being hot plugged into SEV based instances without iommu='on' causing failures to attach and later detach within the guest OS
https:/
Fix proposed to branch: master /review. opendev. org/c/openstack /nova/+ /794639
Review: https:/