Skip to content
Snippets Groups Projects
  1. Jul 02, 2021
  2. May 26, 2021
  3. May 02, 2021
  4. Mar 07, 2021
  5. Feb 05, 2021
  6. Dec 10, 2020
  7. Oct 17, 2020
  8. Sep 09, 2020
  9. Jul 10, 2020
    • Markus Armbruster's avatar
      qom: Put name parameter before value / visitor parameter · 5325cc34
      Markus Armbruster authored
      
      The object_property_set_FOO() setters take property name and value in
      an unusual order:
      
          void object_property_set_FOO(Object *obj, FOO_TYPE value,
                                       const char *name, Error **errp)
      
      Having to pass value before name feels grating.  Swap them.
      
      Same for object_property_set(), object_property_get(), and
      object_property_parse().
      
      Convert callers with this Coccinelle script:
      
          @@
          identifier fun = {
              object_property_get, object_property_parse, object_property_set_str,
              object_property_set_link, object_property_set_bool,
              object_property_set_int, object_property_set_uint, object_property_set,
              object_property_set_qobject
          };
          expression obj, v, name, errp;
          @@
          -    fun(obj, v, name, errp)
          +    fun(obj, name, v, errp)
      
      Chokes on hw/arm/musicpal.c's lcd_refresh() with the unhelpful error
      message "no position information".  Convert that one manually.
      
      Fails to convert hw/arm/armsse.c, because Coccinelle gets confused by
      ARMSSE being used both as typedef and function-like macro there.
      Convert manually.
      
      Fails to convert hw/rx/rx-gdbsim.c, because Coccinelle gets confused
      by RXCPU being used both as typedef and function-like macro there.
      Convert manually.  The other files using RXCPU that way don't need
      conversion.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Message-Id: <20200707160613.848843-27-armbru@redhat.com>
      [Straightforwad conflict with commit 2336172d "audio: set default
      value for pcspk.iobase property" resolved]
      5325cc34
  10. Jul 06, 2020
  11. Jun 15, 2020
    • Markus Armbruster's avatar
      sysbus: Convert to sysbus_realize() etc. with Coccinelle · 3c6ef471
      Markus Armbruster authored
      
      Convert from qdev_realize(), qdev_realize_and_unref() with null @bus
      argument to sysbus_realize(), sysbus_realize_and_unref().
      
      Coccinelle script:
      
          @@
          expression dev, errp;
          @@
          -    qdev_realize(DEVICE(dev), NULL, errp);
          +    sysbus_realize(SYS_BUS_DEVICE(dev), errp);
      
          @@
          expression sysbus_dev, dev, errp;
          @@
          +    sysbus_dev = SYS_BUS_DEVICE(dev);
          -    qdev_realize_and_unref(dev, NULL, errp);
          +    sysbus_realize_and_unref(sysbus_dev, errp);
          -    sysbus_dev = SYS_BUS_DEVICE(dev);
      
          @@
          expression sysbus_dev, dev, errp;
          expression expr;
          @@
               sysbus_dev = SYS_BUS_DEVICE(dev);
               ... when != dev = expr;
          -    qdev_realize_and_unref(dev, NULL, errp);
          +    sysbus_realize_and_unref(sysbus_dev, errp);
      
          @@
          expression dev, errp;
          @@
          -    qdev_realize_and_unref(DEVICE(dev), NULL, errp);
          +    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), errp);
      
          @@
          expression dev, errp;
          @@
          -    qdev_realize_and_unref(dev, NULL, errp);
          +    sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), errp);
      
      Whitespace changes minimized manually.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Acked-by: default avatarAlistair Francis <alistair.francis@wdc.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200610053247.1583243-46-armbru@redhat.com>
      [Conflicts in hw/misc/empty_slot.c and hw/sparc/leon3.c resolved]
      3c6ef471
    • Markus Armbruster's avatar
      qdev: Convert uses of qdev_create() with Coccinelle · 3e80f690
      Markus Armbruster authored
      
      This is the transformation explained in the commit before previous.
      Takes care of just one pattern that needs conversion.  More to come in
      this series.
      
      Coccinelle script:
      
          @ depends on !(file in "hw/arm/highbank.c")@
          expression bus, type_name, dev, expr;
          @@
          -    dev = qdev_create(bus, type_name);
          +    dev = qdev_new(type_name);
               ... when != dev = expr
          -    qdev_init_nofail(dev);
          +    qdev_realize_and_unref(dev, bus, &error_fatal);
      
          @@
          expression bus, type_name, dev, expr;
          identifier DOWN;
          @@
          -    dev = DOWN(qdev_create(bus, type_name));
          +    dev = DOWN(qdev_new(type_name));
               ... when != dev = expr
          -    qdev_init_nofail(DEVICE(dev));
          +    qdev_realize_and_unref(DEVICE(dev), bus, &error_fatal);
      
          @@
          expression bus, type_name, expr;
          identifier dev;
          @@
          -    DeviceState *dev = qdev_create(bus, type_name);
          +    DeviceState *dev = qdev_new(type_name);
               ... when != dev = expr
          -    qdev_init_nofail(dev);
          +    qdev_realize_and_unref(dev, bus, &error_fatal);
      
          @@
          expression bus, type_name, dev, expr, errp;
          symbol true;
          @@
          -    dev = qdev_create(bus, type_name);
          +    dev = qdev_new(type_name);
               ... when != dev = expr
          -    object_property_set_bool(OBJECT(dev), true, "realized", errp);
          +    qdev_realize_and_unref(dev, bus, errp);
      
          @@
          expression bus, type_name, expr, errp;
          identifier dev;
          symbol true;
          @@
          -    DeviceState *dev = qdev_create(bus, type_name);
          +    DeviceState *dev = qdev_new(type_name);
               ... when != dev = expr
          -    object_property_set_bool(OBJECT(dev), true, "realized", errp);
          +    qdev_realize_and_unref(dev, bus, errp);
      
      The first rule exempts hw/arm/highbank.c, because it matches along two
      control flow paths there, with different @type_name.  Covered by the
      next commit's manual conversions.
      
      Missing #include "qapi/error.h" added manually.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200610053247.1583243-10-armbru@redhat.com>
      [Conflicts in hw/misc/empty_slot.c and hw/sparc/leon3.c resolved]
      3e80f690
  12. May 26, 2020
  13. Feb 27, 2020
  14. Feb 19, 2020
  15. Jan 07, 2020
  16. Dec 17, 2019
  17. Dec 16, 2019
  18. Oct 24, 2019
  19. Oct 04, 2019
  20. Sep 12, 2019
    • Peter Maydell's avatar
      hw/mips/mips_jazz: Remove no-longer-necessary override of do_unassigned_access · 6626286e
      Peter Maydell authored
      
      Now that the MIPS CPU implementation uses the new
      do_transaction_failed hook, we can remove the old code that handled
      the do_unassigned_access hook.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarAleksandar Markovic <amarkovic@wavecomp.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Tested-by: default avatarHervé Poussineau <hpoussin@reactos.org>
      Message-Id: <20190802160458.25681-4-peter.maydell@linaro.org>
      6626286e
    • Peter Maydell's avatar
      hw/mips/mips_jazz: Override do_transaction_failed hook · 8d2b8718
      Peter Maydell authored
      The MIPS Jazz ('magnum' and 'pica61') boards have some code which
      overrides the CPU's do_unassigned_access hook, so they can intercept
      it and not raise exceptions on data accesses to invalid addresses,
      only for instruction fetches.
      
      We want to switch MIPS over to using the do_transaction_failed
      hook instead, so add an intercept for that as well, and make
      the board code install whichever hook the CPU is actually using.
      Once we've changed the CPU implementation we can remove the
      redundant code for the old hook.
      
      Note: I am suspicious that the behaviour as implemented here may not
      be what the hardware really does.  It was added in commit
      54e75558 to restore the behaviour that was broken by
      commit c658b94f.  But prior to commit c658b94f
      every MIPS board generated exceptions for instruction access to
      invalid addresses but not for data accesses; and other boards,
      notably Malta, were fixed by making all invalid accesses behave as
      reads-as-zero (see the call to empty_slot_init() in
      mips_malta_init()).  Hardware that raises exceptions for instruction
      access and not data access seems to me to be an unlikely design, and
      it's possible that the right way to emulate this is to make the Jazz
      boards do what we did with Malta (or some variation of that).
      Nonetheless, since I don't have access to real hardware to test
      against I have taken the approach of "make QEMU continue to behave
      the same way it did before this commit".  I have updated the comment
      to correct the parts that are no longer accurate and note that
      the hardware might behave differently.
      
      The test case for the need for the hook-hijacking is in
      https://bugs.launchpad.net/qemu/+bug/1245924
      
       That BIOS will boot OK
      either with this overriding of both hooks, or with a simple "global
      memory region to ignore bad accesses of all types", so it doesn't
      provide evidence either way, unfortunately.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarAleksandar Markovic <amarkovic@wavecomp.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Tested-by: default avatarHervé Poussineau <hpoussin@reactos.org>
      Message-Id: <20190802160458.25681-2-peter.maydell@linaro.org>
      8d2b8718
  21. Aug 16, 2019
  22. Jun 12, 2019
    • Markus Armbruster's avatar
      Include qemu-common.h exactly where needed · a8d25326
      Markus Armbruster authored
      
      No header includes qemu-common.h after this commit, as prescribed by
      qemu-common.h's file comment.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20190523143508.25387-5-armbru@redhat.com>
      [Rebased with conflicts resolved automatically, except for
      include/hw/arm/xlnx-zynqmp.h hw/arm/nrf51_soc.c hw/arm/msf2-soc.c
      block/qcow2-refcount.c block/qcow2-cluster.c block/qcow2-cache.c
      target/arm/cpu.h target/lm32/cpu.h target/m68k/cpu.h target/mips/cpu.h
      target/moxie/cpu.h target/nios2/cpu.h target/openrisc/cpu.h
      target/riscv/cpu.h target/tilegx/cpu.h target/tricore/cpu.h
      target/unicore32/cpu.h target/xtensa/cpu.h; bsd-user/main.c and
      net/tap-bsd.c fixed up]
      a8d25326
  23. Jun 28, 2018
  24. Apr 26, 2018
  25. Mar 12, 2018
  26. Feb 09, 2018
  27. Feb 06, 2018
    • Alistair Francis's avatar
      hw/mips: Replace fprintf(stderr, "*\n" with error_report() · bd6e1d81
      Alistair Francis authored
      
      Replace a large number of the fprintf(stderr, "*\n" calls with
      error_report(). The functions were renamed with these commands and then
      compiler issues where manually fixed.
      
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N;N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      find ./* -type f -exec sed -i \
          'N; {s|fprintf(stderr, "\(.*\)\\n"\(.*\));|error_report("\1"\2);|Ig}' \
          {} +
      
      Some lines where then manually tweaked to pass checkpatch.
      
      Signed-off-by: default avatarAlistair Francis <alistair.francis@xilinx.com>
      Cc: Paul Burton <paul.burton@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Yongbok Kim <yongbok.kim@imgtec.com>
      Cc: "Hervé Poussineau" <hpoussin@reactos.org>
      
      Conversions that aren't followed by exit() dropped, because they might
      be inappropriate.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20180203084315.20497-6-armbru@redhat.com>
      bd6e1d81
Loading