-
Bug
-
Resolution: Won't Do
-
Undefined
-
None
-
rhel-9.2.0
-
None
-
None
-
rhel-sst-virtualization
-
ssg_virtualization
-
5
-
False
-
-
None
-
None
-
None
-
None
-
If docs needed, set a value
-
-
Unspecified
-
None
Description of problem:
Different behaviors for hotplugging dimm memory in guest with different access attr defined when there is nvdimm device plugged
Version-Release number of selected component (if applicable):
libvirt-9.0.0-8.el9_2.x86_64
qemu-kvm-7.2.0-11.el9_2.x86_64
Guest version:
os version: RHEL9.2
kernel version: 5.14.0-284.el9.x86_64
How reproducible:
100%
Steps to Reproduce:
1. Create a 512M file
truncate -s 512M /tmp/nvdimm
2. Define and Start a guest with memory, numa and nvdimm related config xml as below:
<maxMemory slots='16' unit='KiB'>52428800</maxMemory>
<memory unit='KiB'>2097152</memory>
<currentMemory unit='KiB'>2097152</currentMemory>
...
<numa>
<cell id='0' cpus='0-1' memory='1048576' unit='KiB'/>
<cell id='1' cpus='2-3' memory='1048576' unit='KiB'/>
</numa>
...
<memory model='nvdimm'>
<source>
<path>/tmp/nvdimm</path>
</source>
<target>
<size unit='KiB'>524288</size>
<node>1</node>
<label>
<size unit='KiB'>256</size>
</label>
</target>
</memory>
...
3. Check the guest memory
[in guest]
- cat /proc/meminfo | grep MemTotal
MemTotal: 1736156 kB
4. Prepare a access defined dimm memory device config xml:
- cat memory1.xml
<memory model='dimm' access='shared'> <!-- or access='private' -->
<source>
<pagesize unit='KiB'>4</pagesize>
</source>
<target>
<size unit='KiB'>524288</size>
<node>0</node>
</target>
</memory>
5. Hot plug the dimm memory device with config xml in step3
- virsh attach-device vm1 memory1.xml
Device attached successfully
6. Check the guest memory again and guest memory is not increased.
[in guest]
- cat /proc/meminfo | grep MemTotal
MemTotal: 1736156 kB
7. Check dmesg in guest and find related error
[in guest]
- dmesg
...
[ 198.482981] Block size [0x8000000] unaligned hotplug range: start 0x11ffc0000, size 0x20000000
[ 198.483017] acpi PNP0C80:01: add_memory failed
[ 198.485362] acpi PNP0C80:01: acpi_memory_enable_device() error
[ 198.486377] acpi PNP0C80:01: Enumeration failure
8. If in step4 memory device is not defined without access attr like:
- cat memory1.xml
<memory model='dimm'>
<source>
<pagesize unit='KiB'>4</pagesize>
</source>
.....
Then in step6 the guest would increase as:
[in guest]
- cat /proc/meminfo | grep MemTotal
MemTotal: 2260444 kB
Actual results:
Different behavior for hotplugging dimm device in guest with different access attr.
Expected results:
Shared or private access defined dimm device should be same behavior with no defined dimm device.
Additional info:
Also checked other scenarios:
Note: the guest area memory size of nvdimm is 524288 KiB - 256 KiB = 524032 KiB, which is not multiple of 128M
If nvdimm guest area memory(total-size - label-size) is multiple of 128M as label size set as: 0 (no label size defined), 128M, 256M, 384M, then no matter how to set access attr, dimm device could be plugged successfully in guest.
For dimm device has no access attr defined. If set nvdimm label size [0, 2M), [128M, 130M), [256M, 258M).. the dimm device could be plugged successfully in guest.
So as the info above, the behaviors with different access attr defined are different.
- external trackers