qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] ad1112: s390x/tcg: Fix ALGSI


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] ad1112: s390x/tcg: Fix ALGSI
Date: Thu, 21 Jan 2021 11:10:24 -0800

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: ad11129b305b71ae835512554c59b83ca092251c
      
https://github.com/qemu/qemu/commit/ad11129b305b71ae835512554c59b83ca092251c
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-01-21 (Thu, 21 Jan 2021)

  Changed paths:
    M target/s390x/insn-data.def

  Log Message:
  -----------
  s390x/tcg: Fix ALGSI

Looks like something went wrong whiel touching that line. Instead of "r1"
we need a new temporary. Also, we have to pass MO_TEQ, to indicate that
we are working with 64-bit values. Let's revert these changes.

Fixes: ff26d287bddc ("target/s390x: Improve cc computation for ADD LOGICAL")
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210111163845.18148-2-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>


  Commit: c23908305b3ce7a547b0981eae549f36f756b950
      
https://github.com/qemu/qemu/commit/c23908305b3ce7a547b0981eae549f36f756b950
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-01-21 (Thu, 21 Jan 2021)

  Changed paths:
    M target/s390x/translate.c

  Log Message:
  -----------
  s390x/tcg: Fix RISBHG

RISBHG is broken and currently hinders clang-11 builds of upstream kernels
from booting: the kernel crashes early, while decompressing the image.

  [...]
   Kernel fault: interruption code 0005 ilc:2
   Kernel random base: 0000000000000000
   PSW : 0000200180000000 0000000000017a1e
         R:0 T:0 IO:0 EX:0 Key:0 M:0 W:0 P:0 AS:0 CC:2 PM:0 RI:0 EA:3
   GPRS: 0000000000000001 0000000c00000000 00000003fffffff4 00000000fffffff0
         0000000000000000 00000000fffffff4 000000000000000c 00000000fffffff0
         00000000fffffffc 0000000000000000 00000000fffffff8 00000000008e25a8
         0000000000000009 0000000000000002 0000000000000008 000000000000bce0

One example of a buggy instruction is:

    17dde:       ec 1e 00 9f 20 5d       risbhg  %r1,%r14,0,159,32

With %r14 = 0x9 and %r1 = 0x7 should result in %r1 = 0x900000007, however,
results in %r1 = 0.

Let's interpret values of i3/i4 as documented in the PoP and make
computation of "mask" only based on i3 and i4 and use "pmask" only at the
very end to make sure wrapping is only applied to the high/low doubleword.

With this patch, I can successfully boot a v5.11-rc2 kernel built with
clang-11, and gcc builds keep on working.

Fixes: 2d6a869833d9 ("target-s390: Implement RISBG")
Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210111163845.18148-3-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>


  Commit: 401bf46779d7628438337007d82969da7b7e396f
      
https://github.com/qemu/qemu/commit/401bf46779d7628438337007d82969da7b7e396f
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-01-21 (Thu, 21 Jan 2021)

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

  Log Message:
  -----------
  s390x/tcg: Don't ignore content in r0 when not specified via "b" or "x"

Using get_address() with register identifiers comming from an "r" field
is wrong: if the "r" field designates "r0", we don't read the content
and instead assume 0 - which should only be applied when the register
was specified via "b" or "x".

PoP 5-11 "Operand-Address Generation":
  "A zero in any of the B1, B2, X2, B3, or B4 fields indicates the absence
   of the corresponding address component. For the absent component, a zero
   is used in forming the intermediate sum, regardless of the contents of
   general register 0. A displacement of zero has no special significance."

This BUG became visible for CSPG as generated by LLVM-12 in the upstream
Linux kernel (v5.11-rc2), used while creating the linear mapping in
vmem_map_init(): Trying to store to address 0 results in a Low Address
Protection exception.

Debugging this was more complicated than it could have been: The program
interrupt handler in the kernel will try to crash the kernel: doing so, it
will enable DAT. As the linear mapping is not created yet (asce=0), we run
into an addressing exception while tring to walk non-existant DAT tables,
resulting in a program exception loop.

This allows for booting upstream Linux kernels compiled by clang-12. Most
of these cases seem to be broken forever.

Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210111163845.18148-4-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>


  Commit: d944293d9ab0b8338fbc681e6e5d8ac7829a702f
      
https://github.com/qemu/qemu/commit/d944293d9ab0b8338fbc681e6e5d8ac7829a702f
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-01-21 (Thu, 21 Jan 2021)

  Changed paths:
    M tests/tcg/s390x/exrl-trt.c
    M tests/tcg/s390x/exrl-trtr.c

  Log Message:
  -----------
  tests/tcg/s390x: Fix EXRL tests

The current EXRL tests crash on real machines: we must not use r0 as a base
register for trt/trtr, otherwise the content gets ignored. Also, we must
not use r0 for exrl, otherwise it gets ignored.

Let's use the "a" constraint so we get a general purpose register != r0.
For op2, we can simply specify a memory operand directly via "Q" (Memory
reference without index register and with short displacement).

Fixes: ad8c851d2e77 ("target/s390x: add EX support for TRT and TRTR")
Signed-off-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20210111163845.18148-5-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>


  Commit: e312fa1d78a2387c2ca1f40b88b29d9fdca4dbfc
      
https://github.com/qemu/qemu/commit/e312fa1d78a2387c2ca1f40b88b29d9fdca4dbfc
  Author: David Hildenbrand <david@redhat.com>
  Date:   2021-01-21 (Thu, 21 Jan 2021)

  Changed paths:
    M target/s390x/mem_helper.c

  Log Message:
  -----------
  s390x/tcg: Ignore register content if b1/b2 is zero when handling EXECUTE

In our EXECUTE fast path, we have to ignore the content of r0, if
specified by b1 or b2.

Fixes: d376f123c7de ("target/s390x: Re-implement a few EXECUTE target insns 
directly")
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20210111163845.18148-6-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>


  Commit: ab5ec23f9cc25215c1281d575c07c0f35e8e9e26
      
https://github.com/qemu/qemu/commit/ab5ec23f9cc25215c1281d575c07c0f35e8e9e26
  Author: Eric Farman <farman@linux.ibm.com>
  Date:   2021-01-21 (Thu, 21 Jan 2021)

  Changed paths:
    M scripts/update-linux-headers.sh

  Log Message:
  -----------
  update-linux-headers: Include const.h

Kernel commit a85cbe6159ff ("uapi: move constants from
<linux/kernel.h> to <linux/const.h>") breaks our script
because of the unrecognized include. Let's add that to
our processing.

Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210104202057.48048-2-farman@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>


  Commit: b3c818a47f419b6e2f5508fe29e7a30843236fee
      
https://github.com/qemu/qemu/commit/b3c818a47f419b6e2f5508fe29e7a30843236fee
  Author: Eric Farman <farman@linux.ibm.com>
  Date:   2021-01-21 (Thu, 21 Jan 2021)

  Changed paths:
    M include/standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.h
    M include/standard-headers/drm/drm_fourcc.h
    A include/standard-headers/linux/const.h
    M include/standard-headers/linux/ethtool.h
    M include/standard-headers/linux/fuse.h
    M include/standard-headers/linux/kernel.h
    M include/standard-headers/linux/pci_regs.h
    M include/standard-headers/linux/vhost_types.h
    M include/standard-headers/linux/virtio_gpu.h
    M include/standard-headers/linux/virtio_ids.h
    M linux-headers/asm-arm64/kvm.h
    M linux-headers/asm-generic/unistd.h
    M linux-headers/asm-mips/unistd_n32.h
    M linux-headers/asm-mips/unistd_n64.h
    M linux-headers/asm-mips/unistd_o32.h
    M linux-headers/asm-powerpc/unistd_32.h
    M linux-headers/asm-powerpc/unistd_64.h
    M linux-headers/asm-s390/unistd_32.h
    M linux-headers/asm-s390/unistd_64.h
    M linux-headers/asm-x86/kvm.h
    M linux-headers/asm-x86/unistd_32.h
    M linux-headers/asm-x86/unistd_64.h
    M linux-headers/asm-x86/unistd_x32.h
    M linux-headers/linux/kvm.h
    M linux-headers/linux/userfaultfd.h
    M linux-headers/linux/vfio.h
    M linux-headers/linux/vhost.h

  Log Message:
  -----------
  Update linux headers to 5.11-rc2

Signed-off-by: Eric Farman <farman@linux.ibm.com>
Message-Id: <20210104202057.48048-3-farman@linux.ibm.com>
[CH: dropped qatomic->atomic changes in pvrdma_ring.h]
Signed-off-by: Cornelia Huck <cohuck@redhat.com>


  Commit: b2f96f9e4f5fbc8f2770a436191cb328da4d5350
      
https://github.com/qemu/qemu/commit/b2f96f9e4f5fbc8f2770a436191cb328da4d5350
  Author: Eric Farman <farman@linux.ibm.com>
  Date:   2021-01-21 (Thu, 21 Jan 2021)

  Changed paths:
    M hw/vfio/ccw.c

  Log Message:
  -----------
  vfio-ccw: Connect the device request notifier

Now that the vfio-ccw code has a notifier interface to request that
a device be unplugged, let's wire that together.

Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <20210104202057.48048-4-farman@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>


  Commit: e6a80232f4087e8c7ec253f573319f69165b859d
      
https://github.com/qemu/qemu/commit/e6a80232f4087e8c7ec253f573319f69165b859d
  Author: Miroslav Rezanina <mrezanin@redhat.com>
  Date:   2021-01-21 (Thu, 21 Jan 2021)

  Changed paths:
    M target/s390x/kvm.c
    M target/s390x/misc_helper.c

  Log Message:
  -----------
  s390x: Use strpadcpy for copying vm name

Using strncpy with length equal to the size of target array, GCC 11
reports following warning:

  warning: '__builtin_strncpy' specified bound 256 equals destination size 
[-Wstringop-truncation]

We can prevent this warning by using strpadcpy that copies string
up to specified length, zeroes target array after copied string
and does not raise warning when length is equal to target array
size (and ending '\0' is discarded).

Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: 
<6f86915755219cf6a671788075da4809b57f7d7b.1610607906.git.mrezanin@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>


  Commit: a957d25dde7088bc500031072e10ee634faca03c
      
https://github.com/qemu/qemu/commit/a957d25dde7088bc500031072e10ee634faca03c
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-01-21 (Thu, 21 Jan 2021)

  Changed paths:
    M hw/vfio/ccw.c
    M include/standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.h
    M include/standard-headers/drm/drm_fourcc.h
    A include/standard-headers/linux/const.h
    M include/standard-headers/linux/ethtool.h
    M include/standard-headers/linux/fuse.h
    M include/standard-headers/linux/kernel.h
    M include/standard-headers/linux/pci_regs.h
    M include/standard-headers/linux/vhost_types.h
    M include/standard-headers/linux/virtio_gpu.h
    M include/standard-headers/linux/virtio_ids.h
    M linux-headers/asm-arm64/kvm.h
    M linux-headers/asm-generic/unistd.h
    M linux-headers/asm-mips/unistd_n32.h
    M linux-headers/asm-mips/unistd_n64.h
    M linux-headers/asm-mips/unistd_o32.h
    M linux-headers/asm-powerpc/unistd_32.h
    M linux-headers/asm-powerpc/unistd_64.h
    M linux-headers/asm-s390/unistd_32.h
    M linux-headers/asm-s390/unistd_64.h
    M linux-headers/asm-x86/kvm.h
    M linux-headers/asm-x86/unistd_32.h
    M linux-headers/asm-x86/unistd_64.h
    M linux-headers/asm-x86/unistd_x32.h
    M linux-headers/linux/kvm.h
    M linux-headers/linux/userfaultfd.h
    M linux-headers/linux/vfio.h
    M linux-headers/linux/vhost.h
    M scripts/update-linux-headers.sh
    M target/s390x/insn-data.def
    M target/s390x/kvm.c
    M target/s390x/mem_helper.c
    M target/s390x/misc_helper.c
    M target/s390x/translate.c
    M tests/tcg/s390x/exrl-trt.c
    M tests/tcg/s390x/exrl-trtr.c

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

s390x updates:
- headers update to Linux 5.11-rc2
- fix tcg emulation for some instructions that are generated by
  clang Linux kernel builds
- vfio-ccw: wire up the device unplug notification mechanism
- fix a gcc 11 warning

# gpg: Signature made Thu 21 Jan 2021 12:08:12 GMT
# gpg:                using RSA key C3D0D66DC3624FF6A8C018CEDECF6B93C6F02FAF
# gpg:                issuer "cohuck@redhat.com"
# gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" [unknown]
# gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" [full]
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>" [full]
# gpg:                 aka "Cornelia Huck <cohuck@kernel.org>" [unknown]
# gpg:                 aka "Cornelia Huck <cohuck@redhat.com>" [unknown]
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck-gitlab/tags/s390x-20210121:
  s390x: Use strpadcpy for copying vm name
  vfio-ccw: Connect the device request notifier
  Update linux headers to 5.11-rc2
  update-linux-headers: Include const.h
  s390x/tcg: Ignore register content if b1/b2 is zero when handling EXECUTE
  tests/tcg/s390x: Fix EXRL tests
  s390x/tcg: Don't ignore content in r0 when not specified via "b" or "x"
  s390x/tcg: Fix RISBHG
  s390x/tcg: Fix ALGSI

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/fef80ea073c4...a957d25dde70



reply via email to

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