1. 16 8月, 2019 1 次提交
    • M
      Include sysemu/sysemu.h a lot less · 46517dd4
      Markus Armbruster 提交于
      In my "build everything" tree, changing sysemu/sysemu.h triggers a
      recompile of some 5400 out of 6600 objects (not counting tests and
      objects that don't depend on qemu/osdep.h).
      
      hw/qdev-core.h includes sysemu/sysemu.h since recent commit e965ffa7
      "qdev: add qdev_add_vm_change_state_handler()".  This is a bad idea:
      hw/qdev-core.h is widely included.
      
      Move the declaration of qdev_add_vm_change_state_handler() to
      sysemu/sysemu.h, and drop the problematic include from hw/qdev-core.h.
      
      Touching sysemu/sysemu.h now recompiles some 1800 objects.
      qemu/uuid.h also drops from 5400 to 1800.  A few more headers show
      smaller improvement: qemu/notify.h drops from 5600 to 5200,
      qemu/timer.h from 5600 to 4500, and qapi/qapi-types-run-state.h from
      5500 to 5000.
      
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NAlistair Francis <alistair.francis@wdc.com>
      Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
      Message-Id: <20190812052359.30071-28-armbru@redhat.com>
      Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
      46517dd4
  2. 02 7月, 2019 8 次提交
  3. 12 6月, 2019 1 次提交
  4. 25 5月, 2019 1 次提交
    • P
      hw/arm/aspeed: Use object_initialize_child for correct ref. counting · 1b0ad567
      Philippe Mathieu-Daudé 提交于
      As explained in commit aff39be0:
      
        Both functions, object_initialize() and object_property_add_child()
        increase the reference counter of the new object, so one of the
        references has to be dropped afterwards to get the reference
        counting right. Otherwise the child object will not be properly
        cleaned up when the parent gets destroyed.
        Thus let's use now object_initialize_child() instead to get the
        reference counting here right.
      
      This patch was generated using the following Coccinelle script
      (with a bit of manual fix-up for overly long lines):
      
       @use_object_initialize_child@
       expression parent_obj;
       expression child_ptr;
       expression child_name;
       expression child_type;
       expression child_size;
       expression errp;
       @@
       (
       -   object_initialize(child_ptr, child_size, child_type);
       +   object_initialize_child(parent_obj, child_name,  child_ptr, child_size,
       +                           child_type, &error_abort, NULL);
           ... when != parent_obj
       -   object_property_add_child(parent_obj, child_name, OBJECT(child_ptr), NULL);
           ...
       ?-  object_unref(OBJECT(child_ptr));
       |
       -   object_initialize(child_ptr, child_size, child_type);
       +   object_initialize_child(parent_obj, child_name,  child_ptr, child_size,
       +                            child_type, errp, NULL);
           ... when != parent_obj
       -   object_property_add_child(parent_obj, child_name, OBJECT(child_ptr), errp);
           ...
       ?-  object_unref(OBJECT(child_ptr));
       )
      
       @use_sysbus_init_child_obj@
       expression parent_obj;
       expression dev;
       expression child_ptr;
       expression child_name;
       expression child_type;
       expression child_size;
       expression errp;
       @@
       (
       -   object_initialize_child(parent_obj, child_name, child_ptr, child_size,
       -                           child_type, errp, NULL);
       +   sysbus_init_child_obj(parent_obj, child_name, child_ptr, child_size,
       +                         child_type);
           ...
       -   qdev_set_parent_bus(DEVICE(child_ptr), sysbus_get_default());
       |
       -   object_initialize_child(parent_obj, child_name, child_ptr, child_size,
       -                           child_type, errp, NULL);
       +   sysbus_init_child_obj(parent_obj, child_name, child_ptr, child_size,
       +                         child_type);
       -   dev = DEVICE(child_ptr);
       -   qdev_set_parent_bus(dev, sysbus_get_default());
       )
      
      While the object_initialize() function doesn't take an
      'Error *errp' argument, the object_initialize_child() does.
      Since this code is used when a machine is created (and is not
      yet running), we deliberately choose to use the &error_abort
      argument instead of ignoring errors if an object creation failed.
      This choice also matches when using sysbus_init_child_obj(),
      since its code is:
      
        void sysbus_init_child_obj(Object *parent,
                                   const char *childname, void *child,
                                   size_t childsize, const char *childtype)
        {
            object_initialize_child(parent, childname, child, childsize,
                                    childtype, &error_abort, NULL);
      
            qdev_set_parent_bus(DEVICE(child), sysbus_get_default());
        }
      Suggested-by: NEduardo Habkost <ehabkost@redhat.com>
      Inspired-by: NThomas Huth <thuth@redhat.com>
      Signed-off-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Signed-off-by: NCédric Le Goater <clg@kaod.org>
      Reviewed-by: NJoel Stanley <joel@jms.id.au>
      Message-Id: <20190507163416.24647-8-philmd@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      1b0ad567
  5. 16 8月, 2018 1 次提交
  6. 27 6月, 2018 2 次提交
  7. 26 4月, 2018 2 次提交
  8. 16 2月, 2018 2 次提交
  9. 20 11月, 2017 1 次提交
    • J
      hw/arm/aspeed: Unlock SCU when running kernel · b6e70d1d
      Joel Stanley 提交于
      The ASPEED hardware contains a lock register for the SCU that disables
      any writes to the SCU when it is locked. The machine comes up with the
      lock enabled, but on all known hardware u-boot will unlock it and leave
      it unlocked when loading the kernel.
      
      This means the kernel expects the SCU to be unlocked. When booting from
      an emulated ROM the normal u-boot unlock path is executed. Things don't
      go well when booting using the -kernel command line, as u-boot does not
      run first.
      
      Change behaviour so that when a kernel is passed to the machine, set the
      reset value of the SCU to be unlocked.
      Signed-off-by: NJoel Stanley <joel@jms.id.au>
      Reviewed-by: NCédric Le Goater <clg@kaod.org>
      Message-id: 20171114122018.12204-1-joel@jms.id.au
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      b6e70d1d
  10. 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
  11. 05 9月, 2017 1 次提交
  12. 04 9月, 2017 1 次提交
  13. 15 7月, 2017 1 次提交
  14. 11 7月, 2017 1 次提交
  15. 25 4月, 2017 1 次提交
  16. 08 2月, 2017 1 次提交
  17. 27 12月, 2016 6 次提交
  18. 18 10月, 2016 4 次提交
  19. 23 9月, 2016 4 次提交