Bug 1839030 - RFE: enable the "memfd" memory backend
Summary: RFE: enable the "memfd" memory backend
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.3
Hardware: Unspecified
OS: Unspecified
high
urgent
Target Milestone: rc
: 8.3
Assignee: Marc-Andre Lureau
QA Contact: Yumei Huang
URL:
Whiteboard:
: 1837334 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-22 11:11 UTC by Daniel Berrangé
Modified: 2021-03-10 03:47 UTC (History)
9 users (show)

Fixed In Version: qemu-kvm-4.2.0-23.module+el8.2.1+6917+927fbb44
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-28 07:13:31 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:3172 0 None None None 2020-07-28 07:14:27 UTC

Description Daniel Berrangé 2020-05-22 11:11:12 UTC
Description of problem:
The "memfd" memory backend in QEMU provides a way to back QEMU guest RAM with sharable memory that does not have to be backed by files. This supports use of both normal sized and huge pages.

This is desirable to support for KubeVirt, because their containers are blocked from accessing /dev/hugepages mount point with the default OpenShift SELinux policy. The memfd backend should give them a way to use hugepages without needing access to the mount point, thus eliminating a deployment permissions hurdle.

Version-Release number of selected component (if applicable):
qemu-4.2.0-19.el8_2

How reproducible:
Always

Steps to Reproduce:
1. # /usr/libexec/qemu-kvm     -object memory-backend-memfd,id=mem1,hugetlb=yes,hugetlbsize=2097152,size=268435456

Actual results:

qemu-kvm: -object memory-backend-memfd,id=mem1,size=1G: invalid object type: memory-backend-memfd


Expected results:

QEMU boots with huge pages used and /dev/hugepages does not need to be mounted / accessible

Comment 1 John Ferlan 2020-05-22 20:35:54 UTC
See bug 1837334 which links to bug 1738626 (explicit removal downstream in 8.1) as well as a couple of other bugs that would need to be unwound.

This could be duped there or vice-versa I believe.

Assigning to Marc-Andre for now so we can figure the best way forward as it seems from the removal description that more work is necessary.

Setting prio to high so that to work towards getting an answer more quickly.

Comment 3 Danilo de Paula 2020-05-25 19:16:58 UTC
Setting ITR=8.2.1 as the patch was sent targetting 8.2.1
Marc Andre, please check if this is intended.

@QA: QA_ACK, please.

Comment 4 John Ferlan 2020-05-26 19:57:22 UTC
*** Bug 1837334 has been marked as a duplicate of this bug. ***

Comment 8 Yumei Huang 2020-06-05 06:24:30 UTC
Verify:
qemu-kvm-4.2.0-23.module+el8.2.1+6917+927fbb44
kernel-4.18.0-193.6.1.el8_2.x86_64

Steps: Setup hugepages on host, boot guest with memory-backend-memfd, and hotplug memory with memory-backend-memfd, guest works well, host hugepages are consumed as expected.

QEMU cli:
/usr/libexec/qemu-kvm \
    -m 4G,slots=20,maxmem=20G \
    -object memory-backend-memfd,id=mem1,hugetlb=yes,hugetlbsize=2M,size=1G \
    -device pc-dimm,id=dimm1,memdev=mem1 \
    ...

Hotplug memory,
(qemu) object_add memory-backend-memfd,id=mem2,hugetlb=yes,hugetlbsize=2M,size=1G
(qemu) device_add pc-dimm,memdev=mem2,id=dimm2

Comment 10 errata-xmlrpc 2020-07-28 07:13:31 UTC
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/RHBA-2020:3172


Note You need to log in before you can comment on or make changes to this bug.