1. 05 3月, 2017 12 次提交
    • M
      qapi: Clean up after commit 3d344c2a · b8874fbf
      Markus Armbruster 提交于
      Drop unused QIV_STACK_SIZE and unused qobject_input_start_struct()
      parameter errp.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-13-git-send-email-armbru@redhat.com>
      b8874fbf
    • M
      qapi: Improve a QObject input visitor error message · 910f738b
      Markus Armbruster 提交于
      The QObject input visitor has three error message formats:
      
      * Parameter '%s' is missing
      * "Invalid parameter type for '%s', expected: %s"
      * "QMP input object member '%s' is unexpected"
      
      The '%s' are member names (or "null", but I'll fix that later).
      
      The last error message calls the thing "QMP input object member"
      instead of "parameter".  Misleading when the visitor is used on
      QObjects that don't come from QMP.  Change it to "Parameter '%s' is
      unexpected".
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-12-git-send-email-armbru@redhat.com>
      910f738b
    • M
      qmp: Eliminate silly QERR_QMP_* macros · 99fb0c53
      Markus Armbruster 提交于
      The QERR_ macros are leftovers from the days of "rich" error objects.
      
      QERR_QMP_BAD_INPUT_OBJECT, QERR_QMP_BAD_INPUT_OBJECT_MEMBER,
      QERR_QMP_EXTRA_MEMBER are used in just one place now, except for one
      use that has crept into qobject-input-visitor.c.
      
      Drop these macros, to make the (bad) error messages more visible.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-10-git-send-email-armbru@redhat.com>
      99fb0c53
    • M
      qmp: Drop duplicated QMP command object checks · 104fc302
      Markus Armbruster 提交于
      qmp_check_input_obj() duplicates qmp_dispatch_check_obj(), except the
      latter screws up an error message.  handle_qmp_command() runs first
      the former, then the latter via qmp_dispatch(), masking the screwup.
      
      qemu-ga also masks the screwup, because it also duplicates checks,
      just differently.
      
      qmp_check_input_obj() exists because handle_qmp_command() needs to
      examine the command before dispatching it.  The previous commit got
      rid of this need, except for a tracepoint, and a bit of "id" code that
      relies on qdict not being null.
      
      Fix up the error message in qmp_dispatch_check_obj(), drop
      qmp_check_input_obj() and the tracepoint.  Protect the "id" code with
      a conditional.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-9-git-send-email-armbru@redhat.com>
      104fc302
    • M
      qmp: Clean up how we enforce capability negotiation · 635db18f
      Markus Armbruster 提交于
      To enforce capability negotiation before normal operation,
      handle_qmp_command() inspects every command before it's handed off to
      qmp_dispatch().  This is a bit of a layering violation, and results in
      duplicated code.
      
      Before capability negotiation (!cur_mon->in_command_mode), we fail
      commands other than "qmp_capabilities".  This is what enforces
      capability negotiation.
      
      Afterwards, we fail command "qmp_capabilities".
      
      Clean this up as follows.
      
      The obvious place to fail a command is the command itself, so move the
      "afterwards" check to qmp_qmp_capabilities().
      
      We do the "before" check in every other command, but that would be
      bothersome.  Instead, start with an alternate list of commands that
      contains only "qmp_capabilities".  Switch to the full list in
      qmp_qmp_capabilities().
      
      Additionally, replace the generic human-readable error message for
      CommandNotFound by one that reminds the user to run qmp_capabilities.
      Without that, we'd regress commit 2d5a8346.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1488544368-30622-8-git-send-email-armbru@redhat.com>
      [Mirco-optimization squashed in, commit message typo fixed]
      Reviewed-by: NEric Blake <eblake@redhat.com>
      635db18f
    • M
      qapi-introspect: Mangle --prefix argument properly for C · 9b0c9a63
      Markus Armbruster 提交于
      qapi-introspect.py --prefix hasn't been used so far, but fix it anyway.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1488544368-30622-7-git-send-email-armbru@redhat.com>
      [Commit message improved]
      Reviewed-by: NEric Blake <eblake@redhat.com>
      9b0c9a63
    • M
      qapi: Support multiple command registries per program · 1527badb
      Markus Armbruster 提交于
      The command registry encapsulates a single command list.  Give the
      functions using it a parameter instead.  Define suitable command lists
      in monitor, guest agent and test-qmp-commands.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1488544368-30622-6-git-send-email-armbru@redhat.com>
      [Debugging turds buried]
      Reviewed-by: NEric Blake <eblake@redhat.com>
      1527badb
    • M
      qmp: Dumb down how we run QMP command registration · 05875687
      Markus Armbruster 提交于
      The way we get QMP commands registered is high tech:
      
      * qapi-commands.py generates qmp_init_marshal() that does the actual work
      
      * it also generates the magic to register it as a MODULE_INIT_QAPI
        function, so it runs when someone calls
        module_call_init(MODULE_INIT_QAPI)
      
      * main() calls module_call_init()
      
      QEMU needs to register a few non-qapified commands.  Same high tech
      works: monitor.c has its own qmp_init_marshal() along with the magic
      to make it run in module_call_init(MODULE_INIT_QAPI).
      
      QEMU also needs to unregister commands that are not wanted in this
      build's configuration (commit 5032a16d).  Simple enough:
      qmp_unregister_commands_hack().  The difficulty is to make it run
      after the generated qmp_init_marshal().  We can't simply run it in
      monitor.c's qmp_init_marshal(), because the order in which the
      registered functions run is indeterminate.  So qmp_init_marshal()
      registers qmp_unregister_commands_hack() separately.  Since
      registering *appends* to the list of registered functions, this will
      make it run after all the functions that have been registered already.
      
      I suspect it takes a long and expensive computer science education to
      not find this silly.
      
      Dumb it down as follows:
      
      * Drop MODULE_INIT_QAPI entirely
      
      * Give the generated qmp_init_marshal() external linkage.
      
      * Call it instead of module_call_init(MODULE_INIT_QAPI)
      
      * Except in QEMU proper, call new monitor_init_qmp_commands() that in
        turn calls the generated qmp_init_marshal(), registers the
        additional commands and unregisters the unwanted ones.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-5-git-send-email-armbru@redhat.com>
      05875687
    • M
      qmp-test: New, covering basic QMP protocol · f66e7ac8
      Markus Armbruster 提交于
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-4-git-send-email-armbru@redhat.com>
      f66e7ac8
    • M
      libqtest: Work around a "QMP wants a newline" bug · 13420ef8
      Markus Armbruster 提交于
      The next commit is going to add a test that calls qmp("null").
      Curiously, this hangs.  Here's why.
      
      qmp_fd_sendv() doesn't send newlines.  Not even when @fmt contains
      some.  At first glance, the QMP parser seems to be fine with that.
      However, it turns out that it fails to react to input until it sees
      either a newline, an object or an array.  To reproduce, feed to a QMP
      monitor like this:
      
          $ echo -n 'null' | socat UNIX:/work/armbru/images/test-qmp STDIO
          {"QMP": {"version": {"qemu": {"micro": 50, "minor": 8, "major": 2}, "package": " (v2.8.0-1195-gf84141e-dirty)"}, "capabilities": []}}
      
      No output after the greeting.
      
      Add a newline:
      
          $ echo 'null' | socat UNIX:/work/armbru/images/test-qmp STDIO
          {"QMP": {"version": {"qemu": {"micro": 50, "minor": 8, "major": 2}, "package": " (v2.8.0-1195-gf84141e-dirty)"}, "capabilities": []}}
          {"error": {"class": "GenericError", "desc": "Expected 'object' in QMP input"}}
      
      Correct output for input 'null'.
      
      Add an object instead:
      
          $ echo -n 'null { "execute": "qmp_capabilities" }' | socat UNIX:qmp-socket STDIO
          {"QMP": {"version": {"qemu": {"micro": 50, "minor": 8, "major": 2}, "package": " (v2.8.0-1195-gf84141e-dirty)"}, "capabilities": []}}
          {"error": {"class": "GenericError", "desc": "Expected 'object' in QMP input"}}
          {"return": {}}
      
      Also correct output.
      
      Work around this QMP bug by having qmp_fd_sendv() append a newline.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-3-git-send-email-armbru@redhat.com>
      13420ef8
    • M
      qga: Fix crash on non-dictionary QMP argument · 74d8c9d9
      Markus Armbruster 提交于
      The value of key 'arguments' must be a JSON object.  qemu-ga neglects
      to check, and crashes.  To reproduce, send
      
          { 'execute': 'guest-sync', 'arguments': [] }
      
      to qemu-ga.
      
      do_qmp_dispatch() uses qdict_get_qdict() to get the arguments.  When
      not a JSON object, this gets a null pointer, which flows through the
      generated marshalling function to qobject_input_visitor_new(), where
      it fails the assertion.  qmp_dispatch_check_obj() needs to catch this
      error.
      
      QEMU isn't affected, because it runs qmp_check_input_obj() first,
      which basically duplicates qmp_dispatch_check_obj()'s checks, plus the
      missing one.
      
      Fix by copying the missing one from qmp_check_input_obj() to
      qmp_dispatch_check_obj().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <1488544368-30622-2-git-send-email-armbru@redhat.com>
      74d8c9d9
    • P
      Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.9-20170303' into staging · 17783ac8
      Peter Maydell 提交于
      ppc patch queuye for 2017-03-03
      
      This will probably be my last pull request before the hard freeze.  It
      has some new work, but that has all been posted in draft before the
      soft freeze, so I think it's reasonable to include in qemu-2.9.
      
      This batch has:
          * A substantial amount of POWER9 work
              * Implements the legacy (hash) MMU for POWER9
      	* Some more preliminaries for implementing the POWER9 radix
                MMU
      	* POWER9 has_work
      	* Basic POWER9 compatibility mode handling
      	* Removal of some premature tests
          * Some cleanups and fixes to the existing MMU code to make the
            POWER9 work simpler
          * A bugfix for TCG multiply adds on power
          * Allow pseries guests to access PCIe extended config space
      
      This also includes a code-motion not strictly in ppc code - moving
      getrampagesize() from ppc code to exec.c.  This will make some future
      VFIO improvements easier, Paolo said it was ok to merge via my tree.
      
      # gpg: Signature made Fri 03 Mar 2017 03:20:36 GMT
      # 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:                 aka "David Gibson (kernel.org) <dwg@kernel.org>"
      # Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392
      
      * remotes/dgibson/tags/ppc-for-2.9-20170303:
        target/ppc: rewrite f[n]m[add,sub] using float64_muladd
        spapr: Small cleanup of PPC MMU enums
        spapr_pci: Advertise access to PCIe extended config space
        target/ppc: Rework hash mmu page fault code and add defines for clarity
        target/ppc: Move no-execute and guarded page checking into new function
        target/ppc: Add execute permission checking to access authority check
        target/ppc: Add Instruction Authority Mask Register Check
        hw/ppc/spapr: Add POWER9 to pseries cpu models
        target/ppc/POWER9: Add cpu_has_work function for POWER9
        target/ppc/POWER9: Add POWER9 pa-features definition
        target/ppc/POWER9: Add POWER9 mmu fault handler
        target/ppc: Don't gen an SDR1 on POWER9 and rework register creation
        target/ppc: Add patb_entry to sPAPRMachineState
        target/ppc/POWER9: Add POWERPC_MMU_V3 bit
        powernv: Don't test POWER9 CPU yet
        exec, kvm, target-ppc: Move getrampagesize() to common code
        target/ppc: Add POWER9/ISAv3.00 to compat_table
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      17783ac8
  2. 04 3月, 2017 4 次提交
    • P
      ppc: avoid typedef redefinitions · eeb61d4f
      Paolo Bonzini 提交于
      These cause compilation failures on CentOS 6 or other operating
      systems with older GCCs.
      
      Cc: David Gibson <dgibson@redhat.com>
      Cc: qemu-ppc@nongnu.org
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1488558530-21016-3-git-send-email-pbonzini@redhat.com
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      eeb61d4f
    • P
      nios2: avoid anonymous unions in designated initializers. · 4ae4b609
      Paolo Bonzini 提交于
      These cause compilation failures on CentOS 6 or other operating
      systems with older GCCs.
      
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      4ae4b609
    • P
      hppa: avoid anonymous unions in designated initializers. · eff235eb
      Paolo Bonzini 提交于
      These cause compilation failures on CentOS 6 or other operating
      systems with older GCCs.
      
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      Message-id: 1488558530-21016-1-git-send-email-pbonzini@redhat.com
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      eff235eb
    • P
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · 5febe767
      Peter Maydell 提交于
      * kernel header update (requested by David and Vijay)
      * GuestPanicInformation fixups (Anton)
      * record/replay icount fixes (Pavel)
      * cpu-exec cleanup, unification of icount_decr with tcg_exit_req (me)
      * KVM_CAP_IMMEDIATE_EXIT support (me)
      * vmxcap update (me)
      * iscsi locking fix (me)
      * VFIO ram device fix (Yongji)
      * scsi-hd vs. default CD-ROM (Hervé)
      * SMI migration fix (Dave)
      * spice-char segfault (Li Qiang)
      * improved "info mtree -f" (me)
      
      # gpg: Signature made Fri 03 Mar 2017 15:43:04 GMT
      # 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: (21 commits)
        iscsi: fix missing unlock
        memory: show region offset and ROM/RAM type in "info mtree -f"
        x86: Work around SMI migration breakages
        spice-char: fix segfault in char_spice_finalize
        vl: disable default cdrom when using explicitely scsi-hd
        memory: Introduce DEVICE_HOST_ENDIAN for ram device
        qmp-events: fix GUEST_PANICKED description formatting
        qapi: flatten GuestPanicInformation union
        vmxcap: update for September 2016 SDM
        vmxcap: port to Python 3
        KVM: use KVM_CAP_IMMEDIATE_EXIT
        kvm: use atomic_read/atomic_set to access cpu->exit_request
        KVM: move SIG_IPI handling to kvm-all.c
        KVM: do not use sigtimedwait to catch SIGBUS
        KVM: remove kvm_arch_on_sigbus
        cpus: reorganize signal handling code
        KVM: x86: cleanup SIGBUS handlers
        cpus: remove ugly cast on sigbus_handler
        cpu-exec: remove unnecessary check of cpu->exit_request
        replay: check icount in cpu exec loop
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      5febe767
  3. 03 3月, 2017 24 次提交
    • P
      iscsi: fix missing unlock · f6eb0b31
      Paolo Bonzini 提交于
      Reported by Coverity.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f6eb0b31
    • P
      memory: show region offset and ROM/RAM type in "info mtree -f" · 377a07aa
      Paolo Bonzini 提交于
      "info mtree -f" output is currently hard to use for large RAM regions, because
      there is no hint as to what part of the region is being mapped.  Add the offset
      if it is nonzero.
      
      Secondly, FlatView has a readonly field, that can override the MemoryRegion
      in the presence of aliases.  Take it into account.
      
      Together, with this patch this:
      
      address-space (flat view): KVM-SMRAM
        0000000000000000-00000000000bffff (prio 0, ram): pc.ram
        00000000000c0000-00000000000c9fff (prio 0, ram): pc.ram
        00000000000ca000-00000000000ccfff (prio 0, ram): pc.ram
        00000000000cd000-00000000000ebfff (prio 0, ram): pc.ram
        00000000000ec000-00000000000effff (prio 0, ram): pc.ram
        00000000000f0000-00000000000fffff (prio 0, ram): pc.ram
        0000000000100000-00000000bfffffff (prio 0, ram): pc.ram
        00000000fd000000-00000000fdffffff (prio 1, ram): vga.vram
        00000000febc0000-00000000febdffff (prio 1, i/o): e1000-mmio
        00000000febf0400-00000000febf041f (prio 0, i/o): vga ioports remapped
        00000000febf0500-00000000febf0515 (prio 0, i/o): bochs dispi interface
        00000000febf0600-00000000febf0607 (prio 0, i/o): qemu extended regs
        00000000fec00000-00000000fec00fff (prio 0, i/o): kvm-ioapic
        00000000fed00000-00000000fed003ff (prio 0, i/o): hpet
        00000000fee00000-00000000feefffff (prio 4096, i/o): kvm-apic-msi
        00000000fffc0000-00000000ffffffff (prio 0, rom): pc.bios
        0000000100000000-000000013fffffff (prio 0, ram): pc.ram
      
      becomes this:
      
      address-space (flat view): KVM-SMRAM
        0000000000000000-00000000000bffff (prio 0, ram): pc.ram
        00000000000c0000-00000000000c9fff (prio 0, rom): pc.ram @00000000000c0000
        00000000000ca000-00000000000ccfff (prio 0, ram): pc.ram @00000000000ca000
        00000000000cd000-00000000000ebfff (prio 0, rom): pc.ram @00000000000cd000
        00000000000ec000-00000000000effff (prio 0, ram): pc.ram @00000000000ec000
        00000000000f0000-00000000000fffff (prio 0, rom): pc.ram @00000000000f0000
        0000000000100000-00000000bfffffff (prio 0, ram): pc.ram @0000000000100000
        00000000fd000000-00000000fdffffff (prio 1, ram): vga.vram
        00000000febc0000-00000000febdffff (prio 1, i/o): e1000-mmio
        00000000febf0400-00000000febf041f (prio 0, i/o): vga ioports remapped
        00000000febf0500-00000000febf0515 (prio 0, i/o): bochs dispi interface
        00000000febf0600-00000000febf0607 (prio 0, i/o): qemu extended regs
        00000000fec00000-00000000fec00fff (prio 0, i/o): kvm-ioapic
        00000000fed00000-00000000fed003ff (prio 0, i/o): hpet
        00000000fee00000-00000000feefffff (prio 4096, i/o): kvm-apic-msi
        00000000fffc0000-00000000ffffffff (prio 0, rom): pc.bios
        0000000100000000-000000013fffffff (prio 0, ram): pc.ram @00000000c0000000
      
      This should make it easier to understand what's going on.
      
      Cc: Peter Xu <peterx@redhat.com>
      Cc: "William Tambe" <tambewilliam@gmail.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      377a07aa
    • D
      x86: Work around SMI migration breakages · fc3a1fd7
      Dr. David Alan Gilbert 提交于
      Migration from a 2.3.0 qemu results in a reboot on the receiving QEMU
      due to a disagreement about SM (System management) interrupts.
      
      2.3.0 didn't have much SMI support, but it did set CPU_INTERRUPT_SMI
      and this gets into the migration stream, but on 2.3.0 it
      never got delivered.
      
      ~2.4.0 SMI interrupt support was added but was broken - so
      that when a 2.3.0 stream was received it cleared the CPU_INTERRUPT_SMI
      but never actually caused an interrupt.
      
      The SMI delivery was recently fixed by 68c6efe0, but the
      effect now is that an incoming 2.3.0 stream takes the interrupt it
      had flagged but it's bios can't actually handle it(I think
      partly due to the original interrupt not being taken during boot?).
      The consequence is a triple(?) fault and a reboot.
      
      Tested from:
        2.3.1 -M 2.3.0
        2.7.0 -M 2.3.0
        2.8.0 -M 2.3.0
        2.8.0 -M 2.8.0
      
      This corresponds to RH bugzilla entry 1420679.
      Signed-off-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Message-Id: <20170223133441.16010-1-dgilbert@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      fc3a1fd7
    • L
      spice-char: fix segfault in char_spice_finalize · f20e6f8c
      Li Qiang 提交于
      In 'qemu_chr_open_spice_vmc' if the 'psubtype' is NULL, it will
      call 'char_spice_finalize'. But as the SpiceChardev is not inserted
      in the 'spice_chars' list, the 'QLIST_REMOVE' will cause a segfault.
      Add a detect to avoid it.
      Signed-off-by: NLi Qiang <liqiang6-s@360.cn>
      Message-Id: <1487665107-88004-1-git-send-email-liqiang6-s@360.cn>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NLi Qiang <liq3ea@gmail.com>
      f20e6f8c
    • H
      vl: disable default cdrom when using explicitely scsi-hd · f6f99b48
      Hervé Poussineau 提交于
      In commit af6bf132 (May 2011),
      ide-hd, ide-cd and scsi-cd have been added to disable default cdrom,
      "or else you can't put one on secondary master without -nodefaults".
      
      Make it the same for scsi-hd, so you can put one on scsi-id 2 without
      using -nodefaults.
      scsi-hd has probably been forgotten, as it has been added in the
      preceding commit (b443ae67).
      
      Affected users are the ones using a machine with SCSI devices and start QEMU
      with -device scsi-hd but without -device scsi-cd or -cdrom
      In that case, the default cdrom device will disappear instead of being empty.
      Signed-off-by: NHervé Poussineau <hpoussin@reactos.org>
      Message-Id: <1487623279-29930-1-git-send-email-hpoussin@reactos.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f6f99b48
    • Y
      memory: Introduce DEVICE_HOST_ENDIAN for ram device · c99a29e7
      Yongji Xie 提交于
      At the moment ram device's memory regions are DEVICE_NATIVE_ENDIAN. It's
      incorrect. This memory region is backed by a MMIO area in host, so the
      uint64_t data that MemoryRegionOps read from/write to this area should be
      host-endian rather than target-endian. Hence, current code does not work
      when target and host endianness are different which is the most common case
      on PPC64. To fix it, this introduces DEVICE_HOST_ENDIAN for the ram device.
      
      This has been tested on PPC64 BE/LE host/guest in all possible combinations
      including TCG.
      Suggested-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NYongji Xie <xyjxie@linux.vnet.ibm.com>
      Message-Id: <1488171164-28319-1-git-send-email-xyjxie@linux.vnet.ibm.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      c99a29e7
    • A
      qmp-events: fix GUEST_PANICKED description formatting · 11953be7
      Anton Nefedov 提交于
      Signed-off-by: NAnton Nefedov <anton.nefedov@virtuozzo.com>
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: Eric Blake <eblake@redhat.com>
      Message-Id: <1487614915-18710-4-git-send-email-den@openvz.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      11953be7
    • A
      qapi: flatten GuestPanicInformation union · e8ed97a6
      Anton Nefedov 提交于
      Signed-off-by: NAnton Nefedov <anton.nefedov@virtuozzo.com>
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: Eric Blake <eblake@redhat.com>
      Message-Id: <1487614915-18710-3-git-send-email-den@openvz.org>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      e8ed97a6
    • P
      vmxcap: update for September 2016 SDM · 025533f6
      Paolo Bonzini 提交于
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      025533f6
    • P
      vmxcap: port to Python 3 · c3e31eaa
      Paolo Bonzini 提交于
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      c3e31eaa
    • P
      KVM: use KVM_CAP_IMMEDIATE_EXIT · cf0f7cf9
      Paolo Bonzini 提交于
      The purpose of the KVM_SET_SIGNAL_MASK API is to let userspace "kick"
      a VCPU out of KVM_RUN through a POSIX signal.  A signal is attached
      to a dummy signal handler; by blocking the signal outside KVM_RUN and
      unblocking it inside, this possible race is closed:
      
                VCPU thread                     service thread
         --------------------------------------------------------------
              check flag
                                                set flag
                                                raise signal
              (signal handler does nothing)
              KVM_RUN
      
      However, one issue with KVM_SET_SIGNAL_MASK is that it has to take
      tsk->sighand->siglock on every KVM_RUN.  This lock is often on a
      remote NUMA node, because it is on the node of a thread's creator.
      Taking this lock can be very expensive if there are many userspace
      exits (as is the case for SMP Windows VMs without Hyper-V reference
      time counter).
      
      KVM_CAP_IMMEDIATE_EXIT provides an alternative, where the flag is
      placed directly in kvm_run so that KVM can see it:
      
                VCPU thread                     service thread
         --------------------------------------------------------------
                                                raise signal
              signal handler
                set run->immediate_exit
              KVM_RUN
                check run->immediate_exit
      
      The previous patches changed QEMU so that the only blocked signal is
      SIG_IPI, so we can now stop using KVM_SET_SIGNAL_MASK and sigtimedwait
      if KVM_CAP_IMMEDIATE_EXIT is available.
      
      On a 14-VCPU guest, an "inl" operation goes down from 30k to 6k on
      an unlocked (no BQL) MemoryRegion, or from 30k to 15k if the BQL
      is involved.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      cf0f7cf9
    • P
      c5c6679d
    • P
      KVM: move SIG_IPI handling to kvm-all.c · 18268b60
      Paolo Bonzini 提交于
      This lets us remove a bunch of CONFIG_LINUX defines.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      18268b60
    • P
      KVM: do not use sigtimedwait to catch SIGBUS · 2ae41db2
      Paolo Bonzini 提交于
      Call kvm_on_sigbus_vcpu asynchronously from the VCPU thread.
      Information for the SIGBUS can be stored in thread-local variables
      and processed later in kvm_cpu_exec.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2ae41db2
    • P
      KVM: remove kvm_arch_on_sigbus · 4d39892c
      Paolo Bonzini 提交于
      Build it on kvm_arch_on_sigbus_vcpu instead.  They do the same
      for "action optional" SIGBUSes, and the main thread should never get
      "action required" SIGBUSes because it blocks the signal.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4d39892c
    • P
      cpus: reorganize signal handling code · a16fc07e
      Paolo Bonzini 提交于
      Move the KVM "eat signals" code under CONFIG_LINUX, in preparation
      for moving it to kvm-all.c; reraise non-MCE SIGBUS immediately,
      without passing it to KVM.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      a16fc07e
    • P
      KVM: x86: cleanup SIGBUS handlers · 20e0ff59
      Paolo Bonzini 提交于
      This patch should have no semantic change.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      20e0ff59
    • P
      cpus: remove ugly cast on sigbus_handler · d98d4072
      Paolo Bonzini 提交于
      The cast is there because sigbus_handler is invoked via sigfd_handler.
      But it feels just wrong to use struct qemu_signalfd_siginfo in the
      prototype of a function that is passed to sigaction.
      
      Instead, do a simple-minded conversion of qemu_signalfd_siginfo to
      siginfo_t.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      d98d4072
    • P
      Merge branch 'icount-update' into HEAD · 30f3dda2
      Paolo Bonzini 提交于
      Merge the original development branch due to breakage caused by the
      MTTCG merge.
      
      Conflicts:
      	cpu-exec.c
      	translate-common.c
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      30f3dda2
    • P
      Merge remote-tracking branch 'remotes/ehabkost/tags/numa-pull-request' into staging · 5b10b94b
      Peter Maydell 提交于
      NUMA documentation update
      
      # gpg: Signature made Fri 03 Mar 2017 13:11:25 GMT
      # gpg:                using RSA key 0x2807936F984DC5A6
      # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>"
      # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF  D1AA 2807 936F 984D C5A6
      
      * remotes/ehabkost/tags/numa-pull-request:
        qemu-options: Rewrite -numa documentation
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      5b10b94b
    • P
      Merge remote-tracking branch 'remotes/dgibson/tags/submodule-update-20170303' into staging · 9a17d327
      Peter Maydell 提交于
      submodule updates (SLOF & dtc) 2017-03-03
      
      This set of patches updates the SLOF and dtc submodules for qemu-2.9.
      
      The SLOF update could have gone in my ppc pull request earlier today,
      but I forgot it.  It should be safe to apply in either order with that
      set though.
      
      The dtc (and libfdt) update brings us up to dtc 1.4.3 which includes
      some things that will be useful in future.
      
      # gpg: Signature made Fri 03 Mar 2017 06:29:31 GMT
      # 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:                 aka "David Gibson (kernel.org) <dwg@kernel.org>"
      # Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392
      
      * remotes/dgibson/tags/submodule-update-20170303:
        Update dtc submodule to v1.4.3
        pseries: Update SLOF firmware image
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      9a17d327
    • E
      qemu-options: Rewrite -numa documentation · 4b9a5dd7
      Eduardo Habkost 提交于
      Rewrite the -numa documentation to clarify what exactly it does.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170123180632.28942-3-ehabkost@redhat.com>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      4b9a5dd7
    • P
      Merge remote-tracking branch 'remotes/berrange/tags/pull-qio-2017-02-27-2' into staging · 1ec2dca6
      Peter Maydell 提交于
      Merge qio 2017/02/27 v2
      
      # gpg: Signature made Thu 02 Mar 2017 16:09:27 GMT
      # gpg:                using RSA key 0xBE86EBB415104FDF
      # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>"
      # gpg:                 aka "Daniel P. Berrange <berrange@redhat.com>"
      # Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF
      
      * remotes/berrange/tags/pull-qio-2017-02-27-2:
        io: fully parse & validate HTTP headers for websocket protocol handshake
        tests: fix leaks in test-io-channel-command
        io: fix decoding when multiple websockets frames arrive at once
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      1ec2dca6
    • P
      dtc: Revert unintentional submodule downgrade from commit 077dd742 · 508e038a
      Peter Maydell 提交于
      Commit 077dd742 inadvertently downgraded the 'dtc' submodule,
      undoing the increment added in commit 6e85fce0. Revert this,
      returning the submodule state to where we should be.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      508e038a