qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] a6625d: pc-bios/s390-ccw: don't try to read t


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] a6625d: pc-bios/s390-ccw: don't try to read the next block...
Date: Tue, 11 May 2021 13:22:15 -0700

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: a6625d38cce3901a7c1cba069f0abcf743a293f1
      
https://github.com/qemu/qemu/commit/a6625d38cce3901a7c1cba069f0abcf743a293f1
  Author: Marc Hartmayer <mhartmay@linux.ibm.com>
  Date:   2021-05-09 (Sun, 09 May 2021)

  Changed paths:
    M pc-bios/s390-ccw/bootmap.c

  Log Message:
  -----------
  pc-bios/s390-ccw: don't try to read the next block if end of chunk is reached

Don't read the block if a null block number is reached, because this means that
the end of chunk is reached.

Reviewed-by: Collin Walling <walling@linux.ibm.com>
Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Message-Id: <20210416074736.17409-1-mhartmay@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: d08a64940452060ab7ad5eb49cd5801131c2b9ec
      
https://github.com/qemu/qemu/commit/d08a64940452060ab7ad5eb49cd5801131c2b9ec
  Author: Thomas Huth <thuth@redhat.com>
  Date:   2021-05-09 (Sun, 09 May 2021)

  Changed paths:
    M pc-bios/s390-ccw/bootmap.c

  Log Message:
  -----------
  pc-bios/s390-ccw/bootmap: Silence compiler warning from Clang

When compiling the s390-ccw bios with Clang, the compiler complains:

 pc-bios/s390-ccw/bootmap.c:302:9: warning: logical not is only applied
  to the left hand side of this comparison [-Wlogical-not-parentheses]
    if (!mbr->dev_type == DEV_TYPE_ECKD) {
        ^              ~~

The code works (more or less by accident), since dev_type can only be
0 or 1, but it's better of course to use the intended != operator here
instead.

Fixes: 5dc739f343 ("Allow booting in case the first virtio-blk disk is bad")
Message-Id: <20210421163331.358178-1-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: ff77712a8a2e15e5901fad35b9a6bb65974b2e4a
      
https://github.com/qemu/qemu/commit/ff77712a8a2e15e5901fad35b9a6bb65974b2e4a
  Author: Thomas Huth <thuth@redhat.com>
  Date:   2021-05-09 (Sun, 09 May 2021)

  Changed paths:
    M pc-bios/s390-ccw/jump2ipl.c

  Log Message:
  -----------
  pc-bios/s390-ccw: Use reset_psw pointer instead of hard-coded null pointer

When compiling the s390-ccw bios with clang, it emits a warning like this:

 pc-bios/s390-ccw/jump2ipl.c:86:9: warning: indirection of non-volatile null
  pointer will be deleted, not trap [-Wnull-dereference]
     if (*((uint64_t *)0) & RESET_PSW_MASK) {
         ^~~~~~~~~~~~~~~~
 pc-bios/s390-ccw/jump2ipl.c:86:9: note: consider using __builtin_trap() or
  qualifying pointer with 'volatile'

We could add a "volatile" here to shut it up, but on the other hand,
we also have a pointer variable called "reset_psw" in this file already
that points to the PSW at address 0, so we can simply use that pointer
variable instead.

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210423142440.582188-1-thuth@redhat.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: b460a220872c28a8da95cbc7e9369d26aa268848
      
https://github.com/qemu/qemu/commit/b460a220872c28a8da95cbc7e9369d26aa268848
  Author: Thomas Huth <thuth@redhat.com>
  Date:   2021-05-09 (Sun, 09 May 2021)

  Changed paths:
    M pc-bios/s390-ccw/netboot.mak

  Log Message:
  -----------
  pc-bios/s390-ccw/netboot: Use "-Wl," prefix to pass parameter to the linker

We are using the compiler to do the linking of the bios files. GCC still
accepts the "-Ttext=..." linker flag directly and is smart enough to
pass it to the linker, but in case we are compiling with Clang, we have
to use the official way with the "-Wl," prefix instead.

Message-Id: <20210423153646.593153-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 679196a646c91b8ce9a97b0aa81ffb3776cf8046
      
https://github.com/qemu/qemu/commit/679196a646c91b8ce9a97b0aa81ffb3776cf8046
  Author: Thomas Huth <thuth@redhat.com>
  Date:   2021-05-09 (Sun, 09 May 2021)

  Changed paths:
    M pc-bios/s390-ccw/s390-ccw.h

  Log Message:
  -----------
  pc-bios/s390-ccw: Silence warning from Clang by marking panic() as noreturn

When compiling the s390-ccw bios with Clang, the compiler emits a warning:

 pc-bios/s390-ccw/main.c:210:5: warning: variable 'found' is used uninitialized
  whenever switch default is taken [-Wsometimes-uninitialized]
     default:
     ^~~~~~~
 pc-bios/s390-ccw/main.c:214:16: note: uninitialized use occurs here
     IPL_assert(found, "Boot device not found\n");
                ^~~~~

It's a false positive, it only happens because Clang is not smart enough
to see that the panic() function in the "default:" case can never return.

Anyway, let's explicitely mark panic() with "noreturn" to shut up the
warning.

Message-Id: <20210502174836.838816-2-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 3462ff35512e925df5ee8c079ed46d4c93b633a7
      
https://github.com/qemu/qemu/commit/3462ff35512e925df5ee8c079ed46d4c93b633a7
  Author: Thomas Huth <thuth@redhat.com>
  Date:   2021-05-09 (Sun, 09 May 2021)

  Changed paths:
    M pc-bios/s390-ccw/Makefile

  Log Message:
  -----------
  pc-bios/s390-ccw: Fix the cc-option macro in the Makefile

The cc-option macro is not doing what it should - compared with the
original from the rules.mak file that got removed with commit
660f793093 ("Makefile: inline the relevant parts of rules.mak"),
the arguments got changed and thus the macro is rather doubling
the QEMU_CFLAGS than adding the flag that should be tested.

Message-Id: <20210502174836.838816-3-thuth@redhat.com>
Fixes: 22fb2ab096 ("pc-bios/s390-ccw: do not use rules.mak")
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: da231910d33084ccf63f07de210b145e0fa31d98
      
https://github.com/qemu/qemu/commit/da231910d33084ccf63f07de210b145e0fa31d98
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-05-09 (Sun, 09 May 2021)

  Changed paths:
    M pc-bios/s390-ccw/Makefile

  Log Message:
  -----------
  pc-bios/s390-ccw: Silence GCC 11 stringop-overflow warning

When building on Fedora 34 (gcc version 11.0.0 20210210) we get:

  In file included from pc-bios/s390-ccw/main.c:11:
  In function ‘memset’,
      inlined from ‘boot_setup’ at pc-bios/s390-ccw/main.c:185:5,
      inlined from ‘main’ at pc-bios/s390-ccw/main.c:288:5:
  pc-bios/s390-ccw/libc.h:28:14: warning: writing 1 byte into a region of size 
0 [-Wstringop-overflow=]
     28 |         p[i] = c;
        |         ~~~~~^~~

The offending code is:

  memset((char *)S390EP, 0, 6);

where S390EP is a const address:

  #define S390EP 0x10008

The compiler doesn't know how big that pointed area is, so it assume that
its length is zero. This has been reported as BZ#99578 to GCC:
"gcc-11 -Warray-bounds or -Wstringop-overread warning when accessing a
pointer from integer literal"
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578

As this warning does us more harm than good in the BIOS code (where
lot of direct accesses to low memory are done), silence this warning
for all BIOS objects.

Suggested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210422145911.2513980-1-philmd@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-Id: <20210502174836.838816-4-thuth@redhat.com>
[thuth: Use the pre-existing cc-option macro instead of adding a new one]
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: a5b2afd522dde375c38cf94b7c696ffa3faba2fb
      
https://github.com/qemu/qemu/commit/a5b2afd522dde375c38cf94b7c696ffa3faba2fb
  Author: Thomas Huth <thuth@redhat.com>
  Date:   2021-05-09 (Sun, 09 May 2021)

  Changed paths:
    M configure
    M pc-bios/s390-ccw/Makefile

  Log Message:
  -----------
  pc-bios/s390-ccw: Allow building with Clang, too

Clang unfortunately does not support generating code for the z900
architecture level and starts with the z10 instead. Thus to be able
to support compiling with Clang, we have to check for the supported
compiler flags. The disadvantage is of course that the bios image
will only run with z10 guest CPUs upwards (which is what most people
use anyway), so just in case let's also emit a warning in that case
(we will continue to ship firmware images that have been pre-built
with GCC in future releases, so this should not impact normal users,
too).

Message-Id: <20210502174836.838816-5-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: f612e211e515d3699b30be6fd1b5cd73c0259785
      
https://github.com/qemu/qemu/commit/f612e211e515d3699b30be6fd1b5cd73c0259785
  Author: Thomas Huth <thuth@redhat.com>
  Date:   2021-05-10 (Mon, 10 May 2021)

  Changed paths:
    M pc-bios/s390-ccw.img
    M pc-bios/s390-netboot.img

  Log Message:
  -----------
  pc-bios/s390: Update the s390-ccw bios binaries with the Clang and other fixes

Rebuild the s390-ccw firmware with my Clang fixes and the ECKD null
block number fix from Marc.

Signed-off-by: Thomas Huth <thuth@redhat.com>


  Commit: 7c7cb752d7e751c0a9ba41a7bf771b98b77952b6
      
https://github.com/qemu/qemu/commit/7c7cb752d7e751c0a9ba41a7bf771b98b77952b6
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2021-05-11 (Tue, 11 May 2021)

  Changed paths:
    M configure
    M pc-bios/s390-ccw.img
    M pc-bios/s390-ccw/Makefile
    M pc-bios/s390-ccw/bootmap.c
    M pc-bios/s390-ccw/jump2ipl.c
    M pc-bios/s390-ccw/netboot.mak
    M pc-bios/s390-ccw/s390-ccw.h
    M pc-bios/s390-netboot.img

  Log Message:
  -----------
  Merge remote-tracking branch 
'remotes/thuth-gitlab/tags/s390-ccw-bios-2021-05-10' into staging

* Make the s390-ccw bios compilable with Clang
* Fix ECKD booting with null block numbers in the chain

# gpg: Signature made Mon 10 May 2021 08:27:34 BST
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* remotes/thuth-gitlab/tags/s390-ccw-bios-2021-05-10:
  pc-bios/s390: Update the s390-ccw bios binaries with the Clang and other fixes
  pc-bios/s390-ccw: Allow building with Clang, too
  pc-bios/s390-ccw: Silence GCC 11 stringop-overflow warning
  pc-bios/s390-ccw: Fix the cc-option macro in the Makefile
  pc-bios/s390-ccw: Silence warning from Clang by marking panic() as noreturn
  pc-bios/s390-ccw/netboot: Use "-Wl," prefix to pass parameter to the linker
  pc-bios/s390-ccw: Use reset_psw pointer instead of hard-coded null pointer
  pc-bios/s390-ccw/bootmap: Silence compiler warning from Clang
  pc-bios/s390-ccw: don't try to read the next block if end of chunk is reached

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


Compare: https://github.com/qemu/qemu/compare/44cff35f2377...7c7cb752d7e7



reply via email to

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