1. 07 7月, 2018 4 次提交
    • G
      i386: fix '-cpu ?' output for host cpu type · 02693cc4
      Greg Kurz 提交于
      Since commit d6dcc558, '-cpu ?' shows the description of the
      X86_CPU_TYPE_NAME("max") for the host CPU model:
      
      Enables all features supported by the accelerator in the current host
      
      instead of the expected:
      
      KVM processor with all supported host features
      
      or
      
      HVF processor with all supported host features
      
      This is caused by the early use of kvm_enabled() and hvf_enabled() in
      a class_init function. Since the accelerator isn't configured yet, both
      helpers return false unconditionally.
      
      A QEMU binary will only be compiled with one of these accelerators, not
      both. The appropriate description can thus be decided at build time.
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Message-Id: <153055056654.212317.4697363278304826913.stgit@bahia.lan>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      02693cc4
    • J
      qtest: Use cpu address space instead of system memory · 70da3048
      Julia Suvorova 提交于
      Some devices (like nvic in armv7m) are not accessable through
      address_space_memory, therefore can not be tested with qtest.
      Signed-off-by: NJulia Suvorova <jusual@mail.ru>
      Message-Id: <20180702065237.27899-1-jusual@mail.ru>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      70da3048
    • M
      pr-helper: Rework socket path handling · 2729d79d
      Michal Privoznik 提交于
      When reviewing Paolo's pr-helper patches I've noticed couple of
      problems:
      
      1) socket_path needs to be calculated at two different places
      (one for printing out help, the other if socket activation is NOT
      used),
      
      2) even though the default socket_path is allocated in
      compute_default_paths() it is the only default path the function
      handles. For instance, pidfile is allocated outside of this
      function. And yet again, at different places than 1)
      Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
      Message-Id: <c791ba035f26ea957e8f3602e3009b621769b1ba.1530611283.git.mprivozn@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2729d79d
    • P
      pr-helper: avoid error on PR IN command with zero request size · ee8c13b8
      Paolo Bonzini 提交于
      After reading a PR IN command with zero request size in prh_read_request,
      the resp->result field will be uninitialized and the resp.sz field will
      be also uninitialized when returning to prh_co_entry.
      
      If resp->result == GOOD (from a previous successful reply or just luck),
      then the assert in prh_write_response might not be triggered and
      uninitialized response will be sent.
      
      The fix is to remove the whole handling of sz == 0 in prh_co_entry.
      Those errors apply only to PR OUT commands and it's perfectly okay to
      catch them later in do_pr_out and multipath_pr_out; the check for
      too-short parameters in fact doesn't apply in the easy SG_IO case, as
      it can be left to the target firmware even.
      
      The result is that prh_read_request does not fail requests anymore and
      prh_co_entry becomes simpler.
      Reported-by: NDima Stepanov <dimastep@yandex-team.ru>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ee8c13b8
  2. 04 7月, 2018 4 次提交
    • P
      Merge remote-tracking branch 'remotes/berrange/tags/qcrypto-next-pull-request' into staging · 2a018f6e
      Peter Maydell 提交于
      Add support for PSK credentials with TLS
      
      # gpg: Signature made Tue 03 Jul 2018 13:04:51 BST
      # gpg:                using RSA key BE86EBB415104FDF
      # 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/qcrypto-next-pull-request:
        crypto: Implement TLS Pre-Shared Keys (PSK).
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      2a018f6e
    • P
      Merge remote-tracking branch 'remotes/kraxel/tags/vga-20180703-pull-request' into staging · 79c2b203
      Peter Maydell 提交于
      vga: disable global_vmstate, virtio-gpu scanout tracking fixes.
      
      # gpg: Signature made Tue 03 Jul 2018 10:44:56 BST
      # gpg:                using RSA key 4CB6D8EED3E87138
      # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
      # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
      # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
      # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
      
      * remotes/kraxel/tags/vga-20180703-pull-request:
        vga: disable global_vmstate for 3.0+ machine types
        virtio-gpu: disable scanout when backing resource is destroyed
        virtio-gpu: update old resource too.
        virtio-gpu: tweak scanout disable.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      
      # Conflicts:
      #	hw/display/qxl.c
      #	hw/display/vga-isa-mm.c
      79c2b203
    • P
      Merge remote-tracking branch 'remotes/kraxel/tags/ui-20180703-pull-request' into staging · 5be2a500
      Peter Maydell 提交于
      ui: drop libdrm dependency.
      
      # gpg: Signature made Tue 03 Jul 2018 10:18:36 BST
      # gpg:                using RSA key 4CB6D8EED3E87138
      # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
      # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
      # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
      # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
      
      * remotes/kraxel/tags/ui-20180703-pull-request:
        ui: do not build-depend or link with libdrm, it is not needed
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      5be2a500
    • P
      Merge remote-tracking branch 'remotes/kraxel/tags/usb-20180703-pull-request' into staging · ba2dfe6f
      Peter Maydell 提交于
      usb: bugfixes for ehci and xhci.
      
      # gpg: Signature made Tue 03 Jul 2018 09:26:20 BST
      # gpg:                using RSA key 4CB6D8EED3E87138
      # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
      # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
      # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
      # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
      
      * remotes/kraxel/tags/usb-20180703-pull-request:
        xhci: fix guest-triggerable assert
        ehci: Don't fetch a NULL current qtd but advance the queue instead.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      ba2dfe6f
  3. 03 7月, 2018 32 次提交
    • P
      Merge remote-tracking branch 'remotes/shorne/tags/pull-or-20180703' into staging · f988c7e1
      Peter Maydell 提交于
      OpenRISC cleanups and Fixes for QEMU 3.0
      
      Mostly patches from Richard Henderson fixing multiple things:
       * Fix singlestepping in GDB.
       * Use more TB linking.
       * Fixes to exit TB after updating SPRs to enable registering of state
         changes.
       * Significant optimizations and refactors to the TLB
       * Split out disassembly from translation.
       * Add qemu-or1k to qemu-binfmt-conf.sh.
       * Implement signal handling for linux-user.
      
      Then there are a few fixups from me:
       * Fix delay slot detections to match hardware, this was masking a bug
         in the linus kernel.
       * Fix stores to the PIC mask register
      
      # gpg: Signature made Tue 03 Jul 2018 14:44:10 BST
      # gpg:                using RSA key C3B31C2D5E6627E4
      # gpg: Good signature from "Stafford Horne <shorne@gmail.com>"
      # gpg: WARNING: This key is not certified with a trusted signature!
      # gpg:          There is no indication that the signature belongs to the owner.
      # Primary key fingerprint: D9C4 7354 AEF8 6C10 3A25  EFF1 C3B3 1C2D 5E66 27E4
      
      * remotes/shorne/tags/pull-or-20180703: (25 commits)
        target/openrisc: Fix writes to interrupt mask register
        target/openrisc: Fix delay slot exception flag to match spec
        linux-user: Fix struct sigaltstack for openrisc
        linux-user: Implement signals for openrisc
        target/openrisc: Add support in scripts/qemu-binfmt-conf.sh
        target/openrisc: Reorg tlb lookup
        target/openrisc: Increase the TLB size
        target/openrisc: Stub out handle_mmu_fault for softmmu
        target/openrisc: Use identical sizes for ITLB and DTLB
        target/openrisc: Fix cpu_mmu_index
        target/openrisc: Fix tlb flushing in mtspr
        target/openrisc: Reduce tlb to a single dimension
        target/openrisc: Merge mmu_helper.c into mmu.c
        target/openrisc: Remove indirect function calls for mmu
        target/openrisc: Merge tlb allocation into CPUOpenRISCState
        target/openrisc: Form the spr index from tcg
        target/openrisc: Exit the TB after l.mtspr
        target/openrisc: Split out is_user
        target/openrisc: Link more translation blocks
        target/openrisc: Fix singlestep_enabled
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      f988c7e1
    • P
      Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-3.0-20180703' into staging · b07cd3e7
      Peter Maydell 提交于
      ppc patch queue 2018-07-03
      
      Here's a last minue pull request before today's soft freeze.  Ideally
      I would have sent this earlier, but I was waiting for a couple of
      extra fixes I knew were close.  And the freeze crept up on me, like
      always.
      
      Most of the changes here are bugfixes in any case.  There are some
      cleanups as well, which have been in my staging tree for a little
      while.  There are a couple of truly new features (some extensions to
      the sam460ex platform), but these are low risk, since they only affect
      a new and not really stabilized machine type anyway.
      
      Higlights are:
        * Mac platform improvements from Mark Cave-Ayland
        * Sam460ex improvements from BALATON Zoltan et al.
        * XICS interrupt handler cleanups from Cédric Le Goater
        * TCG improvements for atomic loads and stores from Richard
          Henderson
        * Assorted other bugfixes
      
      # gpg: Signature made Tue 03 Jul 2018 06:55:22 BST
      # gpg:                using RSA key 6C38CACA20D9B392
      # 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-3.0-20180703: (35 commits)
        ppc: Include vga cirrus card into the compiling process
        target/ppc: Relax reserved bitmask of indexed store instructions
        target/ppc: set is_jmp on ppc_tr_breakpoint_check
        spapr: compute default value of "hpt-max-page-size" later
        target/ppc/kvm: don't pass cpu to kvm_get_smmu_info()
        target/ppc/kvm: get rid of kvm_get_fallback_smmu_info()
        ppc440_uc: Basic emulation of PPC440 DMA controller
        sam460ex: Add RTC device
        hw/timer: Add basic M41T80 emulation
        ppc4xx_i2c: Rewrite to model hardware more closely
        hw/ppc: Give sam46ex its own config option
        fpu_helper.c: fix setting FPSCR[FI] bit
        target/ppc: Implement the rest of gen_st_atomic
        target/ppc: Implement the rest of gen_ld_atomic
        target/ppc: Use atomic min/max helpers
        target/ppc: Use MO_ALIGN for EXIWX and ECOWX
        target/ppc: Split out gen_st_atomic
        target/ppc: Split out gen_ld_atomic
        target/ppc: Split out gen_load_locked
        target/ppc: Tidy gen_conditional_store
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      
      # Conflicts:
      #	hw/ppc/spapr.c
      b07cd3e7
    • S
      target/openrisc: Fix writes to interrupt mask register · dfc84745
      Stafford Horne 提交于
      The interrupt controller mask register (PICMR) allows writing any value
      to any of the 32 interrupt mask bits.  Writing a 0 masks the interrupt
      writing a 1 unmasks (enables) the the interrupt.
      
      For some reason the old code was or'ing the write values to the PICMR
      meaning it was not possible to ever mask a interrupt once it was
      enabled.
      
      I have tested this by running linux 4.18 and my regular checks, I don't
      see any issues.
      Reported-by: NDavidson Francis <davidsondfgl@gmail.com>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: NStafford Horne <shorne@gmail.com>
      dfc84745
    • S
      target/openrisc: Fix delay slot exception flag to match spec · 9f6e8afa
      Stafford Horne 提交于
      The delay slot exception flag is only set on the SR register during
      exception.  Previously it was being set on both the ESR and SR this
      caused QEMU to differ from the spec.  The was apparent as the linux
      kernel had a bug where it could boot on QEMU but not on real hardware.
      
      The fixed logic now matches hardware.
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: NStafford Horne <shorne@gmail.com>
      9f6e8afa
    • R
    • R
      linux-user: Implement signals for openrisc · e8f29049
      Richard Henderson 提交于
      All of the existing code was boilerplate from elsewhere,
      and would crash the guest upon the first signal.
      Signed-off-by: NRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: NStafford Horne <shorne@gmail.com>
      
      ---
      v2:
        Add a comment to the new definition of target_pt_regs.
        Install the signal mask into the ucontext.
      v3:
        Incorporate feedback from Laurent.
      e8f29049
    • R
    • R
      target/openrisc: Reorg tlb lookup · f0655423
      Richard Henderson 提交于
      While openrisc has a split i/d tlb, qemu does not.  Perform a
      lookup on both i & d tlbs in parallel and put the composite
      rights into qemu's tlb.  This avoids ping-ponging the qemu tlb
      between EXEC and READ.
      Signed-off-by: NRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: NStafford Horne <shorne@gmail.com>
      f0655423
    • R
      crypto: Implement TLS Pre-Shared Keys (PSK). · e1a6dc91
      Richard W.M. Jones 提交于
      Pre-Shared Keys (PSK) is a simpler mechanism for enabling TLS
      connections than using certificates.  It requires only a simple secret
      key:
      
        $ mkdir -m 0700 /tmp/keys
        $ psktool -u rjones -p /tmp/keys/keys.psk
        $ cat /tmp/keys/keys.psk
        rjones:d543770c15ad93d76443fb56f501a31969235f47e999720ae8d2336f6a13fcbc
      
      The key can be secretly shared between clients and servers.  Clients
      must specify the directory containing the "keys.psk" file and a
      username (defaults to "qemu").  Servers must specify only the
      directory.
      
      Example NBD client:
      
        $ qemu-img info \
          --object tls-creds-psk,id=tls0,dir=/tmp/keys,username=rjones,endpoint=client \
          --image-opts \
          file.driver=nbd,file.host=localhost,file.port=10809,file.tls-creds=tls0,file.export=/
      
      Example NBD server using qemu-nbd:
      
        $ qemu-nbd -t -x / \
          --object tls-creds-psk,id=tls0,endpoint=server,dir=/tmp/keys \
          --tls-creds tls0 \
          image.qcow2
      
      Example NBD server using nbdkit:
      
        $ nbdkit -n -e / -fv \
          --tls=on --tls-psk=/tmp/keys/keys.psk \
          file file=disk.img
      Signed-off-by: NRichard W.M. Jones <rjones@redhat.com>
      Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
      e1a6dc91
    • P
      Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging · a395717c
      Peter Maydell 提交于
      # gpg: Signature made Tue 03 Jul 2018 04:42:11 BST
      # gpg:                using RSA key BDBE7B27C0DE3057
      # gpg: Good signature from "Jeffrey Cody <jcody@redhat.com>"
      # gpg:                 aka "Jeffrey Cody <jeff@codyprime.org>"
      # gpg:                 aka "Jeffrey Cody <codyprime@gmail.com>"
      # Primary key fingerprint: 9957 4B4D 3474 90E7 9D98  D624 BDBE 7B27 C0DE 3057
      
      * remotes/cody/tags/block-pull-request:
        backup: Use copy offloading
        block: Honour BDRV_REQ_NO_SERIALISING in copy range
        block: Fix parameter checking in bdrv_co_copy_range_internal
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      a395717c
    • P
      Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2018-07-02' into staging · 9b75dcb1
      Peter Maydell 提交于
      nbd patches for 2018-07-02
      
      Bug fixes and iotest exposure of fleecing via NBD (serving a
      read-only point-in-time view via blockdev-backup sync:none,
      as well as serving dirty bitmaps over NBD), including a new
      x-dirty-bitmap parameter when opening NBD clients as the
      counterpart to x-nbd-server-add-bitmap. Also a random fix
      for iscsi block_status spotted by Coverity that missed other
      miscellaneous trees.
      
      - Eric Blake: nbd/server: Fix dirty bitmap logic regression
      - Eric Blake: iscsi: Avoid potential for get_status overflow
      - John Snow/Vladimir Sementsov-Ogievskiy: 0/2 block: formalize and test fleecing
      - Eric Blake: 0/2 test NBD bitmap export
      
      # gpg: Signature made Tue 03 Jul 2018 02:33:03 BST
      # gpg:                using RSA key A7A16B4A2527436A
      # gpg: Good signature from "Eric Blake <eblake@redhat.com>"
      # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>"
      # gpg:                 aka "[jpeg image of size 6874]"
      # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
      
      * remotes/ericb/tags/pull-nbd-2018-07-02:
        iotests: New test 223 for exporting dirty bitmap over NBD
        nbd/client: Add x-dirty-bitmap to query bitmap from server
        iotests: add 222 to test basic fleecing
        blockdev: enable non-root nodes for backup source
        iscsi: Avoid potential for get_status overflow
        nbd/server: Fix dirty bitmap logic regression
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      9b75dcb1
    • G
      vga: disable global_vmstate for 3.0+ machine types · 1fcfdc43
      Gerd Hoffmann 提交于
      Move global_vmstate from vga_common_init() parameter to VGACommonState
      field.  Set global_vmstate to true for isa vga devices, so nothing
      changes here.  virtio-vga and secondary-vga already set global_vmstate
      to false so no change here either.  All other pci vga devices get a new
      global-vmstate property, defaulting to false.  A compat property flips
      it to true for older machine types.
      
      With this in place you don't get a vmstate section naming conflict any
      more when adding multiple pci vga devices to your vm.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-Id: <20180702163345.17892-1-kraxel@redhat.com>
      1fcfdc43
    • G
      virtio-gpu: disable scanout when backing resource is destroyed · 1fccd7c5
      Gerd Hoffmann 提交于
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-id: 20180702162443.16796-4-kraxel@redhat.com
      1fccd7c5
    • G
      virtio-gpu: update old resource too. · c806cfa0
      Gerd Hoffmann 提交于
      When switching scanout from one resource to another we must update the
      scanout_bitmask field for both new (set bit) and old (clear bit)
      resource.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-id: 20180702162443.16796-3-kraxel@redhat.com
      c806cfa0
    • G
      virtio-gpu: tweak scanout disable. · da566a18
      Gerd Hoffmann 提交于
      - Factor out the code to virtio_gpu_disable_scanout().
      - Allow disable scanout 0, show a message then.
      - Clear scanout->resource_id.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-id: 20180702162443.16796-2-kraxel@redhat.com
      da566a18
    • P
      Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging · 46d0885a
      Peter Maydell 提交于
      pc, virtio: fixes
      
      A couple of fixes to amd iommu, and a fix to virtio iommu.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      
      # gpg: Signature made Thu 28 Jun 2018 02:46:45 BST
      # gpg:                using RSA key 281F0DB8D28D5469
      # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
      # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"
      # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
      #      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469
      
      * remotes/mst/tags/for_upstream:
        virtio-rng: process pending requests on DRIVER_OK
        hw/i386: Fix AMDVI GATS and HATS encodings
        hw/i386: Fix IVHD entry length for AMD IOMMU
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      46d0885a
    • M
      ui: do not build-depend or link with libdrm, it is not needed · 4939a1df
      Michael Tokarev 提交于
      Opengl support brings up libdrm. But actually nothing uses this library
      or includes any of its headers. Just remove checking for it from configure.
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-id: 20180630165448.30795-1-mjt@msgid.tls.msk.ru
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      4939a1df
    • G
      xhci: fix guest-triggerable assert · 8f36ec70
      Gerd Hoffmann 提交于
      Set xhci into error state instead of throwing a core dump.
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      Message-id: 20180702162752.29233-1-kraxel@redhat.com
      8f36ec70
    • S
      ehci: Don't fetch a NULL current qtd but advance the queue instead. · 8bb01b25
      Sebastian Bauer 提交于
      Fetching qtd with the NULL address most likely makes no sense so from now
      on, we handle it this case similarly as if the terminate (T) bit is not
      set, which is already an exception as according to section 3.6 of the EHCI
      spec there is no T bit defined for the current_qtd field.
      
      The spec is a bit vague on how an EHCI driver should initialize these
      fields: "The general operational model is that the host controller can
      detect whether the overlay area contains a description of an active
      transfer" (p. 49). QEMU primarily uses the QTD_TOKEN_ACTIVE bit of the
      queue header to infer the activity state but there are other ways
      conceivable.
      
      This change allows QEMU to boot further into AmigaOS. The public available
      version of the EHCI driver recycles queue heads in some rare conditions but
      only clears the current_qtd field but not the status field. This works with
      many available EHCI PCI cards but e.g., not with the Freescale USB
      controller's found on the P5040. On the emulated EHCI controller of QEMU
      the consequence is that some garbage was read in, which resulted in a
      reset of the controller. This change fixes the problem.
      Signed-off-by: NSebastian Bauer <mail@sebastianbauer.info>
      Tested-by: NBALATON Zoltan <balaton@eik.bme.hu>
      Message-id: 20180625222718.4488-1-mail@sebastianbauer.info
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      8bb01b25
    • F
      backup: Use copy offloading · 9ded4a01
      Fam Zheng 提交于
      The implementation is similar to the 'qemu-img convert'. In the
      beginning of the job, offloaded copy is attempted. If it fails, further
      I/O will go through the existing bounce buffer code path.
      
      Then, as Kevin pointed out, both this and qemu-img convert can benefit
      from a local check if one request fails because of, for example, the
      offset is beyond EOF, but another may well be accepted by the protocol
      layer. This will be implemented separately.
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Message-id: 20180703023758.14422-4-famz@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      9ded4a01
    • F
      block: Honour BDRV_REQ_NO_SERIALISING in copy range · dee12de8
      Fam Zheng 提交于
      This semantics is needed by drive-backup so implement it before using
      this API there.
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Message-id: 20180703023758.14422-3-famz@redhat.com
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      dee12de8
    • F
      block: Fix parameter checking in bdrv_co_copy_range_internal · d4d3e5a0
      Fam Zheng 提交于
      src may be NULL if BDRV_REQ_ZERO_WRITE flag is set, in this case only
      check dst and dst->bs. This bug was introduced when moving in the
      request tracking code from bdrv_co_copy_range, in 37aec7d7.
      
      This especially fixes the possible segfault when initializing src_bs
      with a NULL src.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Message-id: 20180703023758.14422-2-famz@redhat.com
      Reviewed-by: NJeff Cody <jcody@redhat.com>
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      d4d3e5a0
    • S
      ppc: Include vga cirrus card into the compiling process · 29f9cef3
      Sebastian Bauer 提交于
      Drivers for this card exists on PPC-based AmigaOS guests so it is useful to
      allow users to emulate the graphics card for PPC machines.
      
      As cirrus vga is currently preferred over std(vga) in absence of any user
      choice, this change also sets the default display of spapr machines to
      std as otherwise qemu refuses to start these machines. Not specifying an
      explicit graphics mode is for instance done by 'make check'.
      Signed-off-by: NSebastian Bauer <mail@sebastianbauer.info>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      29f9cef3
    • B
      target/ppc: Relax reserved bitmask of indexed store instructions · 0123d3cb
      BALATON Zoltan 提交于
      The PPC440 User Manual says that if bit 31 is set, the contents of
      CR[CR0] are undefined for indexed store instructions but this form is
      not invalid. Other PPC variants confirming to recent ISA where this
      bit may be reserved should ignore reserved bits and not raise invalid
      instruction exception. In particular, MorphOS has an stwx instruction
      with bit 31 set and fails to boot currently because of this. With this
      patch it gets further.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      0123d3cb
    • E
      target/ppc: set is_jmp on ppc_tr_breakpoint_check · 2a8ceefc
      Emilio G. Cota 提交于
      The use of GDB breakpoints was broken by b0c2d521 ("target/ppc: convert
      to TranslatorOps", 2018-02-16).
      
      Fix it by setting is_jmp, so that we break from the translation loop
      as originally intended.
      Tested-by: NMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Reported-by: NMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Signed-off-by: NEmilio G. Cota <cota@braap.org>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      2a8ceefc
    • E
      iotests: New test 223 for exporting dirty bitmap over NBD · a1532a22
      Eric Blake 提交于
      Although this test is NOT a full test of image fleecing (as it
      intentionally uses just a single block device directly exported
      over NBD, rather than trying to set up a blockdev-backup job with
      multiple BDS involved), it DOES prove that qemu as a server is
      able to properly expose a dirty bitmap over NBD.
      
      When coupled with image fleecing, it is then possible for a
      third-party client to do an incremental backup by using
      qemu-img map with the x-dirty-bitmap option to learn which parts
      of the file are dirty (perhaps confusingly, they are the portions
      mapped as "data":false - which is part of the reason this is
      still in the x- experimental namespace), along with another
      normal client (perhaps 'qemu-nbd -c' to expose the server over
      /dev/nbd0 and then just use normal I/O on that block device) to
      read the dirty sections.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20180702191458.28741-3-eblake@redhat.com>
      Tested-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NJohn Snow <jsnow@redhat.com>
      a1532a22
    • G
      spapr: compute default value of "hpt-max-page-size" later · e8937295
      Greg Kurz 提交于
      It is currently not possible to run a pseries-2.12 or older machine
      with HV KVM. QEMU prints the following and exits right away.
      
      qemu-system-ppc64: KVM doesn't support for base page shift 34
      
      The "hpt-max-page-size" capability was recently added to spapr to hide
      host configuration details from HPT mode guests. Its default value for
      newer machine types is 64k.
      
      For backwards compatibility, pseries-2.12 and older machine types need
      a different value. This is handled as usual in a class init function.
      The default value is 16G, ie, all page sizes supported by POWER7 and
      newer CPUs, but HV KVM requires guest pages to be hpa contiguous as
      well as gpa contiguous. The default value is the page size used to
      back the guest RAM in this case.
      
      Unfortunately kvmppc_hpt_needs_host_contiguous_pages()->kvm_enabled() is
      called way before KVM init and returns false, even if the user requested
      KVM. We thus end up selecting 16G, which isn't supported by HV KVM. The
      default value must be set during machine init, because we can safely
      assume that KVM is initialized at this point.
      
      We fix this by moving the logic to default_caps_with_cpu(). Since the
      user cannot pass cap-hpt-max-page-size=0, we set the default to 0 in
      the pseries-2.12 class init function and use that as a flag to do the
      real work.
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      e8937295
    • G
      target/ppc/kvm: don't pass cpu to kvm_get_smmu_info() · ab256960
      Greg Kurz 提交于
      In a future patch the machine code will need to retrieve the MMU
      information from KVM during machine initialization before the CPUs
      are created.
      
      Actually, KVM_PPC_GET_SMMU_INFO is a VM class ioctl, and thus, we
      don't need to have a CPU object around. We just need for KVM to
      be initialized and use the kvm_state global. This patch just does
      that.
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      ab256960
    • G
      target/ppc/kvm: get rid of kvm_get_fallback_smmu_info() · 71d0f1ea
      Greg Kurz 提交于
      Now that we're checking our MMU configuration is supported by KVM,
      rather than adjusting it to KVM, it doesn't really make sense to
      have a fallback for kvm_get_smmu_info(). If KVM is too old or buggy
      to provide the details, we should rather treat this as an error.
      
      This patch thus adds error reporting to kvm_get_smmu_info() and get
      rid of the fallback code. QEMU will now terminate if KVM fails to
      provide MMU details. This may break some very old setups, but the
      simplification is worth the sacrifice.
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      71d0f1ea
    • B
      ppc440_uc: Basic emulation of PPC440 DMA controller · 3c409c19
      BALATON Zoltan 提交于
      PPC440 SoCs such as the AMCC 460EX have a DMA controller which is used
      by AmigaOS on the sam460ex. Implement the parts used by AmigaOS so it
      can get further booting on the sam460ex machine.
      Signed-off-by: NBALATON Zoltan <balaton@eik.bme.hu>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      3c409c19
    • B
      sam460ex: Add RTC device · d2179f70
      BALATON Zoltan 提交于
      The Sam460ex has an M41T80 serial RTC chip on I2C bus 0 at address 0x68.
      Signed-off-by: NBALATON Zoltan <balaton@eik.bme.hu>
      Reviewed-by: NCédric Le Goater <clg@kaod.org>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      d2179f70
    • B
      hw/timer: Add basic M41T80 emulation · c6f2594c
      BALATON Zoltan 提交于
      Basic emulation of the M41T80 serial (I2C) RTC chip. Only getting time
      of day is implemented. Setting time and RTC alarm are not supported.
      Signed-off-by: NBALATON Zoltan <balaton@eik.bme.hu>
      Reviewed-by: NCédric Le Goater <clg@kaod.org>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      c6f2594c