1. 20 9月, 2017 12 次提交
  2. 19 9月, 2017 28 次提交
    • P
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · 7ec6a364
      Peter Maydell 提交于
      * warning improvements (Alistair)
      * KVM code cleanup (David)
      * scsi-block support for rerror/werror (Fam)
      * support for >64 vCPUs in Windows (Gonglei)
      * SCSI fix (Hannes)
      * SSE bugfixes (Joseph)
      * SmartOS compilation fixes (Kamil)
      * Hyper-V frequency MSR support (Ladi)
      * move more files to accel/tcg (Philippe, Thomas)
      * multiboot validation (PJP)
      * virtqueue size configuration for virtio-scsi (Richard)
      * Hyper-V header cleanup (Roman)
      * Maintainer email update (Guangrong)
      * checkpatch.pl --branch (Daniel), fixes (Greg)
      * introducing scsi/ (me)
      
      # gpg: Signature made Tue 19 Sep 2017 15:21:26 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: (51 commits)
        docker: fix creation of archives
        default-configs: Replace $(and ...) with $(call land, ...)
        osdep.h: Prohibit disabling assert() in supported builds
        checkpatch: add hwaddr to @typeList
        accel/hax: move hax-stub.c to accel/stubs/
        target/i386: fix "info mem" for LA57 mode
        scripts: let checkpatch.pl process an entire GIT branch
        update-linux-headers: prepare for hyperv.h removal
        hyperv: add header with protocol definitions
        i386/cpu/hyperv: support over 64 vcpus for windows guests
        Convert remaining single line fprintf() to warn_report()
        Makefile: Remove libqemustub.a
        ptimer-test: do not link to libqemustub.a/libqemuutil.a
        target/mips: Convert VM clock update prints to warn_report
        General warn report fixups
        Convert multi-line fprintf() to warn_report()
        Convert single line fprintf(.../n) to warn_report()
        Convert remaining error_report() to warn_report()
        hw/i386: Improve some of the warning messages
        test-qga: add missing qemu-ga tool dependency
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      7ec6a364
    • P
      docker: fix creation of archives · 7437866b
      Paolo Bonzini 提交于
      The pixman submodule does not exist anymore, and its removal broke
      docker-based tests.  Fix it.
      
      Cc: Fam Zheng <famz@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      7437866b
    • T
      default-configs: Replace $(and ...) with $(call land, ...) · d321e6d5
      Thomas Huth 提交于
      Using $(and ...) is dangerous here: It only works as long as the first
      argument is set to 'y' or completely unset. It does not work if the
      first argument is set to 'n' for example. Let's use the "land" make
      function instead which has been written explicitely for this purpose.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Message-Id: <1505759538-15365-1-git-send-email-thuth@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      d321e6d5
    • E
      osdep.h: Prohibit disabling assert() in supported builds · 262a69f4
      Eric Blake 提交于
      We already have several files that knowingly require assert()
      to work, sometimes because refactoring the code for proper
      error handling has not been tackled yet; there are probably
      other files that have a similar situation but with no comments
      documenting the same.  In fact, we have places in migration
      that handle untrusted input with assertions, where disabling
      the assertions risks a worse security hole than the current
      behavior of losing the guest to SIGABRT when migration fails
      because of the assertion.  Promote our current per-file
      safety-valve to instead be project-wide, and expand it to also
      cover glib's g_assert().
      
      Note that we do NOT want to encourage 'assert(side-effects);'
      (that is a bad practice that prevents copy-and-paste of code to
      other projects that CAN disable assertions; plus it costs
      unnecessary reviewer mental cycles to remember whether a project
      special-cases the crippling of asserts); and we would LIKE to
      fix migration to not rely on asserts (but that takes a big code
      audit).  But in the meantime, we DO want to send a message
      that anyone that disables assertions has to tweak code in order
      to compile, making it obvious that they are taking on additional
      risk that we are not going to support.  At the same time, leave
      comments mentioning NDEBUG in files that we know still need to
      be scrubbed, so there is at least something to grep for.
      
      It would be possible to come up with some other mechanism for
      doing runtime checking by default, but which does not abort
      the program on failure, while leaving side effects in place
      (unlike how crippling assert() avoids even the side effects),
      perhaps under the name q_verify(); but it was not deemed worth
      the effort (developers should not have to learn a replacement
      when the standard C macro works just fine, and it would be a lot
      of churn for little gain).  The patch specifically uses #error
      rather than #warn so that a user is forced to tweak the header
      to acknowledge the issue, even when not using a -Werror
      compilation.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      
      Message-Id: <20170911211320.25385-1-eblake@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      262a69f4
    • G
      checkpatch: add hwaddr to @typeList · 825bfa00
      Greg Kurz 提交于
      The script doesn't know about all possible types and learn them as
      it parses the code. If it reaches a line with a type cast but the
      type isn't known yet, it is misinterpreted as an identifier.
      
      For example the following line:
      
          foo = (hwaddr) -1;
      
      results in the following false-positive to be reported:
      
      ERROR: spaces required around that '-' (ctx:VxV)
      
      Let's add this standard QEMU type to the list of pre-known types.
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Message-Id: <150538015789.8149.10902725348939486674.stgit@bahia.lan>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      825bfa00
    • P
      accel/hax: move hax-stub.c to accel/stubs/ · 4c44a007
      Philippe Mathieu-Daudé 提交于
      Suggested-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20170913221149.30382-1-f4bug@amsat.org>
      Reviewed-by: NStefan Weil <sw@weilnetz.de>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      4c44a007
    • P
      target/i386: fix "info mem" for LA57 mode · 128b52e8
      Paolo Bonzini 提交于
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      128b52e8
    • D
      scripts: let checkpatch.pl process an entire GIT branch · 8e1fe175
      Daniel P. Berrange 提交于
      Currently before submitting a series, devs should run checkpatch.pl
      across each patch to be submitted. This can be automated using a
      command such as:
      
        git rebase -i master -x 'git show | ./scripts/checkpatch.pl -'
      
      This is rather long winded to type, so this patch introduces a way
      to tell checkpatch.pl to validate a series of GIT revisions.
      
      There are now three modes it can operate in 1) check a patch 2) check a source
      file, or 3) check a git branch.
      
      If no flags are given, the mode is determined by checking the args passed to
      the command. If the args contain a literal ".." it is treated as a GIT revision
      list. If the args end in ".patch" or equal "-" it is treated as a patch file.
      Otherwise it is treated as a source file.
      
      This automatic guessing can be overridden using --[no-]patch --[no-]file or
      --[no-]branch
      
      For example to check a GIT revision list:
      
          $ ./scripts/checkpatch.pl master..
          total: 0 errors, 0 warnings, 297 lines checked
      
          b886d352a2bf58f0996471fb3991a138373a2957 has no obvious style problems and is ready for submission.
          total: 0 errors, 0 warnings, 182 lines checked
      
          2a731f9a9ce145e0e0df6d42dd2a3ce4dfc543fa has no obvious style problems and is ready for submission.
          total: 0 errors, 0 warnings, 102 lines checked
      
          11844169bcc0c8ed4449eb3744a69877ed329dd7 has no obvious style problems and is ready for submission.
      
      If a genuine patch filename contains the characters '..' it is
      possible to force interpretation of the arg as a patch
      
        $ ./scripts/checkpatch.pl --patch master..
      
      will force it to load a patch file called "master..", or equivalently
      
        $ ./scripts/checkpatch.pl --no-branch master..
      
      will simply turn off guessing of GIT revision lists.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      Message-Id: <20170913091000.9005-1-berrange@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      8e1fe175
    • R
      update-linux-headers: prepare for hyperv.h removal · 40bf8e9a
      Roman Kagan 提交于
      All definitions related to Hyper-V emulation are now taken from the QEMU
      own header, so the one imported from the kernel is no longer needed.
      
      Unfortunately it's included by kvm_para.h.
      
      So, until this is fixed in the kernel, teach the header harvesting
      script to substitute kernel's hyperv.h with a dummy.
      Signed-off-by: NRoman Kagan <rkagan@virtuozzo.com>
      Message-Id: <20170713201522.13765-3-rkagan@virtuozzo.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      40bf8e9a
    • R
      hyperv: add header with protocol definitions · 5e953812
      Roman Kagan 提交于
      The definitions for Hyper-V emulation are currently taken from a header
      imported from the Linux kernel.
      
      However, as these describe a third-party protocol rather than a kernel
      API, it probably wasn't a good idea to publish it in the kernel uapi.
      
      This patch introduces a header that provides all the necessary
      definitions, superseding the one coming from the kernel.
      
      The new header supports (temporary) coexistence with the kernel one.
      The constants explicitly named in the Hyper-V specification (e.g. msr
      numbers) are defined in a non-conflicting way.  Other constants and
      types have got new names.
      
      While at this, the protocol data structures are defined in a more
      conventional way, without bitfields, enums, and excessive unions.
      
      The code using this stuff is adjusted, too; it can now be built both
      with and without the kernel header in the tree.
      Signed-off-by: NRoman Kagan <rkagan@virtuozzo.com>
      Message-Id: <20170713201522.13765-2-rkagan@virtuozzo.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      5e953812
    • G
      i386/cpu/hyperv: support over 64 vcpus for windows guests · 6c69dfb6
      Gonglei 提交于
      Starting with Windows Server 2012 and Windows 8, if
      CPUID.40000005.EAX contains a value of -1, Windows assumes specific
      limit to the number of VPs. In this case, Windows Server 2012
      guest VMs may use more than 64 VPs, up to the maximum supported
      number of processors applicable to the specific Windows
      version being used.
      
      https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs
      
      For compatibility, Let's introduce a new property for X86CPU,
      named "x-hv-max-vps" as Eduardo's suggestion, and set it
      to 0x40 before machine 2.10.
      
      (The "x-" prefix indicates that the property is not supposed to
      be a stable user interface.)
      Signed-off-by: NGonglei <arei.gonglei@huawei.com>
      Message-Id: <1505143227-14324-1-git-send-email-arei.gonglei@huawei.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      6c69dfb6
    • A
      Convert remaining single line fprintf() to warn_report() · 05cb8ed5
      Alistair Francis 提交于
      Convert any remaining uses of fprintf(stderr, "warning:"...
      to use warn_report() instead. This helps standardise on a single
      method of printing warnings to the user.
      
      All of the warnings were changed using this command:
        find ./* -type f -exec sed -i 's|fprintf(.*".*warning[,:] |warn_report("|Ig' {} +
      
      The #include lines and chagnes to the test Makefile were manually
      updated to allow the code to compile.
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Message-Id: <2c94ac3bb116cc6b8ebbcd66a254920a69665515.1503077821.git.alistair.francis@xilinx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      05cb8ed5
    • P
      Makefile: Remove libqemustub.a · ebedb37c
      Paolo Bonzini 提交于
      Using two libraries (libqemuutil.a and libqemustub.a) would sometimes
      result in circular dependencies. To avoid these issues let's just
      combine both into a single library that functions as both.
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Message-Id: <54e6458745493d10901964624479a7d9a872f481.1503077821.git.alistair.francis@xilinx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ebedb37c
    • P
      ptimer-test: do not link to libqemustub.a/libqemuutil.a · 9ee24e98
      Paolo Bonzini 提交于
      This test provides its own mocks, so do not use the "standard"
      stubs in libqemustub.a or the event loop implementation in
      libqemuutil.a.
      
      This is required on OS X, which otherwise brings in qemu-timer.o,
      async.o and main-loop.o from libqemuutil.a.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      9ee24e98
    • A
      target/mips: Convert VM clock update prints to warn_report · 288cb949
      Alistair Francis 提交于
      Convert the fprintf() messages in kvm_mips_update_state() to use
      warn_report() as they aren't errors, but are just warnings.
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Message-Id: <e6acff8db6d264f913a18c86858b9aa600554e51.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      288cb949
    • A
      General warn report fixups · b62e39b4
      Alistair Francis 提交于
      Tidy up some of the warn_report() messages after having converted them
      to use warn_report().
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <9cb1d23551898c9c9a5f84da6773e99871285120.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b62e39b4
    • A
      Convert multi-line fprintf() to warn_report() · 8297be80
      Alistair Francis 提交于
      Convert all the multi-line uses of fprintf(stderr, "warning:"..."\n"...
      to use warn_report() instead. This helps standardise on a single
      method of printing warnings to the user.
      
      All of the warnings were changed using these commands:
        find ./* -type f -exec sed -i \
          'N; {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N; {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N; {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N;N {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N;N;N {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N;N;N;N {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N; {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
      
      Indentation fixed up manually afterwards.
      
      Some of the lines were manually edited to reduce the line length to below
      80 charecters. Some of the lines with newlines in the middle of the
      string were also manually edit to avoid checkpatch errrors.
      
      The #include lines were manually updated to allow the code to compile.
      
      Several of the warning messages can be improved after this patch, to
      keep this patch mechanical this has been moved into a later patch.
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Stefano Stabellini <sstabellini@kernel.org>
      Cc: Anthony Perard <anthony.perard@citrix.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Yongbok Kim <yongbok.kim@imgtec.com>
      Cc: Cornelia Huck <cohuck@redhat.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Acked-by: NCornelia Huck <cohuck@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <5def63849ca8f551630c6f2b45bcb1c482f765a6.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      8297be80
    • A
      Convert single line fprintf(.../n) to warn_report() · 2ab4b135
      Alistair Francis 提交于
      Convert all the single line uses of fprintf(stderr, "warning:"..."\n"...
      to use warn_report() instead. This helps standardise on a single
      method of printing warnings to the user.
      
      All of the warnings were changed using this command:
        find ./* -type f -exec sed -i \
          's|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig' \
          {} +
      
      Some of the lines were manually edited to reduce the line length to below
      80 charecters.
      
      The #include lines were manually updated to allow the code to compile.
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Yongbok Kim <yongbok.kim@imgtec.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: James Hogan <james.hogan@imgtec.com> [mips]
      Message-Id: <ae8f8a7f0a88ded61743dff2adade21f8122a9e7.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2ab4b135
    • A
      Convert remaining error_report() to warn_report() · 55d527a9
      Alistair Francis 提交于
      In a previous patch (3dc6f869) we
      converted uses of error_report("warning:"... to use warn_report()
      instead. This was to help standardise on a single method of printing
      warnings to the user.
      
      There appears to have been some cases that slipped through in patch sets
      applied around the same time, this patch catches the few remaining
      cases.
      
      All of the warnings were changed using this command:
        find ./* -type f -exec sed -i \
          's|error_report(".*warning[,:] |warn_report("|Ig' {} +
      
      Indentation fixed up manually afterwards.
      
      Two messages were manually fixed up as well.
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cohuck@redhat.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Acked-by: NCornelia Huck <cohuck@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <eec8cba0d5434bd828639e5e45f12182490ff47d.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      55d527a9
    • A
      hw/i386: Improve some of the warning messages · 9e5d2c52
      Alistair Francis 提交于
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Suggested-by: NEduardo Habkost <ehabkost@redhat.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Message-Id: <1d6ef2ccd9667878ed5820fcf17eef35957ea5d8.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      9e5d2c52
    • P
      test-qga: add missing qemu-ga tool dependency · 4be75077
      Philippe Mathieu-Daudé 提交于
      this fixes running 'make check-unit' without running 'make all' beforehand:
      
      $ make check-unit
        ...
        GTESTER tests/test-qga
      **
      ERROR:tests/test-qga.c:73:fixture_setup: assertion failed (error == NULL): Failed to execute child process "/build/qemu/qemu-ga" (No such file or directory) (g-exec-error-quark, 8)
      make: *** [check-tests/test-qga] Error 1
      Signed-off-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20170911210129.5874-1-f4bug@amsat.org>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4be75077
    • D
      kvm: kvm_log_sync() is only called with known memory sections · 67548f09
      David Hildenbrand 提交于
      Flatview will make sure that we can only end up in this function with
      memory sections that correspond to exactly one slot. So we don't
      have to iterate multiple times. There won't be overlapping slots but
      only matching slots.
      
      Properly align the section and look up the corresponding slot. This
      heavily simplifies this function.
      
      We can now get rid of kvm_lookup_overlapping_slot().
      Signed-off-by: NDavid Hildenbrand <david@redhat.com>
      Message-Id: <20170911174933.20789-7-david@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      67548f09
    • D
      kvm: kvm_log_start/stop are only called with known sections · 343562e8
      David Hildenbrand 提交于
      Let's properly align the sections first and bail out if we would ever
      get called with a memory section we don't know yet.
      Signed-off-by: NDavid Hildenbrand <david@redhat.com>
      Message-Id: <20170911174933.20789-6-david@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      343562e8
    • D
      kvm: we never have overlapping slots in kvm_set_phys_mem() · f357f564
      David Hildenbrand 提交于
      The way flatview handles memory sections, we will never have overlapping
      memory sections in kvm.
      
      address_space_update_topology_pass() will make sure that we will only
      get called for
      
      a) an existing memory section for which we only update parameters
      (log_start, log_stop).
      b) an existing memory section we want to delete (region_del)
      c) a brand new memory section we want to add (region_add)
      
      We cannot have overlapping memory sections in kvm as we will first remove
      the overlapping sections and then add the ones without conflicts.
      
      Therefore we can remove the complexity for handling prefix and suffix
      slots.
      Signed-off-by: NDavid Hildenbrand <david@redhat.com>
      Message-Id: <20170911174933.20789-5-david@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f357f564
    • D
      kvm: use start + size for memory ranges · 2747e716
      David Hildenbrand 提交于
      Convert kvm_lookup_matching_slot().
      Signed-off-by: NDavid Hildenbrand <david@redhat.com>
      Message-Id: <20170911174933.20789-4-david@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2747e716
    • D
      kvm: factor out alignment of memory section · 5ea69c2e
      David Hildenbrand 提交于
      Factor it out, so we can reuse it later.
      Signed-off-by: NDavid Hildenbrand <david@redhat.com>
      Message-Id: <20170911174933.20789-3-david@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      5ea69c2e
    • D
      kvm: require JOIN_MEMORY_REGIONS_WORKS · 89de4b91
      David Hildenbrand 提交于
      We already require DESTROY_MEMORY_REGION_WORKS, JOIN_MEMORY_REGIONS_WORKS
      was added just half a year later.
      
      In addition, with flatview overlapping memory regions are first
      removed before adding the changed one. So we can't really detect joining
      memory regions this way.
      
      Let's just get rid of this special handling.
      Signed-off-by: NDavid Hildenbrand <david@redhat.com>
      Message-Id: <20170911174933.20789-2-david@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      89de4b91
    • P
      multiboot: validate multiboot header address values · ed4f86e8
      Prasad J Pandit 提交于
      While loading kernel via multiboot-v1 image, (flags & 0x00010000)
      indicates that multiboot header contains valid addresses to load
      the kernel image. These addresses are used to compute kernel
      size and kernel text offset in the OS image. Validate these
      address values to avoid an OOB access issue.
      
      This is CVE-2017-14167.
      Reported-by: NThomas Garnier <thgarnie@google.com>
      Signed-off-by: NPrasad J Pandit <pjp@fedoraproject.org>
      Message-Id: <20170907063256.7418-1-ppandit@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ed4f86e8