1. 30 4月, 2019 1 次提交
  2. 25 9月, 2018 1 次提交
  3. 20 8月, 2018 1 次提交
    • P
      hw/dma/pl080: Don't use CPU address space for DMA accesses · 112a829f
      Peter Maydell 提交于
      Currently our PL080/PL081 model uses a combination of the CPU's
      address space (via cpu_physical_memory_{read,write}()) and the
      system address space for performing DMA accesses.
      
      For the PL081s in the MPS FPGA images, their DMA accesses
      must go via Master Security Controllers. Switch the
      PL080/PL081 model to take a MemoryRegion property which
      defines its downstream for making DMA accesses.
      
      Since the PL08x are only used in two board models, we
      make provision of the 'downstream' link mandatory and convert
      both users at once, rather than having it be optional with
      a default to the system address space.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      112a829f
  4. 26 4月, 2018 1 次提交
  5. 12 3月, 2018 1 次提交
  6. 19 9月, 2017 1 次提交
    • I
      arm: drop intermediate cpu_model -> cpu type parsing and use cpu type directly · ba1ba5cc
      Igor Mammedov 提交于
      there are 2 use cases to deal with:
        1: fixed CPU models per board/soc
        2: boards with user configurable cpu_model and fallback to
           default cpu_model if user hasn't specified one explicitly
      
      For the 1st
        drop intermediate cpu_model parsing and use const cpu type
        directly, which replaces:
           typename = object_class_get_name(
                 cpu_class_by_name(TYPE_ARM_CPU, cpu_model))
           object_new(typename)
        with
           object_new(FOO_CPU_TYPE_NAME)
        or
           cpu_generic_init(BASE_CPU_TYPE, "my cpu model")
        with
           cpu_create(FOO_CPU_TYPE_NAME)
      
      as result 1st use case doesn't have to invoke not necessary
      translation and not needed code is removed.
      
      For the 2nd
       1: set default cpu type with MachineClass::default_cpu_type and
       2: use generic cpu_model parsing that done before machine_init()
          is run and:
          2.1: drop custom cpu_model parsing where pattern is:
             typename = object_class_get_name(
                 cpu_class_by_name(TYPE_ARM_CPU, cpu_model))
             [parse_features(typename, cpu_model, &err) ]
      
          2.2: or replace cpu_generic_init() which does what
               2.1 does + create_cpu(typename) with just
               create_cpu(machine->cpu_type)
      as result cpu_name -> cpu_type translation is done using
      generic machine code one including parsing optional features
      if supported/present (removes a bunch of duplicated cpu_model
      parsing code) and default cpu type is defined in an uniform way
      within machine_class_init callbacks instead of adhoc places
      in boadr's machine_init code.
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <1505318697-77161-6-git-send-email-imammedo@redhat.com>
      Reviewed-by: NAlistair Francis <alistair.francis@xilinx.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      ba1ba5cc
  7. 07 9月, 2017 1 次提交
  8. 04 9月, 2017 1 次提交
  9. 15 7月, 2017 2 次提交
  10. 21 2月, 2017 2 次提交
    • M
      hw: Deprecate -drive if=scsi with non-onboard HBAs · a64aa578
      Markus Armbruster 提交于
      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.
      
      Drives defined with if=scsi are also picked up by SCSI HBAs added with
      -device, unlike other interface types.  Deprecate this usage, as follows.
      
      Create the frontends for onboard HBAs in machine initialization code,
      exactly like we do for if=ide and other interface types.  Change
      scsi_legacy_handle_cmdline() to create a frontend only when it's still
      missing, and warn that this usage is deprecated.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1487161136-9018-3-git-send-email-armbru@redhat.com>
      a64aa578
    • M
      hw: Default -drive to if=none instead of scsi when scsi cannot work · 7e465513
      Markus Armbruster 提交于
      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: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Reviewed-by: NAlistair Francis <alistair.francis@xilinx.com>
      Message-Id: <1487153147-11530-5-git-send-email-armbru@redhat.com>
      7e465513
  11. 13 6月, 2016 1 次提交
  12. 06 6月, 2016 1 次提交
  13. 23 3月, 2016 2 次提交
    • P
      hw: explicitly include qemu-common.h and cpu.h · 4771d756
      Paolo Bonzini 提交于
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      4771d756
    • M
      include/qemu/osdep.h: Don't include qapi/error.h · da34e65c
      Markus Armbruster 提交于
      Commit 57cb38b3 included qapi/error.h into qemu/osdep.h to get the
      Error typedef.  Since then, we've moved to include qemu/osdep.h
      everywhere.  Its file comment explains: "To avoid getting into
      possible circular include dependencies, this file should not include
      any other QEMU headers, with the exceptions of config-host.h,
      compiler.h, os-posix.h and os-win32.h, all of which are doing a
      similar job to this file and are under similar constraints."
      qapi/error.h doesn't do a similar job, and it doesn't adhere to
      similar constraints: it includes qapi-types.h.  That's in excess of
      100KiB of crap most .c files don't actually need.
      
      Add the typedef to qemu/typedefs.h, and include that instead of
      qapi/error.h.  Include qapi/error.h in .c files that need it and don't
      get it now.  Include qapi-types.h in qom/object.h for uint16List.
      
      Update scripts/clean-includes accordingly.  Update it further to match
      reality: replace config.h by config-target.h, add sysemu/os-posix.h,
      sysemu/os-win32.h.  Update the list of includes in the qemu/osdep.h
      comment quoted above similarly.
      
      This reduces the number of objects depending on qapi/error.h from "all
      of them" to less than a third.  Unfortunately, the number depending on
      qapi-types.h shrinks only a little.  More work is needed for that one.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      [Fix compilation without the spice devel packages. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      da34e65c
  14. 17 3月, 2016 1 次提交
    • E
      machine: Use type_init() to register machine classes · 0e6aac87
      Eduardo Habkost 提交于
      Change all machine_init() users that simply call type_register*()
      to use type_init().
      
      Cc: Evgeny Voevodin <e.voevodin@samsung.com>
      Cc: Maksim Kozlov <m.kozlov@samsung.com>
      Cc: Igor Mitsyanko <i.mitsyanko@gmail.com>
      Cc: Dmitry Solodkiy <d.solodkiy@samsung.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Andrzej Zaborowski <balrogg@gmail.com>
      Cc: Michael Walle <michael@walle.cc>
      Cc: "Hervé Poussineau" <hpoussin@reactos.org>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Leon Alrae <leon.alrae@imgtec.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: Blue Swirl <blauwirbel@gmail.com>
      Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Acked-by: NMarcel Apfelbaum <marcel@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Acked-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      0e6aac87
  15. 19 1月, 2016 1 次提交
  16. 13 1月, 2016 1 次提交
    • M
      Use error_fatal to simplify obvious fatal errors · 007b0657
      Markus Armbruster 提交于
      Done with this Coccinelle semantic patch:
      
          @@
          type T;
          identifier FUN, RET;
          expression list ARGS;
          expression ERR, EC;
          @@
          (
          -    T RET = FUN(ARGS, &ERR);
          +    T RET = FUN(ARGS, &error_fatal);
          |
          -    RET = FUN(ARGS, &ERR);
          +    RET = FUN(ARGS, &error_fatal);
          |
          -    FUN(ARGS, &ERR);
          +    FUN(ARGS, &error_fatal);
          )
          -    if (ERR != NULL) {
          -        error_report_err(ERR);
          -        exit(EC);
          -    }
      
      This is actually a more elegant version of my initial semantic patch
      by courtesy of Eduardo.
      
      It leaves dead Error * variables behind, cleaned up manually.
      
      Cc: qemu-arm@nongnu.org
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      007b0657
  17. 19 9月, 2015 2 次提交
  18. 18 9月, 2015 1 次提交
    • M
      Fix bad error handling after memory_region_init_ram() · f8ed85ac
      Markus Armbruster 提交于
      Symptom:
      
          $ qemu-system-x86_64 -m 10000000
          Unexpected error in ram_block_add() at /work/armbru/qemu/exec.c:1456:
          upstream-qemu: cannot set up guest memory 'pc.ram': Cannot allocate memory
          Aborted (core dumped)
      
      Root cause: commit ef701d7b screwed up handling of out-of-memory
      conditions.  Before the commit, we report the error and exit(1), in
      one place, ram_block_add().  The commit lifts the error handling up
      the call chain some, to three places.  Fine.  Except it uses
      &error_abort in these places, changing the behavior from exit(1) to
      abort(), and thus undoing the work of commit 39228250 "exec: Don't
      abort when we can't allocate guest memory".
      
      The three places are:
      
      * memory_region_init_ram()
      
        Commit 49946538 (right after commit ef701d7b) lifted the error
        handling further, through memory_region_init_ram(), multiplying the
        incorrect use of &error_abort.  Later on, imitation of existing
        (bad) code may have created more.
      
      * memory_region_init_ram_ptr()
      
        The &error_abort is still there.
      
      * memory_region_init_rom_device()
      
        Doesn't need fixing, because commit 33e0eb52 (soon after commit
        ef701d7b) lifted the error handling further, and in the process
        changed it from &error_abort to passing it up the call chain.
        Correct, because the callers are realize() methods.
      
      Fix the error handling after memory_region_init_ram() with a
      Coccinelle semantic patch:
      
          @r@
          expression mr, owner, name, size, err;
          position p;
          @@
                  memory_region_init_ram(mr, owner, name, size,
          (
          -                              &error_abort
          +                              &error_fatal
          |
                                         err@p
          )
                                        );
          @script:python@
              p << r.p;
          @@
          print "%s:%s:%s" % (p[0].file, p[0].line, p[0].column)
      
      When the last argument is &error_abort, it gets replaced by
      &error_fatal.  This is the fix.
      
      If the last argument is anything else, its position is reported.  This
      lets us check the fix is complete.  Four positions get reported:
      
      * ram_backend_memory_alloc()
      
        Error is passed up the call chain, ultimately through
        user_creatable_complete().  As far as I can tell, it's callers all
        handle the error sanely.
      
      * fsl_imx25_realize(), fsl_imx31_realize(), dp8393x_realize()
      
        DeviceClass.realize() methods, errors handled sanely further up the
        call chain.
      
      We're good.  Test case again behaves:
      
          $ qemu-system-x86_64 -m 10000000
          qemu-system-x86_64: cannot set up guest memory 'pc.ram': Cannot allocate memory
          [Exit 1 ]
      
      The next commits will repair the rest of commit ef701d7b's damage.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <1441983105-26376-3-git-send-email-armbru@redhat.com>
      Reviewed-by: NPeter Crosthwaite <crosthwaite.peter@gmail.com>
      f8ed85ac
  19. 18 2月, 2015 1 次提交
  20. 09 1月, 2015 1 次提交
  21. 07 1月, 2015 1 次提交
  22. 23 12月, 2014 1 次提交
  23. 11 12月, 2014 1 次提交
    • N
      hw/arm/realview.c: Fix memory leak in realview_init() · b1ab03af
      Nikita Belov 提交于
      Variable 'ram_lo' is allocated unconditionally, but used only in some cases.
      When it is unused pointer will be lost at function exit, resulting in a
      memory leak. Allocate memory for 'ram_lo' only if it is needed.
      
      Valgrind output:
      ==16879== 240 bytes in 1 blocks are definitely lost in loss record 6,033 of 7,018
      ==16879==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
      ==16879==    by 0x33D2CE: malloc_and_trace (vl.c:2804)
      ==16879==    by 0x509E610: g_malloc (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4000.0)
      ==16879==    by 0x288836: realview_init (realview.c:55)
      ==16879==    by 0x28988C: realview_pb_a8_init (realview.c:375)
      ==16879==    by 0x341426: main (vl.c:4413)
      Signed-off-by: NNikita Belov <zodiac@ispras.ru>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      b1ab03af
  24. 20 10月, 2014 1 次提交
    • M
      hw: Convert from BlockDriverState to BlockBackend, mostly · 4be74634
      Markus Armbruster 提交于
      Device models should access their block backends only through the
      block-backend.h API.  Convert them, and drop direct includes of
      inappropriate headers.
      
      Just four uses of BlockDriverState are left:
      
      * The Xen paravirtual block device backend (xen_disk.c) opens images
        itself when set up via xenbus, bypassing blockdev.c.  I figure it
        should go through qmp_blockdev_add() instead.
      
      * Device model "usb-storage" prompts for keys.  No other device model
        does, and this one probably shouldn't do it, either.
      
      * ide_issue_trim_cb() uses bdrv_aio_discard() instead of
        blk_aio_discard() because it fishes its backend out of a BlockAIOCB,
        which has only the BlockDriverState.
      
      * PC87312State has an unused BlockDriverState[] member.
      
      The next two commits take care of the latter two.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      4be74634
  25. 09 9月, 2014 1 次提交
  26. 28 5月, 2014 1 次提交
  27. 18 3月, 2014 1 次提交
    • P
      realview-pbx-a9: Set reset-cbar property for CPUs · b5a3ca3e
      Peter Maydell 提交于
      If the CPU is a Cortex-A9 then we should set its reset-cbar property
      so that the guest can read the correct PERIPHBASE/CBAR register value;
      newer versions of the Linux kernel (as of commit bc41b8724 in 3.12)
      will otherwise assume the CPU is a buggy single core A9 SoC. The
      realview-pbx-a9 is the only one of the cluster of boards in realview.c
      which works with the Cortex-A9 (ie which gets an a9mpcore_priv device);
      make sure it also has reset-cbar set correctly.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com>
      Message-id: 1394462692-8871-3-git-send-email-peter.maydell@linaro.org
      b5a3ca3e
  28. 14 2月, 2014 1 次提交
  29. 28 8月, 2013 1 次提交
    • M
      hw: Clean up bogus default boot order · c1654732
      Markus Armbruster 提交于
      We set default boot order "cad" in every single machine definition
      except "pseries" and "moxiesim", even though very few boards actually
      care for boot order, and "cad" makes sense for even fewer.
      
      Machines that care:
      
      * pc and its variants
      
        Accept up to three letters 'a', 'b' (undocumented alias for 'a'),
        'c', 'd' and 'n'.  Reject all others (fatal with -boot).
      
      * nseries (n800, n810)
      
        Check whether order starts with 'n'.  Silently ignored otherwise.
      
      * prep, g3beige, mac99
      
        Extract the first character the machine understands (subset of
        'a'..'f').  Silently ignored otherwise.
      
      * spapr
      
        Accept an arbitrary string (vl.c restricts it to contain only
        'a'..'p', no duplicates).
      
      * sun4[mdc]
      
        Use the first character.  Silently ignored otherwise.
      
      Strip characters these machines ignore from their default boot order.
      
      For all other machines, remove the unused default boot order
      alltogether.
      
      Note that my rename of QEMUMachine member boot_order to
      default_boot_order and QEMUMachineInitArgs member boot_device to
      boot_order has a welcome side effect: it makes every use of boot
      orders visible in this patch, for easy review.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      c1654732
  30. 20 8月, 2013 1 次提交
  31. 10 7月, 2013 1 次提交
  32. 08 7月, 2013 1 次提交
    • D
      pci: Add root bus parameter to pci_nic_init() · 29b358f9
      David Gibson 提交于
      At present, pci_nic_init() and pci_nic_init_nofail() assume that they will
      only create a NIC under the primary PCI root.  As we add support for
      multiple PCI roots, that may no longer be the case.  This patch adds a root
      bus parameter to pci_nic_init() (and updates callers accordingly) to allow
      the machine init code using it to specify the right PCI root for NICs
      created by old-style -net nic parameters.  NICs created new-style, with
      -device can of course be put anywhere.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      29b358f9
  33. 04 7月, 2013 1 次提交
  34. 19 4月, 2013 3 次提交