1. 11 8月, 2016 3 次提交
  2. 10 8月, 2016 25 次提交
    • P
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · 4b3e5c06
      Peter Maydell 提交于
      * 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 <bonzini@gnu.org>"
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
      # 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: NPeter Maydell <peter.maydell@linaro.org>
      4b3e5c06
    • P
      vhost-user: Attempt to fix a race with set_mem_table. · 28ed5ef1
      Prerna Saxena 提交于
      The set_mem_table command currently does not seek a reply. Hence, there is
      no easy way for a remote application to notify to QEMU when it finished
      setting up memory, or if there were errors doing so.
      
      As an example:
      (1) Qemu sends a SET_MEM_TABLE to the backend (eg, a vhost-user net
      application). SET_MEM_TABLE does not require a reply according to the spec.
      (2) Qemu commits the memory to the guest.
      (3) Guest issues an I/O operation over a new memory region which was configured on (1).
      (4) The application has not yet remapped the memory, but it sees the I/O request.
      (5) The application cannot satisfy the request because it does not know about those GPAs.
      
      While a guaranteed fix would require a protocol extension (committed separately),
      a best-effort workaround for existing applications is to send a GET_FEATURES
      message before completing the vhost_user_set_mem_table() call.
      Since GET_FEATURES requires a reply, an application that processes vhost-user
      messages synchronously would probably have completed the SET_MEM_TABLE before replying.
      Signed-off-by: NPrerna Saxena <prerna.saxena@nutanix.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      28ed5ef1
    • P
      vhost-user: Introduce a new protocol feature REPLY_ACK. · ca525ce5
      Prerna Saxena 提交于
      This introduces the VHOST_USER_PROTOCOL_F_REPLY_ACK.
      
      If negotiated, client applications should send a u64 payload in
      response to any message that contains the "need_reply" bit set
      on the message flags. Setting the payload to "zero" indicates the
      command finished successfully. Likewise, setting it to "non-zero"
      indicates an error.
      
      Currently implemented only for SET_MEM_TABLE.
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: NPrerna Saxena <prerna.saxena@nutanix.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      ca525ce5
    • I
      vhost: check for vhost_ops before using. · ca10203c
      Ilya Maximets 提交于
      'vhost_set_vring_enable()' tries to call function using pointer to
      'vhost_ops' which can be already zeroized in 'vhost_dev_cleanup()'
      while vhost disconnection.
      
      Fix that by checking 'vhost_ops' before using. This fixes QEMU crash
      on calling 'ethtool -L eth0 combined 2' if vhost disconnected.
      Signed-off-by: NIlya Maximets <i.maximets@samsung.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      ca10203c
    • P
      Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.7-20160810' into staging · d578cca3
      Peter Maydell 提交于
      ppc patch queue for 2016-08-10
      
      Here are some more last minute PAPR and ppc related fixes for
      qemu-2.7.  One patch makes compressed memory dumps work with guest
      kernels using page sizes up to 64KiB.  This is important since most
      current pseries guests use a 64KiB default page size.  The remainder
      fix a regression with handling of CPU aliases which causes serious
      problem for libvirt.
      
      # gpg: Signature made Wed 10 Aug 2016 06:44:27 BST
      # gpg:                using RSA key 0x6C38CACA20D9B392
      # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>"
      # gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>"
      # gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>"
      # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
      # gpg:          It is not certain that the signature belongs to the owner.
      # Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392
      
      * remotes/dgibson/tags/ppc-for-2.7-20160810:
        ppc/kvm: Register also a generic spapr CPU core family type
        ppc/kvm: Do not mess up the generic CPU family registration
        hw/ppc/spapr: Look up CPU alias names instead of hard-coding the aliases
        ppc: Introduce a function to look up CPU alias strings
        spapr: remove extra type variable
        ppc64: fix compressed dump with pseries kernel
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      d578cca3
    • P
      checkpatch: default to success if only warnings · 141de886
      Paolo Bonzini 提交于
      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: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      141de886
    • P
      checkpatch: bump most warnings to errors · c2df8783
      Paolo Bonzini 提交于
      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: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      c2df8783
    • P
      CODING_STYLE, checkpatch: update line length rules · 8fbe3d1f
      Paolo Bonzini 提交于
      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: NCornelia Huck <cornelia.huck@de.ibm.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      8fbe3d1f
    • P
      checkpatch: check for CVS keywords on all sources · 93eb8e31
      Paolo Bonzini 提交于
      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: NPaolo Bonzini <pbonzini@redhat.com>
      93eb8e31
    • P
      checkpatch: tweak the files in which TABs are checked · 906fb135
      Paolo Bonzini 提交于
      Include Python and shell scripts, and make an exception for Perl
      scripts we imported from Linux or elsewhere.
      Acked-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      906fb135
    • T
      ppc/kvm: Register also a generic spapr CPU core family type · d11b268e
      Thomas Huth 提交于
      There is a regression with the "-cpu" parameter introduced by
      the spapr CPU hotplug code: We used to allow to specify a
      "CPU family" name with the "-cpu" parameter when running on KVM so
      that the user does not need to know the gory details of the exact
      CPU version of the host CPU. For example, it was possible to
      use "-cpu POWER8" on a POWER8E host CPU. This behavior does not
      work anymore with the new hot-pluggable spapr-cpu-core types.
      Since libvirt already heavily depends on the old behavior, this
      is quite a severe regression in the QEMU parameter interface.
      Let's fix it by supporting a CPU family type for the spapr-cpu-core
      on KVM, too.
      
      Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1363812Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      d11b268e
    • T
      ppc/kvm: Do not mess up the generic CPU family registration · 9c83fc2e
      Thomas Huth 提交于
      The code for registering the sPAPR CPU host core type has been
      added inbetween the generic CPU host core type and the generic
      CPU family type. That way the instance_init and the class_init
      information got lost when registering the generic CPU family
      type. Fix it by moving the generic family registration before
      the spapr cpu core registration code.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      9c83fc2e
    • T
      hw/ppc/spapr: Look up CPU alias names instead of hard-coding the aliases · 4babfaf0
      Thomas Huth 提交于
      Hard-coding the CPU alias names in the spapr_cores[] array has
      two big disadvantages:
      
      1) We register a real type with the CPU alias name in
         spapr_cpu_core_register_types() - this prevents us from registering
         a CPU family name in kvm_ppc_register_host_cpu_type() with the same
         name (as we do it for the non-hotpluggable CPU types).
      
      2) It's quite cumbersome to maintain the aliases here in sync with the
         ppc_cpu_aliases list from target-ppc/cpu-models.c.
      
      So let's simply add proper alias lookup to the spapr cpu core code,
      too (by checking whether the given model can be used directly, and
      if not by trying to look up the given model as an alias name instead).
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      4babfaf0
    • T
      ppc: Introduce a function to look up CPU alias strings · caf6316d
      Thomas Huth 提交于
      We will need this function to look up the aliases in the
      spapr-cpu-core code, too.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      caf6316d
    • C
      spapr: remove extra type variable · caebf378
      Cédric Le Goater 提交于
      The sPAPR CPU core typename is already available in the upper
      block. Let's use it and move the check upward also.
      Signed-off-by: NCédric Le Goater <clg@kaod.org>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      caebf378
    • L
      ppc64: fix compressed dump with pseries kernel · 760d88d1
      Laurent Vivier 提交于
      If we don't provide the page size in target-ppc:cpu_get_dump_info(),
      the default one (TARGET_PAGE_SIZE, 4KB) is used to create
      the compressed dump. It works fine with Macintosh, but not with
      pseries as the kernel default page size is 64KB.
      
      Without this patch, if we generate a compressed dump in the QEMU monitor:
      
          (qemu) dump-guest-memory -z qemu.dump
      
      This dump cannot be read by crash:
      
          # crash vmlinux qemu.dump
          ...
          WARNING: cannot translate vmemmap kernel virtual addresses:
                   commands requiring page structure contents will fail
          ...
      
      Page_size is used to determine the dumpfile's block size. The
      block size needs to be at least the page size, but a multiple of page
      size works fine too. For PPC64, linux supports either 4KB or 64KB software
      page size. So we define the page_size to 64KB.
      Signed-off-by: NLaurent Vivier <lvivier@redhat.com>
      Reviewed-by: NAndrew Jones <drjones@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      760d88d1
    • G
      timer: set vm_clock disabled default · 3fdd0ee3
      Gonglei 提交于
      (commit 80dcfb85)
      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 <pbonzini@redhat.com>
      CC: Dr. David Alan Gilbert <dgilbert@redhat.com>
      CC: qemu-stable@nongnu.org
      Signed-off-by: NGonglei <arei.gonglei@huawei.com>
      Message-Id: <1470728955-90600-1-git-send-email-arei.gonglei@huawei.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      3fdd0ee3
    • R
      checkpatch: ignore automatically imported Linux headers · 93bf13c6
      Radim Krčmář 提交于
      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: NRadim Krčmář <rkrcmar@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      93bf13c6
    • P
      clang: Fix warning reg. expansion to 'defined' · 2368635d
      Pranith Kumar 提交于
      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: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NPranith Kumar <bobby.prani@gmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2368635d
    • P
      Disable warn about left shifts of negative values · 435405ac
      Pranith Kumar 提交于
      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 <peter.maydell@linaro.org>
      Cc: Markus Armbruster <armbru@redhat.com>
      Cc: Laszlo Ersek <lersek@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      [pranith: forward-port part of patch to 2.7]
      Signed-off-by: NPranith Kumar <bobby.prani@gmail.com>
      435405ac
    • P
      atomic: strip "const" from variables declared with typeof · 5927ed84
      Paolo Bonzini 提交于
      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: NPranith Kumar <bobby.prani@gmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      [pranith: Add conversion for bool type]
      Signed-off-by: NPranith Kumar <bobby.prani@gmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      5927ed84
    • P
      optionrom: fix compilation with mingw docker target · 9d4cd7b4
      Paolo Bonzini 提交于
      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: NPaolo Bonzini <pbonzini@redhat.com>
      9d4cd7b4
    • P
      optionrom: add -fno-stack-protector · b0e8f5ca
      Paolo Bonzini 提交于
      This is required by OpenBSD.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b0e8f5ca
    • M
      build-sys: fix building with make CFLAGS=.. argument · a9c87304
      Marc-André Lureau 提交于
      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: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20160805082421.21994-2-marcandre.lureau@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      a9c87304
    • P
      linuxboot_dma: avoid guest ABI breakage on gcc vs. clang compilation · 7f256924
      Paolo Bonzini 提交于
      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 6f71b779
      ("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: NPaolo Bonzini <pbonzini@redhat.com>
      7f256924
  3. 09 8月, 2016 7 次提交
  4. 08 8月, 2016 5 次提交