Skip to content
Snippets Groups Projects
  1. Feb 21, 2017
    • Markus Armbruster's avatar
      hw: Drop superfluous special checks for orphaned -drive · 8f2d75e8
      Markus Armbruster authored
      
      We've traditionally rejected orphans here and there, but not
      systematically.  For instance, the sun4m machines have an onboard SCSI
      HBA (bus=0), and have always rejected bus>0.  Other machines with an
      onboard SCSI HBA don't.
      
      Commit a66c9dc7 made all orphans trigger a warning, and the previous
      commit turned this into an error.  The checks "here and there" are now
      redundant.  Drop them.
      
      Note that the one in mips_jazz.c was wrong: it rejected bus > MAX_FD,
      but MAX_FD is the number of floppy drives per bus.
      
      Error messages change from
      
          $ qemu-system-x86_64 -drive if=ide,bus=2
          qemu-system-x86_64: Too many IDE buses defined (3 > 2)
          $ qemu-system-mips64 -M magnum,accel=qtest -drive if=floppy,bus=2,id=fd1
          qemu: too many floppy drives
          $ qemu-system-sparc -M LX -drive if=scsi,bus=1
          qemu: too many SCSI bus
      
      to
      
          $ qemu-system-x86_64 -drive if=ide,bus=2
          qemu-system-x86_64: -drive if=ide,bus=2: machine type does not support if=ide,bus=2,unit=0
          $ qemu-system-mips64 -M magnum,accel=qtest -drive if=floppy,bus=2,id=fd1
          qemu-system-mips64: -drive if=floppy,bus=2,id=fd1: machine type does not support if=floppy,bus=2,unit=0
          $ qemu-system-sparc -M LX -drive if=scsi,bus=1
          qemu-system-sparc: -drive if=scsi,bus=1: machine type does not support if=scsi,bus=1,unit=0
      
      Cc: John Snow <jsnow@redhat.com>
      Cc: "Hervé Poussineau" <hpoussin@reactos.org>
      Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1487153147-11530-9-git-send-email-armbru@redhat.com>
      Reviewed-by: default avatarJohn Snow <jsnow@redhat.com>
      8f2d75e8
    • Markus Armbruster's avatar
      blockdev: Make orphaned -drive fatal · 720b8dc0
      Markus Armbruster authored
      
      Block backends defined with "-drive if=T" with T other than "none" are
      meant to be picked up by machine initialization code: a suitable
      frontend gets created and wired up automatically.
      
      If machine initialization code doesn't comply, the block backend
      remains unused.  This triggers a warning since commit a66c9dc7, v2.2.0.
      Drives created by default are exempted; use -nodefaults to get rid of
      them.
      
      Turn this warning into an error.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1487153147-11530-8-git-send-email-armbru@redhat.com>
      Reviewed-by: default avatarJohn Snow <jsnow@redhat.com>
      720b8dc0
    • Markus Armbruster's avatar
      blockdev: Improve message for orphaned -drive · 664cc623
      Markus Armbruster authored
      
      We warn when a -drive isn't supported by the machine type (commit
      a66c9dc7):
      
          $ qemu-system-x86_64 -S -display none -drive if=mtd
          Warning: Orphaned drive without device: id=mtd0,file=,if=mtd,bus=0,unit=0
      
      Improve this to point to the offending bit of configuration:
      
          qemu-system-x86_64: -drive if=mtd: warning: machine type does not support if=mtd,bus=0,unit=0
      
      Especially nice when it's hidden behind -readconfig foo.cfg:
      
          qemu-system-x86_64:foo.cfg:140: warning: machine type does not support if=mtd,bus=0,unit=0
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1487153147-11530-7-git-send-email-armbru@redhat.com>
      Reviewed-by: default avatarJohn Snow <jsnow@redhat.com>
      664cc623
    • Markus Armbruster's avatar
      hw/arm/highbank: Default -drive to if=ide instead of if=scsi · 2a7ae4ee
      Markus Armbruster authored
      
      These machines have no onboard SCSI HBA, and no way to plug one.
      -drive if=scsi therefore cannot work.  They do have an onboard IDE
      controller (sysbus-ahci), but fail to honor if=ide.
      
      Change their default to if=ide, and add a TODO comment on what needs
      to be done to actually honor -drive if=ide.
      
      Cc: Rob Herring <robh@kernel.org>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: qemu-arm@nongnu.org
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Message-Id: <1487153147-11530-6-git-send-email-armbru@redhat.com>
      2a7ae4ee
    • Markus Armbruster's avatar
      hw: Default -drive to if=none instead of scsi when scsi cannot work · 7e465513
      Markus Armbruster authored
      
      Block backends defined with -drive if=scsi are meant to be picked up
      by machine initialization code: a suitable frontend gets created and
      wired up automatically.
      
      if=scsi drives not picked up that way can still be used with -device
      as if they had if=none, but that's unclean and best avoided.  Unused
      ones produce an "Orphaned drive without device" warning.
      
      A few machine types default to if=scsi, even though they don't
      actually have a SCSI HBA.  This makes no sense.  Change their default
      to if=none.  Affected machines:
      
      * aarch64/arm: realview-pbx-a9 vexpress-a9 vexpress-a15 xilinx-zynq-a9
      
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
      Cc: Alistair Francis <alistair.francis@xilinx.com>
      Cc: qemu-arm@nongnu.org
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Reviewed-by: default avatarAlistair Francis <alistair.francis@xilinx.com>
      Message-Id: <1487153147-11530-5-git-send-email-armbru@redhat.com>
      7e465513
    • Markus Armbruster's avatar
      hw: Default -drive to if=none instead of ide when ide cannot work · a27fa28f
      Markus Armbruster authored
      
      Block backends defined with -drive if=ide are meant to be picked up by
      machine initialization code: a suitable frontend gets created and
      wired up automatically.
      
      if=ide drives not picked up that way can still be used with -device as
      if they had if=none, but that's unclean and best avoided.  Unused ones
      produce an "Orphaned drive without device" warning.
      
      -drive parameter "if" is optional, and the default depends on the
      machine type.  If a machine type doesn't specify a default, the
      default is "ide".
      
      Many machine types implicitly default to if=ide that way, even though
      they don't actually have an IDE controller.  This makes no sense.
      
      Change the implicit default to if=none.  Affected machines:
      
      * all targets: none
      * aarch64/arm: akita ast2500 canon cheetah collie connex imx25
        integratorcp kzm lm3s6965evb lm3s811evb mainstone musicpal n800 n810
        netduino2 nuri palmetto realview romulus sabrelite smdkc210 sx1 sx1
        verdex z2
      * cris: axis-dev88
      * i386/x86_64: xenpv
      * lm32: lm32-evr lm32-uclinux milkymist
      * m68k: an5206 dummy mcf5208evb
      * microblaze/microblazeel: petalogix-ml605 petalogix-s3adsp1800
      * mips/mips64/mips64el/mipsel: mipssim
      * moxie: moxiesim
      * or32: or32-sim
      * ppc/ppc64/ppcemb: bamboo ref405ep taihu virtex-ml507
      * ppc/ppc64: mpc8544ds ppce500
      * sh4/sh4eb: shix
      * sparc: leon3_generic
      * sparc64: niagara
      * tricore: tricore_testboard
      * unicore32: puv3
      * xtensa/xtensaeb: kc705 lx200 lx60 ml605 sim
      
      None of these machines have an IDE controller, let alone code to
      honor if=ide.
      
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: qemu-arm@nongnu.org
      Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
      Cc: Stefano Stabellini <sstabellini@kernel.org>
      Cc: Anthony Perard <anthony.perard@citrix.com>
      Cc: xen-devel@lists.xensource.com
      Cc: Michael Walle <michael@walle.cc>
      Cc: Laurent Vivier <laurent@vivier.eu>
      Cc: Anthony Green <green@moxielogic.com>
      Cc: Jia Liu <proljc@gmail.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: qemu-ppc@nongnu.org
      Cc: Magnus Damm <magnus.damm@gmail.com>
      Cc: Fabien Chouteau <chouteau@adacore.com>
      Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Cc: Artyom Tarasenko <atar4qemu@gmail.com>
      Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Acked-By: default avatarArtyom Tarasenko <atar4qemu@gmail.com>
      Reviewed-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Message-Id: <1487153147-11530-4-git-send-email-armbru@redhat.com>
      a27fa28f
    • Markus Armbruster's avatar
      hw/arm/cubieboard hw/arm/xlnx-ep108: Fix units_per_default_bus · e0319b03
      Markus Armbruster authored
      
      Machine types cubieboard, xlnx-ep108, xlnx-zcu102 have an onboard AHCI
      controller, but neglect to set their MachineClass member
      units_per_default_bus = 1.  This permits -drive if=ide,unit=1, which
      makes no sense for AHCI.  It also screws up index=N for odd N, because
      it gets desugared to unit=1,bus=N/2
      
      Doesn't really matter, because these machine types fail to honor
      -drive if=ide.  Add the missing units_per_default_bus = 1 anyway,
      along with a TODO comment on what needs to be done for -drive if=ide.
      
      Also set block_default_type = IF_IDE explicitly.  It's currently the
      default, but the next commit will change it to something more
      sensible, and we want to keep the IF_IDE default for these three
      machines.  See also the previous commit.
      
      Cc: Beniamino Galvani <b.galvani@gmail.com>
      Cc: Alistair Francis <alistair.francis@xilinx.com>
      Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: qemu-arm@nongnu.org
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Acked-by: default avatarAlistair Francis <alistair.francis@xilinx.com>
      Message-Id: <1487153147-11530-3-git-send-email-armbru@redhat.com>
      e0319b03
    • Markus Armbruster's avatar
      hw: Default -drive to if=ide explicitly where it works · 2059839b
      Markus Armbruster authored
      
      Block backends defined with -drive if=ide are meant to be picked up by
      machine initialization code: a suitable frontend gets created and
      wired up automatically.
      
      if=ide drives not picked up that way can still be used with -device as
      if they had if=none, but that's unclean and best avoided.  Unused ones
      produce an "Orphaned drive without device" warning.
      
      -drive parameter "if" is optional, and the default depends on the
      machine type.  If a machine type doesn't specify a default, the
      default is "ide".
      
      Many machine types default to if=ide, even though they don't actually
      have an IDE controller.  A future patch will change these defaults to
      something more sensible.  To prepare for it, this patch makes default
      "ide" explicit for the machines that actually pick up if=ide drives:
      
      * alpha: clipper
      * arm/aarch64: spitz borzoi terrier tosa
      * i386/x86_64: generic-pc-machine (with concrete subtypes pc-q35-*
        pc-i440fx-* pc-* isapc xenfv)
      * mips64el: fulong2e
      * mips/mipsel/mips64el: malta mips
      * ppc/ppc64: mac99 g3beige prep
      * sh4/sh4eb: r2d
      * sparc64: sun4u sun4v
      
      Note that ppc64 machine powernv already sets an "ide" default
      explicitly.  Its IDE controller isn't implemented, yet.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Message-Id: <1487153147-11530-2-git-send-email-armbru@redhat.com>
      2059839b
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20170221-1' into staging · b8562561
      Peter Maydell authored
      
      xhci: add qemu-xhci device, some followup cleanups.
      ccid: better sanity checking.
      ehci: fix memory leak
      ohci: bugfixes.
      
      # gpg: Signature made Tue 21 Feb 2017 07:14:35 GMT
      # gpg:                using RSA key 0x4CB6D8EED3E87138
      # 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/pull-usb-20170221-1:
        usb-ccid: add check message size checks
        usb-ccid: move header size check
        usb-ccid: better bulk_out error handling
        xhci: drop via vendor command handling
        xhci: fix nec vendor quirk handling
        xhci: add qemu xhci controller
        xhci: drop ER_FULL_HACK workaround
        xhci: apply limits to loops
        usb: ohci: limit the number of link eds
        usb: ohci: fix error return code in servicing iso td
        usb: ehci: fix memory leak in ehci
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      b8562561
    • Gerd Hoffmann's avatar
      usb-ccid: add check message size checks · 31fb4444
      Gerd Hoffmann authored
      
      Check message size too when figuring whenever we should expect more data.
      Fix debug message to show useful data, p->iov.size is fixed anyway if we
      land there, print how much we got meanwhile instead.
      
      Also check announced message size against actual message size.  That
      is a more general fix for CVE-2017-5898 than commit "c7dfbf32 usb: ccid:
      check ccid apdu length".
      
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-id: 1487250819-23764-4-git-send-email-kraxel@redhat.com
      31fb4444
    • Gerd Hoffmann's avatar
      usb-ccid: move header size check · 7569c546
      Gerd Hoffmann authored
      
      Move up header size check, so we can use header fields in sanity checks
      (in followup patches).  Also reword the debug message.
      
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-id: 1487250819-23764-3-git-send-email-kraxel@redhat.com
      7569c546
    • Gerd Hoffmann's avatar
      usb-ccid: better bulk_out error handling · 0aeebc73
      Gerd Hoffmann authored
      
      Add err goto label where we can jump to from all error conditions.
      STALL request on all errors.  Reset position on all errors.
      
      Normal request processing is not in a else branch any more, so this code
      is reintended, there are no code changes in that part of the code
      though.
      
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-id: 1487250819-23764-2-git-send-email-kraxel@redhat.com
      0aeebc73
    • Gerd Hoffmann's avatar
      xhci: drop via vendor command handling · 558ff1b6
      Gerd Hoffmann authored
      
      Seems pretty pointless, we don't emulate an via xhci controller.
      
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1486382139-30630-5-git-send-email-kraxel@redhat.com
      558ff1b6
    • Gerd Hoffmann's avatar
      xhci: fix nec vendor quirk handling · 2992d6b4
      Gerd Hoffmann authored
      
      Only the TYPE_NEC_XHCI controller will have the nec vendor quirks.
      
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1486382139-30630-4-git-send-email-kraxel@redhat.com
      2992d6b4
    • Gerd Hoffmann's avatar
      xhci: add qemu xhci controller · 72a810f4
      Gerd Hoffmann authored
      
      Turn existing TYPE_XHCI into an abstract base class.
      Create two child classes, TYPE_NEC_XHCI (same name as old xhci
      controller) and TYPE_QEMU_XHCI (using an ID from our namespace).
      
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Reviewed-by: default avatarMarcel Apfelbaum <marcel@redhat.com>
      Message-id: 1486382139-30630-3-git-send-email-kraxel@redhat.com
      72a810f4
    • Gerd Hoffmann's avatar
      xhci: drop ER_FULL_HACK workaround · 898248a3
      Gerd Hoffmann authored
      
      The nec/renesas driver problems have finally been debugged and root
      caused, see commit "7da76e12 xhci: fix event queue IRQ handling".
      
      It's pretty clear now that
       (a) The whole "driver can't handle ring full" story is most likely
           wrong.
       (b) The ER_FULL_HACK workaround based on the false assumtion doesn't
           much.  It avoids the driver crashing (without commit 7da76e12), but
           it doesn't make usb work.
       (c) With 7da76e12 applied it doesn't trigger any more.
      
      So, lets kill it.  Or, to be exact, lets almost kill it.  Some data
      fields are kept unused in the state struct, for live migration backward
      compatibility.
      
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1486382139-30630-2-git-send-email-kraxel@redhat.com
      898248a3
    • Gerd Hoffmann's avatar
      xhci: apply limits to loops · f89b60f6
      Gerd Hoffmann authored
      
      Limits should be big enough that normal guest should not hit it.
      Add a tracepoint to log them, just in case.  Also, while being
      at it, log the existing link trb limit too.
      
      Reported-by: default avatar李强 <liqiang6-s@360.cn>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Message-id: 1486383669-6421-1-git-send-email-kraxel@redhat.com
      f89b60f6
    • Li Qiang's avatar
      usb: ohci: limit the number of link eds · 95ed5693
      Li Qiang authored
      
      The guest may builds an infinite loop with link eds. This patch
      limit the number of linked ed to avoid this.
      
      Signed-off-by: default avatarLi Qiang <liqiang6-s@360.cn>
      Message-id: 5899a02e.45ca240a.6c373.93c1@mx.google.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      95ed5693
    • Li Qiang's avatar
      usb: ohci: fix error return code in servicing iso td · 26f670a2
      Li Qiang authored
      
      It should return 1 if an error occurs when reading iso td.
      This will avoid an infinite loop issue in ohci_service_ed_list.
      
      Signed-off-by: default avatarLi Qiang <liqiang6-s@360.cn>
      Message-id: 5899ac3e.1033240a.944d5.9a2d@mx.google.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      26f670a2
    • Li Qiang's avatar
      usb: ehci: fix memory leak in ehci · d710e1e7
      Li Qiang authored
      
      In usb_ehci_init function, it initializes 's->ipacket', but there
      is no corresponding function to free this. As the ehci can be hotplug
      and unplug, this will leak host memory leak. In order to make the
      hierarchy clean, we should add a ehci pci finalize function, then call
      the clean function in ehci device.
      
      Signed-off-by: default avatarLi Qiang <liqiang6-s@360.cn>
      Message-id: 589a85b8.3c2b9d0a.b8e6.1434@mx.google.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      d710e1e7
  2. Feb 20, 2017
  3. Feb 18, 2017
  4. Feb 17, 2017
Loading