Bug 1848887

Summary: [ppc][nvdimm]the guest with device nvdimm specified shouldn't boot up with "nvdimm=off"
Product: Red Hat Enterprise Linux Advanced Virtualization Reporter: Min Deng <mdeng>
Component: qemu-kvmAssignee: Daniel Henrique Barboza (IBM) <dbarboza>
qemu-kvm sub component: QMP Monitor and CLI QA Contact: Min Deng <mdeng>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: bfu, bugproxy, dbarboza, ddepaula, dgibson, hannsj_uhl, mdeng, mrezanin, ngu, qzhang, virt-maint, xuma, yihyu, zhenyzha
Version: 8.3Keywords: Patch, Triaged
Target Milestone: rc   
Target Release: 8.4   
Hardware: ppc64le   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-5.2.0-0.module+el8.4.0+8855+a9e237a9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-25 06:42:15 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1718461    
Bug Blocks: 1796871    

Description Min Deng 2020-06-19 07:35:57 UTC
Description of problem:
[ppc][nvdimm]the guest with device nvdimm specified in cmdline shouldn't  boot up with "nvdimm=off"

Version-Release number of selected component (if applicable):
kernel-4.18.0-211.el8.ppc64le
qemu-kvm-5.0.0-0.module+el8.3.0+6620+5d5e1420.ppc64le

How reproducible:
always

Steps to Reproduce:
1.boot up guest with 
...-machine pseries,nvdimm=off -object memory-backend-file,id=mem1,share=on,mem-path=/tmp/nvdimm1,size=1G -device nvdimm,memdev=mem1,id=nv1,label-size=512M,uuid=2b9ee44f-d390-4ad2-afd9-b84b1f31dbdf ...
2.
3.

Actual results:
The guest boot up successfully.

Expected results:
The guest shouldn't boot up, the guest with "-device nvdimm" specified shouldn't boot up because of "nvdimm=off",


Additional info:
Just for reference,the result was from x86.
# /usr/libexec/qemu-kvm -M pc,nvdimm=off -object memory-backend-file,id=mem0,size=1G,mem-path=/tmp/aa -device nvdimm,id=dimm0,memdev=mem0
qemu-kvm: -device nvdimm,id=dimm0,memdev=mem0: nvdimm is not enabled: missing 'nvdimm' in '-M'

Comment 1 Daniel Henrique Barboza (IBM) 2020-08-28 14:07:51 UTC
I posted patches upstream for this a few days ago and forgot to
mention it here:

https://lists.gnu.org/archive/html/qemu-devel/2020-08/msg06472.html


David accepted the fixes in his ppc-for-5.2 branch.

I wasn't able to make this option behave like other archs, specially
the behavior of disabling support by default like x86 does. The reason
is that the NVDIMM support for pSeries was released in 5.1 ignoring this
option altogether, assuming the default = enable support.

This puts the fix in a strange spot: if I change the support to be like x86,
I'll break existing pseries-5.1 users that are using NVDIMM without
specifying the 'nvdimm' option. If I leave pseries-5.1 alone and change
pseries-5.2 to be like x86, I'll change NVDIMM behavior between pseries 5.1
and 5.2, potentially breaking people doing machine updates.

What was done then is to do what we know it's reasonable to do in all
cases, and what the bug proposes: if the user explicitly puts "nvdimm=off"
in the command line, we will disable NVDIMM support regardless of the
machine version.

Comment 2 David Gibson 2020-09-21 04:26:30 UTC
Fix is now merged upstream from my last pull request, moving to POST for RHEL-AV-8.4.

Comment 4 Min Deng 2020-10-26 05:24:49 UTC
According to this piece of comment from https://bugzilla.redhat.com/show_bug.cgi?id=1718461#c20, we need this fix for rhel8.3 too, thanks.

Comment 5 David Gibson 2020-10-28 02:51:57 UTC
Subsequent comments suggest that's not necessary after all.

Comment 6 Min Deng 2020-11-30 02:41:16 UTC
Re-tested the bug, the original issue hasn't been reproduced on qemu-kvm-5.2.0-0.module+el8.4.0+8855+a9e237a9, thanks.

Comment 10 Min Deng 2020-12-16 06:29:35 UTC
Base on comment6 and latest test results,
qemu-kvm-5.2.0-1.module+el8.4.0+9091+650b220a.ppc64le
Move this bug to be verified, thanks a lot.

Comment 13 errata-xmlrpc 2021-05-25 06:42:15 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 (virt:av 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/RHBA-2021:2098