qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] edd075: s390x: kvm: Fix number of cpu reports


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] edd075: s390x: kvm: Fix number of cpu reports for stsi 3.2.2
Date: Fri, 03 Apr 2020 07:30:19 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: edd075ae2baebf64b74e089457af6201362c9343
      
https://github.com/qemu/qemu/commit/edd075ae2baebf64b74e089457af6201362c9343
  Author: Janosch Frank <address@hidden>
  Date:   2020-04-02 (Thu, 02 Apr 2020)

  Changed paths:
    M target/s390x/kvm.c

  Log Message:
  -----------
  s390x: kvm: Fix number of cpu reports for stsi 3.2.2

The cpu number reporting is handled by KVM and QEMU only fills in the
VM name, uuid and other values.

Unfortunately KVM doesn't report reserved cpus and doesn't even know
they exist until the are created via the ioctl.

So let's fix up the cpu values after KVM has written its values to the
3.2.2 sysib. To be consistent, we use the same code to retrieve the cpu
numbers as the STSI TCG code in target/s390x/misc_helper.c:HELPER(stsi).

Signed-off-by: Janosch Frank <address@hidden>
Reviewed-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>


  Commit: 5c30ef937f522a65df78dd9f496483fe4fc44d5e
      
https://github.com/qemu/qemu/commit/5c30ef937f522a65df78dd9f496483fe4fc44d5e
  Author: Christian Borntraeger <address@hidden>
  Date:   2020-04-02 (Thu, 02 Apr 2020)

  Changed paths:
    M hw/s390x/s390-skeys.c
    M hw/s390x/s390-stattrib-kvm.c
    M hw/s390x/s390-virtio-ccw.c
    M hw/s390x/sclp.c
    M include/hw/boards.h
    M softmmu/vl.c

  Log Message:
  -----------
  vl/s390x: fixup ram sizes for compat machines

Older QEMU versions did fixup the ram size to match what can be reported
via sclp. We need to mimic this behaviour for machine types 4.2 and
older to not fail on inbound migration for memory sizes that do not fit.
Old machines with proper aligned memory sizes are not affected.

Alignment table:
 VM size (<=) | Alignment
--------------------------
      1020M   |     1M
      2040M   |     2M
      4080M   |     4M
      8160M   |     8M
     16320M   |    16M
     32640M   |    32M
     65280M   |    64M
    130560M   |   128M
    261120M   |   256M
    522240M   |   512M
   1044480M   |     1G
   2088960M   |     2G
   4177920M   |     4G
   8355840M   |     8G

Suggested action is to replace unaligned -m value with a suitable
aligned one or if a change to a newer machine type is possible, use a
machine version >= 5.0.

A future version might remove the compatibility handling.

For machine types >= 5.0 we can simply use an increment size of 1M and
use the full range of increment number which allows for all possible
memory sizes. The old limitation of having a maximum of 1020 increments
was added for standby memory, which we no longer support. With that we
can now support even weird memory sizes like 10001234 MB.

As we no longer fixup maxram_size as well, make other users use ram_size
instead. Keep using maxram_size when setting the maximum ram size in KVM,
as that will come in handy in the future when supporting memory hotplug
(in contrast, storage keys and storage attributes for hotplugged memory
will have to be migrated per RAM block in the future).

Fixes: 3a12fc61af5c ("390x/s390-virtio-ccw: use memdev for RAM")
Reported-by: Lukáš Doktor <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Signed-off-by: Christian Borntraeger <address@hidden>
Reviewed-by: David Hildenbrand <address@hidden>
Acked-by: Igor Mammedov <address@hidden>
Cc: Igor Mammedov <address@hidden>
Cc: Dr. David Alan Gilbert <address@hidden>
Message-Id: <address@hidden>
[CH: fixed up message on memory size fixup]
Signed-off-by: Cornelia Huck <address@hidden>


  Commit: 64a3b4d53d344bd494bcf969ee89467b560c7ce0
      
https://github.com/qemu/qemu/commit/64a3b4d53d344bd494bcf969ee89467b560c7ce0
  Author: Peter Maydell <address@hidden>
  Date:   2020-04-03 (Fri, 03 Apr 2020)

  Changed paths:
    M hw/s390x/s390-skeys.c
    M hw/s390x/s390-stattrib-kvm.c
    M hw/s390x/s390-virtio-ccw.c
    M hw/s390x/sclp.c
    M include/hw/boards.h
    M softmmu/vl.c
    M target/s390x/kvm.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20200403' into staging

- fix cpu number reporting in the stsi 3.2.2 block for kvm
- fix migration for old machines with odd ram sizes

# gpg: Signature made Fri 03 Apr 2020 10:11:06 BST
# gpg:                using RSA key C3D0D66DC3624FF6A8C018CEDECF6B93C6F02FAF
# gpg:                issuer "address@hidden"
# gpg: Good signature from "Cornelia Huck <address@hidden>" [marginal]
# gpg:                 aka "Cornelia Huck <address@hidden>" [full]
# gpg:                 aka "Cornelia Huck <address@hidden>" [full]
# gpg:                 aka "Cornelia Huck <address@hidden>" [marginal]
# gpg:                 aka "Cornelia Huck <address@hidden>" [marginal]
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck/tags/s390x-20200403:
  vl/s390x: fixup ram sizes for compat machines
  s390x: kvm: Fix number of cpu reports for stsi 3.2.2

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/f2a8261110c3...64a3b4d53d34



reply via email to

[Prev in Thread] Current Thread [Next in Thread]