Bug 1629717
| Summary: | qemu_ram_mmap: Assertion `is_power_of_2(align)' failed | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Yumei Huang <yuhuang> | |
| Component: | qemu-kvm-rhev | Assignee: | David Hildenbrand <dhildenb> | |
| Status: | CLOSED ERRATA | QA Contact: | Yumei Huang <yuhuang> | |
| Severity: | high | Docs Contact: | ||
| Priority: | high | |||
| Version: | 7.6 | CC: | ailan, chayang, hhuang, jinzhao, juzhang, pagupta, plai, virt-maint | |
| Target Milestone: | rc | Keywords: | Regression | |
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | qemu-kvm-rhev-2.12.0-19.el7 | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1630746 (view as bug list) | Environment: | ||
| Last Closed: | 2019-08-22 09:18:53 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: | ||||
| Bug Blocks: | 1630746, 1649160, 1651787 | |||
|
Description
Yumei Huang
2018-09-17 12:00:24 UTC
It is introduced by commit '9837684316 hostmem-file: add "align" option'. Different assert() being hit, but similar problem as bug 1629720. I'm lowering the severity and deferring it to 7.7 + 7.6.z, because I don't think this should block RHEL-7.6, just like bug 1629720. Hi, align option is for host side address alignment. "align=1.5G" is not the correct value and it asserts on `is_power_of_2(align)'. It acts as an indication for the user to restart the VM with appropriate value. This is important file backed memory and needs to be power of 2. Check is for expected behaviour. Don't think its a bug or regression. Thanks, Pankaj (In reply to pagupta from comment #5) > Hi, > > align option is for host side address alignment. "align=1.5G" is not the > correct value and it asserts on `is_power_of_2(align)'. It acts as an > indication for the user to restart the VM with appropriate value. This is > important file backed memory and needs to be power of 2. Check is for > expected behaviour. Don't think its a bug or regression. It's fine to print the error message, but it causes qemu core dumped, which I think is an issue need to be fixed. Besides, if hotplug the backend to a alive guest, qemu would core dumped too, might cause terrible consequence. IMO, that's definitely a bug. Thanks! > > Thanks, > Pankaj (In reply to Yumei Huang from comment #6) > (In reply to pagupta from comment #5) > > Hi, > > > > align option is for host side address alignment. "align=1.5G" is not the > > correct value and it asserts on `is_power_of_2(align)'. It acts as an > > indication for the user to restart the VM with appropriate value. This is > > important file backed memory and needs to be power of 2. Check is for > > expected behaviour. Don't think its a bug or regression. > > It's fine to print the error message, but it causes qemu core dumped, which > I think is an issue need to be fixed. Besides, if hotplug the backend to a > alive guest, qemu would core dumped too, might cause terrible consequence. > IMO, that's definitely a bug. Thanks! Agree, Just thinking what's the right thing to do: 1] Asset VM start if file backed memory is misalign. 2] Throw an error at VM start and allow VM to start with : a) Not properly align file backed memory - might not be the best thing to do. b) Should not allow to add file backed memory if it is not properly aligned. 3] If hotplug backend to live guest also has misalign memory than hotplug interface should check and throw an error thus does not effect live VM. Among these scenarios I feel 1] & 3] should be right thing to do. Thanks, Pankaj Hi,
This is fixed in upstream qemu, version >= v3.0.0. New check is added for align "is_power_of_2" in function "file_ram_alloc". This avoids assert in function "mmap-alloc.c:qemu_ram_mmap".
------------------
commit 61362b71c105ccb151ca16897a7d56534423f390
Author: David Hildenbrand <david>
Date: Thu Jun 7 17:47:05 2018 +0200
exec: check that alignment is a power of two
Right now we can crash QEMU using e.g.
qemu-system-x86_64 -m 256M,maxmem=20G,slots=2 \
-object memory-backend-file,id=mem0,size=12288,mem-path=/dev/zero,align=12288 \
-device pc-dimm,id=dimm1,memdev=mem0
qemu-system-x86_64: util/mmap-alloc.c:115:
qemu_ram_mmap: Assertion `is_power_of_2(align)' failed
Fix this by adding a proper check.
Signed-off-by: David Hildenbrand <david>
Message-Id: <20180607154705.6316-3-david>
Reviewed-by: Michael S. Tsirkin <mst>
Reviewed-by: Igor Mammedov <imammedo>
Signed-off-by: Paolo Bonzini <pbonzini>
Thanks,
Pankaj
Fix included in qemu-kvm-rhev-2.12.0-19.el7 Verify: qemu-kvm-rhev-2.12.0-19.el7 QEMU quits with error message when boot with align=1.5G: # /usr/libexec/qemu-kvm -m 4G,slots=20,maxmem=50G -M pc,nvdimm -object memory-backend-file,id=mem1,size=2G,mem-path=/tmp/nvdimm1,share,align=1.5G -device nvdimm,memdev=mem1,id=nv1 qemu-kvm: -object memory-backend-file,id=mem1,size=2G,mem-path=/tmp/nvdimm1,share,align=1.5G: alignment 0x60000000 must be a power of two If hotplug the object after guest boot up, hmp prints error message and guest works well. # /usr/libexec/qemu-kvm -m 4G,slots=20,maxmem=50G -M pc,nvdimm -monitor stdio rhel76-64-virtio-scsi.qcow2 -vnc :0 (qemu) object_add memory-backend-file,id=mem1,size=2G,mem-path=/tmp/nvdimm1,share,align=1.5G alignment 0x60000000 must be a power of two (qemu) info memdev (qemu) info status VM status: running 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:2553 |