Bug 1477459 - There wasn't any warnings when pc-dimm's slot exceeded 32.
There wasn't any warnings when pc-dimm's slot exceeded 32.
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.4-Alt
ppc64le Linux
medium Severity medium
: rc
: 7.4-Alt
Assigned To: Laurent Vivier
Min Deng
:
Depends On:
Blocks: 1440030
  Show dependency treegraph
 
Reported: 2017-08-02 03:27 EDT by Min Deng
Modified: 2017-08-10 01:56 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-08-10 01:49:27 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
IBM Linux Technology Center 157333 None None None 2017-08-06 06:36 EDT

  None (edit)
Description Min Deng 2017-08-02 03:27:21 EDT
Description of problem:
There is wasn't any warnings when pc-dimm's slot exceeded 32.

Version-Release number of selected component (if applicable):
kernel-4.11.0-14.el7a.ppc64le - host
kernel-4.11.0-16.el7a.ppc64le - guest
qemu-kvm-2.9.0-18.el7a.ppc64le

How reproducible:
3/3

Steps to Reproduce:
1.boot up guest with cli
  /usr/libexec/qemu-kvm -name mdeng -sandbox off -machine pseries-rhel7.4.0 -nodefaults -vga none -chardev socket,id=serial_id_serial0,path=/tmp/tt,server,nowait -device spapr-vty,reg=0x30000000,chardev=serial_id_serial0 -device nec-usb-xhci,id=usb1,bus=pci.0,addr=0x3 -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pci.0,addr=0x4 -drive id=drive_image1,if=none,snapshot=off,aio=native,cache=none,format=qcow2,file=memory.qcow2 -device scsi-hd,id=image1,drive=drive_image1 -device virtio-net-pci,mac=9a:2b:2c:2d:2e:2f,id=id6b5tKj,vectors=4,netdev=idXB7qte,bus=pci.0,addr=0x5 -netdev tap,id=idXB7qte,vhost=on,script=/etc/qemu-ifup,downscript=/etc/qemu-down,id=hostnet1 -device usb-tablet,id=usb-tablet1,bus=usb1.0,port=1 -vnc :11 -rtc base=utc,clock=host -enable-kvm -monitor stdio -qmp tcp:0:4441,server,nowait -smp 8 -m 4,slots=256,maxmem=8G
2.
  (qemu) object_add memory-backend-ram,id=mem1,size=1G
  (qemu) device_add pc-dimm,id=dimm1,memdev=mem1,slot=35
3.

Actual results:
There wasn't any warnings though it seemed guest still was running well.

Expected results:
There should be some warnings since it was only supported 32 slots on Power platform so far.

Additional info:
Comment 1 Min Deng 2017-08-02 03:30:14 EDT
It also can be reproduced on P8 + RHEL7.4,thanks.
Comment 2 Laurent Vivier 2017-08-02 06:43:36 EDT
The limit is not 32 anymore (except for TCG), the limit is given by KVM:

hw/ppc/spapr.c:
2091 static void ppc_spapr_init(MachineState *machine)
...
2214     if (machine->ram_size < machine->maxram_size) {
2215         ram_addr_t hotplug_mem_size = machine->maxram_size - machine->ram_size;
2216         /*
2217          * Limit the number of hotpluggable memory slots to half the number
2218          * slots that KVM supports, leaving the other half for PCI and other
2219          * devices. However ensure that number of slots doesn't drop below 32.
2220          */
2221         int max_memslots = kvm_enabled() ? kvm_get_max_memslots() / 2 :
2222                            SPAPR_MAX_RAM_SLOTS;

include/hw/ppc/spapr.h:

    649 /*
    650  * This defines the maximum number of DIMM slots we can have for sPAPR
    651  * guest. This is not defined by sPAPR but we are defining it to 32 slots
    652  * based on default number of slots provided by PowerPC kernel.
    653  */
    654 #define SPAPR_MAX_RAM_SLOTS     32

From kernel:

arch/powerpc/kvm/powerpc.c:
    486 int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
    487 {
...
    606         case KVM_CAP_NR_MEMSLOTS:
    607                 r = KVM_USER_MEM_SLOTS;
    608                 break;

arch/powerpc/include/asm/kvm_host.h:

     38 
     39 #define KVM_MAX_VCPUS           NR_CPUS
     40 #define KVM_MAX_VCORES          NR_CPUS
     41 #define KVM_USER_MEM_SLOTS      512
     42 

So the limit is KVM_USER_MEM_SLOTS / 2 = 256
Comment 3 David Gibson 2017-08-02 21:22:20 EDT
Right, we basically allow more than we used to.

Is the 32 slot limit documented somewhere?  In that case possibly we should update the documentation.

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