Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionAlex Williamson
2019-01-17 20:38:20 UTC
Description of problem:
On an AMD SEV enabled host with an SEV enabled guest, attaching an assigned device to the VM results in a failure to start the VM:
qemu-kvm: -device vfio-pci,host=01:00.0,id=hostdev0,bus=pci.2,addr=0x0: sev_ram_block_added: failed to register region (0x7fd96e6bb000+0x20000) error 'Cannot allocate memory'
In this case the assigned device is a simple Intel 82574L NIC:
01:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
Subsystem: Intel Corporation Gigabit CT Desktop Adapter
Flags: bus master, fast devsel, latency 0, IRQ 89, NUMA node 0
Memory at fb9c0000 (32-bit, non-prefetchable) [size=128K]
Memory at fb900000 (32-bit, non-prefetchable) [size=512K]
Note the error indicates the region as (base+size) where a size of 0x20000 is 128K, which matches that of BAR0 for the device. dmesg on the host also reports:
SVM: SEV: Failure locking 32 pages.
Further analysis shows that SEV guests make use of the RAMBlock notifier in QEMU to add page pinnings for SEV where the kernel side of the call only knows how to pin pages with get_user_pages() which faults on non-page backed mappings such as the mmap of an MMIO BAR.
Consulting with AMD, Brijesh is aware of this issue an intends to post patches upstream to make the ram_device flag of the region visible to the SEV code such that these regions can be skipped in QEMU.
Version-Release number of selected component (if applicable):
kernel-4.18.0-61.el8.x86_64
qemu-kvm-2.12.0-57.module+el8+2683+02b3b955.x86_64
How reproducible:
100%
Steps to Reproduce:
1. add a vfio-pci assigned device to a host and VM previously configured with SEV support enabled
2.
3.
Actual results:
VM fails to launch
Expected results:
VM works normally
Additional info:
Comment 5Gary R Hook (AMD)
2019-03-13 22:01:53 UTC
Waiting for them to be added to the repo...
Comment 6Gary R Hook (AMD)
2019-04-05 22:19:54 UTC
Patches are ready; trying to figure out how to submit.
Looks like I need:
The ITR field in this BZ set.
Move this to RHEL-8.1 qemu-kvm (I'll submit to RHEL-8.1.0)
Clone this to RHEL-AV-8.0.1 (To submit to RHEL-AV-8.0.1 as a bug fix)
...I think?
Karen I got some guidance from Danilo, but there appear to be several things amiss here. Hoping you can provide guidance?
(In reply to Gary R Hook from comment #6)
> Patches are ready; trying to figure out how to submit.
>
> Looks like I need:
>
> The ITR field in this BZ set.
Done.
> Move this to RHEL-8.1 qemu-kvm (I'll submit to RHEL-8.1.0)
> Clone this to RHEL-AV-8.0.1 (To submit to RHEL-AV-8.0.1 as a bug fix)
>
> ...I think?
>
> Karen I got some guidance from Danilo, but there appear to be several things
> amiss here. Hoping you can provide guidance?
What is the upstream QEMU version? And the upstream commit IDs?
Comment #4 references 2 kernel patches. Is there different BZ for those? Thanks!
Comment 9Gary R Hook (AMD)
2019-04-08 13:53:32 UTC
The two patches go together as a set. Both should be applied to 2.x and 3.x. (i.e. these need to go onto RHEL 8 (for qemu 2.12) in z-stream, and into whatever version is part of 8.1.
Upstream commits are
2ddb89b00f947f785c9ca6742f28f954e3b75e62
cedc0ad539afbbb669dba9e73dfad2915bc1c25b
Since this BZ is intended for 8.0 I'll need another BZ for 8.1. I've not opened that yet.
I'm trying to understand how to set up my patch post but the qemu version / repo branch / product name combinations are still confusing me. Have been asking Danilo for guidance.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2019:3345