Bug 1963845 - QEMU quit if set nvdimm memory backend option readonly=on
Summary: QEMU quit if set nvdimm memory backend option readonly=on
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: qemu-kvm
Version: unspecified
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Julia Suvorova
QA Contact: Mario Casquero
URL:
Whiteboard:
Depends On: 2135806
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-05-24 07:52 UTC by Yumei Huang
Modified: 2023-05-09 07:41 UTC (History)
9 users (show)

Fixed In Version: qemu-kvm-7.2.0-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-09 07:19:27 UTC
Type: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2023:2162 0 None None None 2023-05-09 07:19:56 UTC

Description Yumei Huang 2021-05-24 07:52:22 UTC
Description of problem:

Boot guest with nvdimm device, set memory backend option readonly=on, qemu quit with error, even when specify unarmed=off as it says. 

(qemu) qemu-kvm: -device nvdimm,id=dimm0,memdev=mem0,unarmed=off: 'unarmed' property must be off since memdev mem0 is read-only


Version-Release number of selected component (if applicable):
qemu-kvm-6.0.0-16.module+el8.5.0+10848+2dccc46d
kernel-4.18.0-304.5.el8.x86_64

How reproducible:
always

Steps to Reproduce:
1. Boot guest with nvdimm device, set memory backend option readonly=on

# /usr/libexec/qemu-kvm -m 4G,slots=8,maxmem=40G -M q35,nvdimm=on \
-object memory-backend-file,id=mem0,mem-path=/mnt/test.pmem,size=1G,readonly=on \
-device nvdimm,id=dimm0,memdev=mem0,unarmed=off \
-monitor stdio


Actual results:
QEMU quits with error message.
(qemu) qemu-kvm: -device nvdimm,id=dimm0,memdev=mem0,unarmed=off: 'unarmed' property must be off since memdev mem0 is read-only

Expected results:
Guest boot up without error.

Additional info:

Comment 1 John Ferlan 2021-06-04 12:25:41 UTC
Assigned to Amnon for initial triage per bz process and age of bug created or assigned to virt-maint without triage.

Comment 2 Yumei Huang 2021-06-18 07:36:11 UTC
BTW, if set unarmed=on, guest can boot up without error.

Comment 3 Eric Hadley 2021-09-08 16:57:34 UTC
Bulk update: Move RHEL-AV bugs to RHEL9. If necessary to resolve in RHEL8, then clone to the current RHEL8 release.

Comment 4 Yumei Huang 2021-09-09 01:42:35 UTC
Reproduced with qemu-kvm-6.1.0-1.el9.

Comment 5 Julia Suvorova 2022-05-31 15:14:22 UTC
AFAIU, the logic is correct, but the error message is not,
e.g. 'unarmed' property must be on when memdev is read-only.

I've posted a patch upstream to fix it:
  [PATCH] hw/mem/nvdimm: fix error message for 'unarmed' flag

Comment 7 John Ferlan 2022-10-26 15:49:39 UTC
I see the upstream patch from comment 5 posted as https://lists.nongnu.org/archive/html/qemu-devel/2022-05/msg06222.html with a follow-up Reviewed-by from Stefan Hajnoczi, but then the thread moves into June with Igor's https://lists.nongnu.org/archive/html/qemu-devel/2022-06/msg02474.html and a lot of subsequent discussion about transferring ownership of the component to David Hildenbrand.

Perhaps just a ping to David can help get this merged... Julia - I left a needinfo on you for this...

Comment 10 Julia Suvorova 2022-11-01 12:50:34 UTC
It is merged upstream now. Updating status.

Comment 13 Mario Casquero 2022-12-20 09:15:26 UTC
Manual test passed on:

dell-per750-24.lab.eng.pek2.redhat.com
qemu-kvm-7.2.0-1.el9.x86_64
5.14.0-212.el9.x86_64

With the following options in the qemu-kvm cmd line:

-object memory-backend-file,size=1G,mem-path=/tmp/nvdimm0,share=yes,readonly=on,id=mem-mem1 \
-device nvdimm,unarmed=off,id=dimm-mem1,memdev=mem-mem1 \

Now qemu quits with the appropiate error:

(qemu) qemu-kvm: -device nvdimm,unarmed=off,id=dimm-mem1,memdev=mem-mem1: 'unarmed' property must be 'on' since memdev mem-mem1 is read-only

If setting 'unarmed' to 'on' then qemu works as expected

Comment 16 Mario Casquero 2022-12-22 08:21:03 UTC
NVDIMM readonly + unarmed tests passed:

dell-per750-24.lab.eng.pek2.redhat.com
qemu-kvm-7.2.0-1.el9.x86_64
5.14.0-212.el9.x86_64

With the following options in the qemu-kvm cmd line:

-object memory-backend-file,size=1G,mem-path=/tmp/nvdimm0,share=yes,readonly=on,id=mem-mem1 \
-device nvdimm,unarmed=off,id=dimm-mem1,memdev=mem-mem1 \

Qemu quits with the appropiate error:

(qemu) qemu-kvm: -device nvdimm,unarmed=off,id=dimm-mem1,memdev=mem-mem1: 'unarmed' property must be 'on' since memdev mem-mem1 is read-only

If setting 'unarmed' to 'on' then qemu works as expected.

Comment 18 errata-xmlrpc 2023-05-09 07:19:27 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 (Moderate: qemu-kvm security, bug fix, and enhancement update), 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-2023:2162


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