1. 19 1月, 2016 1 次提交
  2. 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
  3. 13 11月, 2015 1 次提交
    • G
      hw/misc: Add support for ADC controller in Xilinx Zynq 7000 · 74fcbd22
      Guenter Roeck 提交于
      Add support for the Xilinx XADC core used in Zynq 7000.
      
      References:
      - Zynq-7000 All Programmable SoC Technical Reference Manual
      - 7 Series FPGAs and Zynq-7000 All Programmable SoC XADC
        Dual 12-Bit 1 MSPS Analog-to-Digital Converter
      
      Tested with Linux using QEMU machine xilinx-zynq-a9 with devicetree
      files zynq-zc702.dtb and zynq-zc706.dtb, and kernel configuration
      multi_v7_defconfig.
      Reviewed-by: NAlistair Francis <alistair.francis@xilinx.com>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      [ PC changes:
        * Changed macro names to match TRM where possible
        * Made programmers model macro scheme consistent
        * Dropped XADC_ZYNQ_ prefix on local macros
        * Fix ALM field width
        * Update threshold-comparison interrupts in _update_ints()
        * factored out DFIFO pushes into helper. Renamed to "push/pop"
        * Changed xadc_reg to 10 bits and added OOB check.
        * Reduced scope of MCTL reset to just stop channel coms.
        * Added dummy read data to write commands
        * Changed _ to - seperators in string names and filenames
        * Dropped ------------ in header comment
        * Catchall'ed _update_ints() in _write handler.
        * Minor whitespace changes.
        * Use ZYNQ_XADC_FIFO_DEPTH instead of ARRAY_SIZE()
      ]
      Signed-off-by: NPeter Crosthwaite <crosthwaite.peter@gmail.com>
      Tested-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      74fcbd22
  4. 03 11月, 2015 1 次提交
  5. 19 9月, 2015 1 次提交
  6. 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
  7. 09 4月, 2015 1 次提交
  8. 18 2月, 2015 1 次提交
  9. 23 12月, 2014 1 次提交
  10. 20 10月, 2014 2 次提交
  11. 09 9月, 2014 1 次提交
  12. 28 5月, 2014 2 次提交
  13. 31 1月, 2014 1 次提交
  14. 09 1月, 2014 1 次提交
  15. 08 1月, 2014 1 次提交
  16. 18 12月, 2013 2 次提交
  17. 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
  18. 20 8月, 2013 1 次提交
  19. 10 7月, 2013 1 次提交
  20. 04 7月, 2013 1 次提交
  21. 04 6月, 2013 1 次提交
  22. 15 4月, 2013 1 次提交
  23. 09 4月, 2013 1 次提交
    • P
      hw: move headers to include/ · 0d09e41a
      Paolo Bonzini 提交于
      Many of these should be cleaned up with proper qdev-/QOM-ification.
      Right now there are many catch-all headers in include/hw/ARCH depending
      on cpu.h, and this makes it necessary to compile these files per-target.
      However, fixing this does not belong in these patches.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      0d09e41a
  24. 05 4月, 2013 1 次提交
  25. 16 3月, 2013 1 次提交
  26. 01 3月, 2013 4 次提交
  27. 09 2月, 2013 1 次提交
  28. 22 1月, 2013 1 次提交
  29. 16 1月, 2013 1 次提交
  30. 19 12月, 2012 3 次提交
  31. 11 12月, 2012 2 次提交
    • W
      xilinx_zynq: Add one variable to avoid overwriting QSPI bus · 79f5d67e
      walimis 提交于
      commit 7b482bcf xilinx_zynq: added QSPI controller
      
      Adds one QSPI controller, which has two spi buses, one is for
      spi0, and another is for spi1. But when initializing the spi1
      bus, "dev" has been overwrited by the ssi_create_slave_no_init() function,
      so that qdev_get_child_bus() returns NULL and the last two m25p80 flashes
      won't be attached to the spi1 bus, but to main-system-bus.
      
      Here we add one variable to avoid overwriting.
      Signed-off-by: NLiming Wang <walimisdev@gmail.com>
      Reviewed-by: NPeter Crosthwaite <peter.crosthwaite@xilinx.com>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      79f5d67e
    • C
      Support default block interfaces per QEMUMachine · 2d0d2837
      Christian Borntraeger 提交于
      There are QEMUMachines that have neither IF_IDE nor IF_SCSI as a
      default/standard interface to their block devices / drives. Therefore,
      this patch introduces a new field default_block_type per QEMUMachine
      struct. The prior use_scsi field becomes thereby obsolete and is
      replaced through .default_block_type = IF_SCSI.
      
      This patch also changes the default for s390x to IF_VIRTIO and
      removes an early hack that converts IF_IDE drives.
      Other parties have already claimed interest (e.g. IF_SD for exynos)
      
      To create a sane default, for machines that dont specify a
      default_block_type, this patch makes IF_IDE = 0 and IF_NONE = 1.
      I checked all users of IF_NONE (blockdev.c and ww/device-hotplug.c)
      as well as IF_IDE and it seems that it is ok to change the defines -
      in other words, I found no obvious (to me) assumption in the code
      regarding IF_NONE==0. IF_NONE is only set if there is an
      explicit if=none. Without if=* the interface becomes IF_DEFAULT.
      
      I would suggest to have some additional care, e.g. by letting
      this patch sit some days in the block tree.
      
      Based on an initial patch from Einar Lueck <elelueck@de.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      CC: Igor Mitsyanko <i.mitsyanko@samsung.com>
      CC: Markus Armbruster <armbru@redhat.com>
      CC: Kevin Wolf <kwolf@redhat.com>
      Reviewed-by: NAlexander Graf <agraf@suse.de>
      Acked-by: NIgor Mitsyanko <i.mitsyanko@samsung.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      2d0d2837