qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 7f2569: linuxboot_dma: avoid guest ABI breaka


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 7f2569: linuxboot_dma: avoid guest ABI breakage on gcc vs....
Date: Wed, 10 Aug 2016 09:30:07 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 7f2569246c81d5f88e74c142b8fbdc0ee601bffe
      
https://github.com/qemu/qemu/commit/7f2569246c81d5f88e74c142b8fbdc0ee601bffe
  Author: Paolo Bonzini <address@hidden>
  Date:   2016-08-09 (Tue, 09 Aug 2016)

  Changed paths:
    M pc-bios/linuxboot_dma.bin
    M pc-bios/optionrom/linuxboot_dma.c
    M scripts/signrom.py

  Log Message:
  -----------
  linuxboot_dma: avoid guest ABI breakage on gcc vs. clang compilation

Recent GCC compiles linuxboot_dma.c to 921 bytes, while CentOS 6 needs
1029 and clang needs 1527.  Because the size of the ROM, rounded to the
next 512 bytes, must match, this causes the API to break between a <1K
ROM and one that is bigger.

We want to make the ROM 1.5 KB in size, but it's better to make clang
produce leaner ROMs, because currently it is worryingly close to the limit.
To fix this prevent clang's happy inlining (which -Os cannot prevent).
This only requires adding a noinline attribute.

Second, the patch makes sure that the ROM has enough padding to prevent
ABI breakage on different compilers.  The size is now hardcoded in the file
that is passed to signrom.py, as was the case before commit 6f71b77
("scripts/signrom.py: Allow option ROM checksum script to write the size
header.", 2016-05-23); signrom.py however will still pad the input to
the requested size.  This ensures that the padding goes beyond the
next multiple of 512 if necessary, and also avoids the need for
-fno-toplevel-reorder which clang doesn't support.  signrom.py can then
error out if the requested size is too small for the actual size of the
compiled ROM.

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: a9c87304b76d1d61687d585516abb4c6e0ae809e
      
https://github.com/qemu/qemu/commit/a9c87304b76d1d61687d585516abb4c6e0ae809e
  Author: Marc-André Lureau <address@hidden>
  Date:   2016-08-09 (Tue, 09 Aug 2016)

  Changed paths:
    M Makefile
    M pc-bios/optionrom/Makefile

  Log Message:
  -----------
  build-sys: fix building with make CFLAGS=.. argument

When calling make with a CFLAGS=.. argument, the -g/-O filter is not
applied, which may result with build failure with ASAN for example. It
could be solved with an 'override' directive on CFLAGS, but that would
actually prevent setting different CFLAGS manually.

Instead, filter the CFLAGS argument from the top-level Makefile (so
you could still call make with a different CFLAGS argument on a
rom/Makefile manually)

Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: b0e8f5cadcce7c1e2047e1e2c96f827a26171f58
      
https://github.com/qemu/qemu/commit/b0e8f5cadcce7c1e2047e1e2c96f827a26171f58
  Author: Paolo Bonzini <address@hidden>
  Date:   2016-08-09 (Tue, 09 Aug 2016)

  Changed paths:
    M pc-bios/optionrom/Makefile

  Log Message:
  -----------
  optionrom: add -fno-stack-protector

This is required by OpenBSD.

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 9d4cd7b4ed413a1371997ce74da39900b2a8473b
      
https://github.com/qemu/qemu/commit/9d4cd7b4ed413a1371997ce74da39900b2a8473b
  Author: Paolo Bonzini <address@hidden>
  Date:   2016-08-09 (Tue, 09 Aug 2016)

  Changed paths:
    M pc-bios/optionrom/Makefile
    A pc-bios/optionrom/flat.lds

  Log Message:
  -----------
  optionrom: fix compilation with mingw docker target

Two fixes are needed.  First, mingw does not have -D_FORTIFY_SOURCE,
hence --enable-debug disables optimization.  This is not acceptable
for ROMs, which should override CFLAGS to force inclusion of -O2.

Second, PE stores global constructors and destructors using the
following linker script snippet:

     ___CTOR_LIST__ = .; __CTOR_LIST__ = . ;
                        LONG (-1);*(.ctors); *(.ctor); *(SORT(.ctors.*));  LONG 
(0);
     ___DTOR_LIST__ = .; __DTOR_LIST__ = . ;
                        LONG (-1); *(.dtors); *(.dtor); *(SORT(.dtors.*));  
LONG (0);

The LONG directives cause the .img files to be 16 bytes too large;
the recently added check to signrom.py catches this.  To fix this,
replace -T and -e options with a linker script.

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 5927ed846ad17e1cc8e9f60f50486ec418829776
      
https://github.com/qemu/qemu/commit/5927ed846ad17e1cc8e9f60f50486ec418829776
  Author: Paolo Bonzini <address@hidden>
  Date:   2016-08-09 (Tue, 09 Aug 2016)

  Changed paths:
    M include/qemu/atomic.h

  Log Message:
  -----------
  atomic: strip "const" from variables declared with typeof

With the latest clang, we have the following warning:

    /home/pranith/devops/code/qemu/include/qemu/seqlock.h:62:21: warning: 
passing 'typeof (*&sl->sequence) *' (aka 'const unsigned int *') to parameter 
of type 'unsigned int *' discards qualifiers 
[-Wincompatible-pointer-types-discards-qualifiers]
  return unlikely(atomic_read(&sl->sequence) != start);
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/pranith/devops/code/qemu/include/qemu/atomic.h:58:25: note: expanded 
from macro 'atomic_read'
  __atomic_load(ptr, &_val, __ATOMIC_RELAXED);     \
                     ^~~~~

Stripping const is a bit tricky due to promotions, but it is doable
with either C11 _Generic or GCC extensions.  Use the latter.

Reported-by: Pranith Kumar <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
[pranith: Add conversion for bool type]
Signed-off-by: Pranith Kumar <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 435405ac59b9334b06285e1192c693b497282a31
      
https://github.com/qemu/qemu/commit/435405ac59b9334b06285e1192c693b497282a31
  Author: Pranith Kumar <address@hidden>
  Date:   2016-08-09 (Tue, 09 Aug 2016)

  Changed paths:
    M HACKING
    M configure

  Log Message:
  -----------
  Disable warn about left shifts of negative values

It seems like there's no good reason for the compiler to exploit the
undefinedness of left shifts.  GCC explicitly documents that they do not
use at all this possibility and, while they also say this is subject
to change, they have been saying this for 10 years (since the wording
appeared in the GCC 4.0 manual).

Disable these warnings by passing in -Wno-shift-negative-value.

Cc: Peter Maydell <address@hidden>
Cc: Markus Armbruster <address@hidden>
Cc: Laszlo Ersek <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
[pranith: forward-port part of patch to 2.7]
Signed-off-by: Pranith Kumar <address@hidden>


  Commit: 2368635d3943294c672a62abd60a233aca708982
      
https://github.com/qemu/qemu/commit/2368635d3943294c672a62abd60a233aca708982
  Author: Pranith Kumar <address@hidden>
  Date:   2016-08-09 (Tue, 09 Aug 2016)

  Changed paths:
    M include/ui/qemu-spice.h

  Log Message:
  -----------
  clang: Fix warning reg. expansion to 'defined'

Clang produces the following warning. The warning is detailed here:
https://reviews.llvm.org/D15866. Fix the warning.

/home/pranith/devops/code/qemu/hw/display/qxl.c:507:5: warning: macro expansion 
producing 'defined' has undefined behavior [-Wexpansion-to-defined]
    ^
/home/pranith/devops/code/qemu/include/ui/qemu-spice.h:46:5: note: expanded 
from macro 'SPICE_NEEDS_SET_MM_TIME'
  (!defined(SPICE_SERVER_VERSION) || (SPICE_SERVER_VERSION < 0xc06))
    ^
/home/pranith/devops/code/qemu/hw/display/qxl.c:1074:5: warning: macro 
expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]
    ^
/home/pranith/devops/code/qemu/include/ui/qemu-spice.h:46:5: note: expanded 
from macro 'SPICE_NEEDS_SET_MM_TIME'
  (!defined(SPICE_SERVER_VERSION) || (SPICE_SERVER_VERSION < 0xc06))

Suggested-by: Peter Maydell <address@hidden>
Signed-off-by: Pranith Kumar <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 93bf13c6df4d6fd1a889cae890a9570eb00eb8e5
      
https://github.com/qemu/qemu/commit/93bf13c6df4d6fd1a889cae890a9570eb00eb8e5
  Author: Radim Krčmář <address@hidden>
  Date:   2016-08-09 (Tue, 09 Aug 2016)

  Changed paths:
    M scripts/checkpatch.pl

  Log Message:
  -----------
  checkpatch: ignore automatically imported Linux headers

Linux uses tabs for indentation and checkpatch always complained about
automatically imported headers.  update-linux-headers.sh could be modified to
expand tabs, but there is no real reason to complain about any ugly code in
Linux headers, so skip all hunk-related checks.

Signed-off-by: Radim Krčmář <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 3fdd0ee393e26178a4892e101e60b011bbfaa9ea
      
https://github.com/qemu/qemu/commit/3fdd0ee393e26178a4892e101e60b011bbfaa9ea
  Author: Gonglei <address@hidden>
  Date:   2016-08-09 (Tue, 09 Aug 2016)

  Changed paths:
    M qemu-timer.c
    M tests/test-aio.c

  Log Message:
  -----------
  timer: set vm_clock disabled default

(commit 80dcfb8532ae76343109a48f12ba8ca1c505c179)
Upon migration, the code use a timer based on vm_clock for 1ns
in the future from post_load to do the event send in case host_connected
differs between migration source and target.

However, it's not guaranteed that the apic is ready to inject irqs into
the guest, and the irq line remained high, resulting in any future interrupts
going unnoticed by the guest as well.

That's because 1) the migration coroutine is not blocked when it get EAGAIN
while reading QEMUFile. 2) The vm_clock is enabled default currently, it doesn't
rely on the calling of vm_start(), that means vm_clock timers can run before
VCPUs are running.

So, let's set the vm_clock disabled default, keep the initial intention of
design for vm_clock timers.

Meanwhile, change the test-aio usecase, using QEMU_CLOCK_REALTIME instead of
QEMU_CLOCK_VIRTUAL as the block code does.

CC: Paolo Bonzini <address@hidden>
CC: Dr. David Alan Gilbert <address@hidden>
CC: address@hidden
Signed-off-by: Gonglei <address@hidden>
Message-Id: <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 906fb135e4b875465c424cb9b2b47d90265f7897
      
https://github.com/qemu/qemu/commit/906fb135e4b875465c424cb9b2b47d90265f7897
  Author: Paolo Bonzini <address@hidden>
  Date:   2016-08-10 (Wed, 10 Aug 2016)

  Changed paths:
    M scripts/checkpatch.pl

  Log Message:
  -----------
  checkpatch: tweak the files in which TABs are checked

Include Python and shell scripts, and make an exception for Perl
scripts we imported from Linux or elsewhere.

Acked-by: Cornelia Huck <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 93eb8e31f38b3eb612e522c62e8932d7fd576ff9
      
https://github.com/qemu/qemu/commit/93eb8e31f38b3eb612e522c62e8932d7fd576ff9
  Author: Paolo Bonzini <address@hidden>
  Date:   2016-08-10 (Wed, 10 Aug 2016)

  Changed paths:
    M scripts/checkpatch.pl

  Log Message:
  -----------
  checkpatch: check for CVS keywords on all sources

These should apply to all files, not just C/C++.  Tweak the regular
expression to check for whole words, to avoid false positives on Perl
variables starting with "Id".

Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 8fbe3d1fcfa16c543f49f24e7cdfbf0024459341
      
https://github.com/qemu/qemu/commit/8fbe3d1fcfa16c543f49f24e7cdfbf0024459341
  Author: Paolo Bonzini <address@hidden>
  Date:   2016-08-10 (Wed, 10 Aug 2016)

  Changed paths:
    M CODING_STYLE
    M scripts/checkpatch.pl

  Log Message:
  -----------
  CODING_STYLE, checkpatch: update line length rules

Line lengths above 80 characters do exist.  They are rare, but
they happen from time to time.  An ignored rule is worse than an
exception to the rule, so do the latter.

Some on the list expressed their preference for a soft limit that
is slightly lower than 80 characters, to account for extra characters
in unified diffs (including three-way diffs) and for email quoting.
However, there was no consensus on this so keep the 80-character
soft limit and add a hard limit at 90.

Acked-by: Cornelia Huck <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: c2df8783251e16279229520f7cf5cb81c188a934
      
https://github.com/qemu/qemu/commit/c2df8783251e16279229520f7cf5cb81c188a934
  Author: Paolo Bonzini <address@hidden>
  Date:   2016-08-10 (Wed, 10 Aug 2016)

  Changed paths:
    M scripts/checkpatch.pl

  Log Message:
  -----------
  checkpatch: bump most warnings to errors

This only leaves a warning-level message for the extra-long lines
soft limit.  Everything else is bumped up.

In the future warnings can be added for checks that can have false
positives.

Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 141de8865488189ad9d75408b3e0ad24c6fff2bb
      
https://github.com/qemu/qemu/commit/141de8865488189ad9d75408b3e0ad24c6fff2bb
  Author: Paolo Bonzini <address@hidden>
  Date:   2016-08-10 (Wed, 10 Aug 2016)

  Changed paths:
    M scripts/checkpatch.pl

  Log Message:
  -----------
  checkpatch: default to success if only warnings

CHK-level checks have been removed from checkpatch or bumped to
errors, so there is no effect anymore for --strict/--subjective.
Furthermore, even most WARNs have been bumped to errors, with
WARN only reserved to things that patchew probably ought not
to complain about (and that maintainers probably will notice
anyway during review if they are extreme).

Default to exiting with success even if there are WARN-level
failures, and cause --strict to fail for warnings.  Maintainers
that want to have a strict 80-character limit for their subsystem
can add it to a commit hook for example.

The --subjective synonym is removed.

Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>


  Commit: 4b3e5c06a15298d870e81c2d3a5a16dc2a93f5cc
      
https://github.com/qemu/qemu/commit/4b3e5c06a15298d870e81c2d3a5a16dc2a93f5cc
  Author: Peter Maydell <address@hidden>
  Date:   2016-08-10 (Wed, 10 Aug 2016)

  Changed paths:
    M CODING_STYLE
    M HACKING
    M Makefile
    M configure
    M include/qemu/atomic.h
    M include/ui/qemu-spice.h
    M pc-bios/linuxboot_dma.bin
    M pc-bios/optionrom/Makefile
    A pc-bios/optionrom/flat.lds
    M pc-bios/optionrom/linuxboot_dma.c
    M qemu-timer.c
    M scripts/checkpatch.pl
    M scripts/signrom.py
    M tests/test-aio.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

* pc-bios/optionrom/Makefile fixes
* warning fixes for __atomic_load and -1 << x in clang
* missed interrupt fix from Gonglei
* checkpatch fix from Radim and myself

# gpg: Signature made Wed 10 Aug 2016 14:54:31 BST
# gpg:                using RSA key 0xBFFBD25F78C7AE83
# gpg: Good signature from "Paolo Bonzini <address@hidden>"
# gpg:                 aka "Paolo Bonzini <address@hidden>"
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini/tags/for-upstream:
  checkpatch: default to success if only warnings
  checkpatch: bump most warnings to errors
  CODING_STYLE, checkpatch: update line length rules
  checkpatch: check for CVS keywords on all sources
  checkpatch: tweak the files in which TABs are checked
  timer: set vm_clock disabled default
  checkpatch: ignore automatically imported Linux headers
  clang: Fix warning reg. expansion to 'defined'
  Disable warn about left shifts of negative values
  atomic: strip "const" from variables declared with typeof
  optionrom: fix compilation with mingw docker target
  optionrom: add -fno-stack-protector
  build-sys: fix building with make CFLAGS=.. argument
  linuxboot_dma: avoid guest ABI breakage on gcc vs. clang compilation

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


Compare: https://github.com/qemu/qemu/compare/d578cca33316...4b3e5c06a152

reply via email to

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