qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 76ed4b: s390/ipl: fix ipl with -no-reboot


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 76ed4b: s390/ipl: fix ipl with -no-reboot
Date: Mon, 02 Jul 2018 08:06:57 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 76ed4b18debfe597329d1f6a9eb2ec9ffa751ecd
      
https://github.com/qemu/qemu/commit/76ed4b18debfe597329d1f6a9eb2ec9ffa751ecd
  Author: Christian Borntraeger <address@hidden>
  Date:   2018-07-02 (Mon, 02 Jul 2018)

  Changed paths:
    M hw/s390x/ipl.c
    M include/sysemu/sysemu.h
    M vl.c

  Log Message:
  -----------
  s390/ipl: fix ipl with -no-reboot

kexec/kdump as well as the bootloader use a subcode of diagnose 308
that is supposed to reset the I/O subsystem but not comprise a full
"reboot". With the latest refactoring this is now broken when
-no-reboot is used or when libvirt acts on a reboot QMP event, for
example a virt-install from iso images.

We need to mark these "subsystem resets" as special.

Fixes: a30fb811cbe9 (s390x: refactor reset/reipl handling)
Signed-off-by: Christian Borntraeger <address@hidden>
Reviewed-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Acked-by: Paolo Bonzini <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>


  Commit: 0f0f8b611eeea663c8d3b6021918033e257411a1
      
https://github.com/qemu/qemu/commit/0f0f8b611eeea663c8d3b6021918033e257411a1
  Author: Thomas Huth <address@hidden>
  Date:   2018-07-02 (Mon, 02 Jul 2018)

  Changed paths:
    M hw/core/loader.c
    M hw/mips/mips_malta.c
    M hw/s390x/ipl.c
    M hw/sparc/sun4m.c
    M hw/sparc64/sun4u.c
    M include/hw/loader.h
    M target/arm/cpu.c

  Log Message:
  -----------
  loader: Check access size when calling rom_ptr() to avoid crashes

The rom_ptr() function allows direct access to the ROM blobs that we
load during startup. However, there are currently no checks for the
size of the accesses, so it's currently possible to crash QEMU for
example with:

$ echo "Insane in the mainframe" > /tmp/test.txt
$ s390x-softmmu/qemu-system-s390x -kernel /tmp/test.txt -append xyz
Segmentation fault (core dumped)
$ s390x-softmmu/qemu-system-s390x -kernel /tmp/test.txt -initrd /tmp/test.txt
Segmentation fault (core dumped)
$ echo -n HdrS > /tmp/hdr.txt
$ sparc64-softmmu/qemu-system-sparc64 -kernel /tmp/hdr.txt -initrd /tmp/hdr.txt
Segmentation fault (core dumped)

We need a possibility to check the size of the ROM area that we want
to access, thus let's add a size parameter to the rom_ptr() function
to avoid these problems.

Acked-by: Christian Borntraeger <address@hidden>
Signed-off-by: Thomas Huth <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>


  Commit: 87273151110b7736b34ae3e37ad778c28c36d643
      
https://github.com/qemu/qemu/commit/87273151110b7736b34ae3e37ad778c28c36d643
  Author: Christian Borntraeger <address@hidden>
  Date:   2018-07-02 (Mon, 02 Jul 2018)

  Changed paths:
    M hw/s390x/s390-virtio-ccw.c
    M target/s390x/gen-features.c

  Log Message:
  -----------
  s390x/cpumodel: default enable bpb and ppa15 for z196 and later

Most systems and host kernels provide the necessary building blocks for
bpb and ppa15. We can reverse the logic and default enable those
features, while still allowing to disable it via cpu model.

So let us add bpb and ppa15 to z196 and later default CPU model for the
qemu 3.0 machine. (like -cpu z13).  Older machine types (e.g.
s390-ccw-virtio-2.12) will retain the old value and not provide those
bits in the default model.

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


  Commit: 14055ce53c2d901d826ffad7fb7d6bb8ab46bdfd
      
https://github.com/qemu/qemu/commit/14055ce53c2d901d826ffad7fb7d6bb8ab46bdfd
  Author: David Hildenbrand <address@hidden>
  Date:   2018-07-02 (Mon, 02 Jul 2018)

  Changed paths:
    M target/s390x/internal.h

  Log Message:
  -----------
  s390x/tcg: avoid overflows in time2tod/tod2time

Big values for the TOD/ns clock can result in some overflows that can be
avoided. Not all overflows can be handled however, as the conversion either
multiplies by 4.096 or divided by 4.096.

Apply the trick used in the Linux kernel in arch/s390/include/asm/timex.h
for tod_to_ns() and use the same trick also for the conversion in the
other direction.

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


  Commit: 4ab6a1feac0a142045d3b7bdbb8182a99c0b8980
      
https://github.com/qemu/qemu/commit/4ab6a1feac0a142045d3b7bdbb8182a99c0b8980
  Author: David Hildenbrand <address@hidden>
  Date:   2018-07-02 (Mon, 02 Jul 2018)

  Changed paths:
    M target/s390x/cpu.c
    M target/s390x/kvm-stub.c
    M target/s390x/kvm.c
    M target/s390x/kvm_s390x.h

  Log Message:
  -----------
  s390x/kvm: pass values instead of pointers to kvm_s390_set_clock_*()

We are going to factor out the TOD into a separate device and use const
pointers for device class functions where possible. We are passing right
now ordinary pointers that should never be touched when setting the TOD.
Let's just pass the values directly.

Note that s390_set_clock() will be removed in a follow-on patch and
therefore its calling convention is not changed.

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


  Commit: 8046f374a64b81fdf4f71f7a433bf4035d501521
      
https://github.com/qemu/qemu/commit/8046f374a64b81fdf4f71f7a433bf4035d501521
  Author: David Hildenbrand <address@hidden>
  Date:   2018-07-02 (Mon, 02 Jul 2018)

  Changed paths:
    M hw/s390x/Makefile.objs
    M hw/s390x/s390-virtio-ccw.c
    A hw/s390x/tod-kvm.c
    A hw/s390x/tod-qemu.c
    A hw/s390x/tod.c
    A include/hw/s390x/tod.h
    M target/s390x/cpu.c
    M target/s390x/cpu.h
    M target/s390x/kvm_s390x.h

  Log Message:
  -----------
  s390x/tod: factor out TOD into separate device

Let's treat this like a separate device. TCG will have to store the
actual state/time later on.

Include cpu-qom.h in kvm_s390x.h (due to S390CPU) to compile tod-kvm.c.

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


  Commit: f777b20544fe5db3de179a83374cbf9f1e454427
      
https://github.com/qemu/qemu/commit/f777b20544fe5db3de179a83374cbf9f1e454427
  Author: David Hildenbrand <address@hidden>
  Date:   2018-07-02 (Mon, 02 Jul 2018)

  Changed paths:
    M target/s390x/cpu.c
    M target/s390x/cpu.h
    M target/s390x/misc_helper.c

  Log Message:
  -----------
  s390x/tcg: drop tod_basetime

Never set to anything but 0.

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


  Commit: 7de3b1cdc67dcb572c1761c2051252e91a438b22
      
https://github.com/qemu/qemu/commit/7de3b1cdc67dcb572c1761c2051252e91a438b22
  Author: David Hildenbrand <address@hidden>
  Date:   2018-07-02 (Mon, 02 Jul 2018)

  Changed paths:
    M hw/s390x/tod-qemu.c
    M hw/s390x/tod.c
    M include/hw/s390x/tod.h
    M target/s390x/cpu.c
    M target/s390x/cpu.h
    M target/s390x/internal.h
    M target/s390x/misc_helper.c
    A target/s390x/tcg_s390x.h

  Log Message:
  -----------
  s390x/tcg: properly implement the TOD

Right now, each CPU has its own TOD. Especially, the TOD will differ
based on creation time of a CPU - e.g. when hotplugging a CPU the times
will differ quite a lot, resulting in stall warnings in the guest.

Let's use a single TOD by implementing our new TOD device. Prepare it
for TOD-clock epoch extension.

Most importantly, whenever we set the TOD, we have to update the CKC
timer.

Introduce "tcg_s390x.h" just like "kvm_s390x.h" for tcg specific
function declarations that should not go into cpu.h.

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


  Commit: 345f1ab96e8279a537f32ae7447296d23308c7d1
      
https://github.com/qemu/qemu/commit/345f1ab96e8279a537f32ae7447296d23308c7d1
  Author: David Hildenbrand <address@hidden>
  Date:   2018-07-02 (Mon, 02 Jul 2018)

  Changed paths:
    M target/s390x/misc_helper.c

  Log Message:
  -----------
  s390x/tcg: SET CLOCK COMPARATOR can clear CKC interrupts

Let's stop the timer and delete any pending CKC IRQ before doing
anything else.

While at it, add a comment why the check for ckc == -1ULL is needed.

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


  Commit: 9dc6753718d4c0fe327729fea94e4d9f3f5a3d17
      
https://github.com/qemu/qemu/commit/9dc6753718d4c0fe327729fea94e4d9f3f5a3d17
  Author: David Hildenbrand <address@hidden>
  Date:   2018-07-02 (Mon, 02 Jul 2018)

  Changed paths:
    M target/s390x/helper.h
    M target/s390x/insn-data.def
    M target/s390x/misc_helper.c
    M target/s390x/translate.c

  Log Message:
  -----------
  s390x/tcg: implement SET CLOCK

This allows a guest to change its TOD. We already take care of updating
all CKC timers from within S390TODClass.

Use MO_ALIGN to load the operand manually - this will properly trigger a
SPECIFICATION exception.

Acked-by: Thomas Huth <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>


  Commit: 7c12f710bad60dc7e509da4e80c77e952ef0490c
      
https://github.com/qemu/qemu/commit/7c12f710bad60dc7e509da4e80c77e952ef0490c
  Author: David Hildenbrand <address@hidden>
  Date:   2018-07-02 (Mon, 02 Jul 2018)

  Changed paths:
    M target/s390x/Makefile.objs
    M target/s390x/machine.c
    A target/s390x/tcg-stub.c

  Log Message:
  -----------
  s390x/tcg: rearm the CKC timer during migration

If the CPU data is migrated after the TOD clock, the CKC timer of a CPU
is not rearmed. Let's rearm it when loading the CPU state.

Introduce tcg-stub.c just like kvm-stub.c for tcg specific stubs.

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


  Commit: d66b43c896f89d610f8738169db8e10e63a3a9e6
      
https://github.com/qemu/qemu/commit/d66b43c896f89d610f8738169db8e10e63a3a9e6
  Author: David Hildenbrand <address@hidden>
  Date:   2018-07-02 (Mon, 02 Jul 2018)

  Changed paths:
    M target/s390x/cpu.c

  Log Message:
  -----------
  s390x/tcg: fix CPU hotplug with single-threaded TCG

run_on_cpu() doesn't seem to work reliably until the CPU has been fully
created if the single-threaded TCG main loop is already running.

Therefore, hotplugging a CPU under single-threaded TCG does currently
not work. We should use the direct call instead of going via
run_on_cpu().

So let's use run_on_cpu() for KVM only - KVM requires it due to the initial
CPU reset ioctl. As a nice side effect, we get rid of the ifdef.

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


  Commit: 8151942151fe1cbf072414d8822b80b00abfbf42
      
https://github.com/qemu/qemu/commit/8151942151fe1cbf072414d8822b80b00abfbf42
  Author: David Hildenbrand <address@hidden>
  Date:   2018-07-02 (Mon, 02 Jul 2018)

  Changed paths:
    M target/s390x/kvm.c

  Log Message:
  -----------
  s390x/kvm: legacy_s390_alloc() only supports one allocation

We always allocate at a fixed address, a second allocation can therefore
of course never work. We would simply overwrite mappings.

This can e.g. happen in s390_memory_init(), if trying to allocate more
than > 8TB. Let's just bail out, as there is no need for supporting it
(legacy handling for z/VM).

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


  Commit: d44444b0740680d996c979c8c3f63ab1c87f1cb1
      
https://github.com/qemu/qemu/commit/d44444b0740680d996c979c8c3f63ab1c87f1cb1
  Author: David Hildenbrand <address@hidden>
  Date:   2018-07-02 (Mon, 02 Jul 2018)

  Changed paths:
    M target/s390x/kvm.c

  Log Message:
  -----------
  s390x/kvm: indicate alignment in legacy_s390_alloc()

Let's do this for completeness reason, although we don't support e.g.
PCDIMM/NVDIMM, which would use the alignment for placing the memory
region in guest physical memory. But maybe someday we would want to
support something like this - then we don't forget about this if
allowing multiple allocations in legacy_s390_alloc().

Use the same alignment as we would set in qemu_anon_ram_alloc(). Our
fixed address satisfies this alignment (1MB). This implicitly sets the
alignment of the underlying memory region.

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


  Commit: 30c8db0e219a3c1d8b39c19e8b858830cb141738
      
https://github.com/qemu/qemu/commit/30c8db0e219a3c1d8b39c19e8b858830cb141738
  Author: David Hildenbrand <address@hidden>
  Date:   2018-07-02 (Mon, 02 Jul 2018)

  Changed paths:
    M target/s390x/misc_helper.c

  Log Message:
  -----------
  s390x/tcg: fix locking problem with tcg_s390_tod_updated

tcg_s390_tod_updated() is always called with the iothread being locked
(e.g. from S390TODClass->set() e.g. via HELPER(sck) or on incoming
migration). The helper we call takes the lock itself - bad.

Let's change that by factoring out updating the ckc timer. This now looks
much nicer than having to call a helper from another function.

While touching it we also make sure that env->ckc is updated even if the
new value is -1ULL, for now it would not have been modified in that case.

Reported-by: Christian Borntraeger <address@hidden>
Signed-off-by: David Hildenbrand <address@hidden>
Message-Id: <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>


  Commit: 7320bb2cb0b0bc54ecab3dfaea797d8f42e34ad9
      
https://github.com/qemu/qemu/commit/7320bb2cb0b0bc54ecab3dfaea797d8f42e34ad9
  Author: Peter Maydell <address@hidden>
  Date:   2018-07-02 (Mon, 02 Jul 2018)

  Changed paths:
    M hw/core/loader.c
    M hw/mips/mips_malta.c
    M hw/s390x/Makefile.objs
    M hw/s390x/ipl.c
    M hw/s390x/s390-virtio-ccw.c
    A hw/s390x/tod-kvm.c
    A hw/s390x/tod-qemu.c
    A hw/s390x/tod.c
    M hw/sparc/sun4m.c
    M hw/sparc64/sun4u.c
    M include/hw/loader.h
    A include/hw/s390x/tod.h
    M include/sysemu/sysemu.h
    M target/arm/cpu.c
    M target/s390x/Makefile.objs
    M target/s390x/cpu.c
    M target/s390x/cpu.h
    M target/s390x/gen-features.c
    M target/s390x/helper.h
    M target/s390x/insn-data.def
    M target/s390x/internal.h
    M target/s390x/kvm-stub.c
    M target/s390x/kvm.c
    M target/s390x/kvm_s390x.h
    M target/s390x/machine.c
    M target/s390x/misc_helper.c
    A target/s390x/tcg-stub.c
    A target/s390x/tcg_s390x.h
    M target/s390x/translate.c
    M vl.c

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

s390x updates:
- add bpb/ppa15 features to default cpu model for z196 and later
- rework TOD handling and fix cpu hotplug under tcg
- various fixes

# gpg: Signature made Mon 02 Jul 2018 12:09:40 BST
# gpg:                using RSA key DECF6B93C6F02FAF
# gpg: Good signature from "Cornelia Huck <address@hidden>"
# gpg:                 aka "Cornelia Huck <address@hidden>"
# gpg:                 aka "Cornelia Huck <address@hidden>"
# gpg:                 aka "Cornelia Huck <address@hidden>"
# gpg:                 aka "Cornelia Huck <address@hidden>"
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck/tags/s390x-20180702:
  s390x/tcg: fix locking problem with tcg_s390_tod_updated
  s390x/kvm: indicate alignment in legacy_s390_alloc()
  s390x/kvm: legacy_s390_alloc() only supports one allocation
  s390x/tcg: fix CPU hotplug with single-threaded TCG
  s390x/tcg: rearm the CKC timer during migration
  s390x/tcg: implement SET CLOCK
  s390x/tcg: SET CLOCK COMPARATOR can clear CKC interrupts
  s390x/tcg: properly implement the TOD
  s390x/tcg: drop tod_basetime
  s390x/tod: factor out TOD into separate device
  s390x/kvm: pass values instead of pointers to kvm_s390_set_clock_*()
  s390x/tcg: avoid overflows in time2tod/tod2time
  s390x/cpumodel: default enable bpb and ppa15 for z196 and later
  loader: Check access size when calling rom_ptr() to avoid crashes
  s390/ipl: fix ipl with -no-reboot

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


Compare: https://github.com/qemu/qemu/compare/2d58e33ec1b7...7320bb2cb0b0
      **NOTE:** This service been marked for deprecation: 
https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.

reply via email to

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