1. 15 5月, 2020 33 次提交
    • P
      qemu/plugin: Trivial code movement · d2f6dc07
      Philippe Mathieu-Daudé 提交于
      Move the qemu_plugin_event enum declaration earlier.
      This will make the next commit easier to review.
      Signed-off-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: NEmilio G. Cota <cota@braap.org>
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Message-Id: <20200510171119.20827-2-f4bug@amsat.org>
      Message-Id: <20200513173200.11830-2-alex.bennee@linaro.org>
      d2f6dc07
    • A
      translate-all: include guest address in out_asm output · 5f0df033
      Alex Bennée 提交于
      We already have information about where each guest instructions
      representation starts stored in the tcg_ctx->gen_insn_data so we can
      rectify the PC for faults. We can re-use this information to annotate
      the out_asm output with guest instruction address which makes it a bit
      easier to work out where you are especially with longer blocks. A
      minor wrinkle is that some instructions get optimised away so we have
      to scan forward until we find some actual generated code.
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      
      Message-Id: <20200513175134.19619-11-alex.bennee@linaro.org>
      5f0df033
    • A
      disas: add optional note support to cap_disas · 16b22e02
      Alex Bennée 提交于
      Include support for outputting a note at the top of a chunk of
      disassembly to capstone as well.
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      
      Message-Id: <20200513175134.19619-10-alex.bennee@linaro.org>
      16b22e02
    • A
      disas: include an optional note for the start of disassembly · e5ef4ec2
      Alex Bennée 提交于
      This will become useful shortly for providing more information about
      output assembly inline. While there fix up the indenting and code
      formatting in disas().
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      
      Message-Id: <20200513175134.19619-9-alex.bennee@linaro.org>
      e5ef4ec2
    • A
      accel/tcg: don't disable exec_tb trace events · 6a7aa856
      Alex Bennée 提交于
      I doubt the well predicted trace event check is particularly special in
      the grand context of TCG code execution.
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20200513175134.19619-8-alex.bennee@linaro.org>
      6a7aa856
    • R
      accel/tcg: Relax va restrictions on 64-bit guests · 7d8cbbab
      Richard Henderson 提交于
      We cannot at present limit a 64-bit guest to a virtual address
      space smaller than the host.  It will mostly work to ignore this
      limitation, except if the guest uses high bits of the address
      space for tags.  But it will certainly work better, as presently
      we can wind up failing to allocate the guest stack.
      
      Widen our user-only page tree to the host or abi pointer width.
      Remove the workaround for this problem from target/alpha.
      Always validate guest addresses vs reserved_va, as there we
      control allocation ourselves.
      Signed-off-by: NRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      
      Message-Id: <20200513175134.19619-7-alex.bennee@linaro.org>
      7d8cbbab
    • R
      exec/cpu-all: Use bool for have_guest_base · e307c192
      Richard Henderson 提交于
      Signed-off-by: NRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: NLaurent Vivier <laurent@vivier.eu>
      Message-Id: <20200513175134.19619-6-alex.bennee@linaro.org>
      e307c192
    • A
      linux-user: completely re-write init_guest_space · ee947430
      Alex Bennée 提交于
      First we ensure all guest space initialisation logic comes through
      probe_guest_base once we understand the nature of the binary we are
      loading. The convoluted init_guest_space routine is removed and
      replaced with a number of pgb_* helpers which are called depending on
      what requirements we have when loading the binary.
      
      We first try to do what is requested by the host. Failing that we try
      and satisfy the guest requested base address. If all those options
      fail we fall back to finding a space in the memory map using our
      recently written read_self_maps() helper.
      
      There are some additional complications we try and take into account
      when looking for holes in the address space. We try not to go directly
      after the system brk() space so there is space for a little growth. We
      also don't want to have to use negative offsets which would result in
      slightly less efficient code on x86 when it's unable to use the
      segment offset register.
      
      Less mind-binding gotos and hopefully clearer logic throughout.
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Acked-by: NLaurent Vivier <laurent@vivier.eu>
      
      Message-Id: <20200513175134.19619-5-alex.bennee@linaro.org>
      ee947430
    • T
      travis.yml: Improve the --disable-tcg test on s390x · aae8b87e
      Thomas Huth 提交于
      Since the s390x containers do not allow KVM, we only compile-test
      the --disable-tcg build on s390x and do not run the qtests. Thus,
      it does not make sense to install genisoimage here, and it also does
      not make sense to build the s390-ccw.img here again - it is simply
      not used without the qtests.
      On the other hand, if we do not build the s390-ccw.img anymore, we
      can also compile with Clang - so let's use that compiler here to
      get some additional test coverage.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: NCornelia Huck <cohuck@redhat.com>
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Message-Id: <20200512133849.10624-1-thuth@redhat.com>
      Message-Id: <20200513175134.19619-3-alex.bennee@linaro.org>
      aae8b87e
    • A
      tests/guest-debug: catch hanging guests · b03e4fff
      Alex Bennée 提交于
      If gdb never actually connected with the guest we need to catch that
      and clean-up after ourselves.
      Signed-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Message-Id: <20200513175134.19619-2-alex.bennee@linaro.org>
      b03e4fff
    • P
      Merge remote-tracking branch 'remotes/kraxel/tags/ui-20200515-pull-request' into staging · 2478b8ec
      Peter Maydell 提交于
      ui: sdl bugfix, -show-cursor deprecation message
      
      # gpg: Signature made Fri 15 May 2020 09:21:29 BST
      # gpg:                using RSA key 4CB6D8EED3E87138
      # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
      # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
      # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]
      # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
      
      * remotes/kraxel/tags/ui-20200515-pull-request:
        ui/sdl2: fix segment fault caused by null pointer dereference
        ui: improve -show-cursor deprecation message
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      2478b8ec
    • P
      Merge remote-tracking branch 'remotes/armbru/tags/pull-qom-2020-05-15' into staging · 0db949f1
      Peter Maydell 提交于
      QOM patches for 2020-05-15
      
      # gpg: Signature made Fri 15 May 2020 06:58:29 BST
      # gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
      # gpg:                issuer "armbru@redhat.com"
      # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
      # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
      # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653
      
      * remotes/armbru/tags/pull-qom-2020-05-15: (21 commits)
        hw: Remove unnecessary DEVICE() cast
        various: Remove unnecessary OBJECT() cast
        target: Remove unnecessary CPU() cast
        qom: Drop @errp parameter of object_property_del()
        spapr_pci: Drop some dead error handling
        qdev: Unrealize must not fail
        Drop more @errp parameters after previous commit
        qom: Drop parameter @errp of object_property_add() & friends
        qdev: Clean up qdev_connect_gpio_out_named()
        hw/arm/bcm2835: Drop futile attempts at QOM-adopting memory
        e1000: Don't run e1000_instance_init() twice
        hw/isa/superio: Make the components QOM children
        s390x/cpumodel: Fix UI to CPU features pcc-cmac-{aes,eaes}-256
        tests/check-qom-proplist: Improve iterator coverage
        qom: Drop object_property_set_description() parameter @errp
        qom: Make all the object_property_add_FOO() return the property
        qom: Drop convenience method object_property_get_uint16List()
        qom: Simplify object_property_get_enum()
        qom: Drop object_property_del_child()'s unused parameter @errp
        qom: Clean up inconsistent use of gchar * vs. char *
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      0db949f1
    • P
      hw: Remove unnecessary DEVICE() cast · 8e5c952b
      Philippe Mathieu-Daudé 提交于
      The DEVICE() macro is defined as:
      
        #define DEVICE(obj) OBJECT_CHECK(DeviceState, (obj), TYPE_DEVICE)
      
      which expands to:
      
        ((DeviceState *)object_dynamic_cast_assert((Object *)(obj), (name),
                                                   __FILE__, __LINE__,
                                                   __func__))
      
      This assertion can only fail when @obj points to something other
      than its stated type, i.e. when we're in undefined behavior country.
      
      Remove the unnecessary DEVICE() casts when we already know the
      pointer is of DeviceState type.
      
      Patch created mechanically using spatch with this script:
      
        @@
        typedef DeviceState;
        DeviceState *s;
        @@
        -   DEVICE(s)
        +   s
      Acked-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Acked-by: NPaul Durrant <paul@xen.org>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NCédric Le Goater <clg@kaod.org>
      Acked-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20200512070020.22782-4-f4bug@amsat.org>
      8e5c952b
    • P
      various: Remove unnecessary OBJECT() cast · 688ffbb4
      Philippe Mathieu-Daudé 提交于
      The OBJECT() macro is defined as:
      
        #define OBJECT(obj) ((Object *)(obj))
      
      Remove the unnecessary OBJECT() casts when we already know the
      pointer is of Object type.
      
      Patch created mechanically using spatch with this script:
      
        @@
        typedef Object;
        Object *o;
        @@
        -   OBJECT(o)
        +   o
      Acked-by: NCornelia Huck <cohuck@redhat.com>
      Acked-by: NCorey Minyard <cminyard@mvista.com>
      Acked-by: NJohn Snow <jsnow@redhat.com>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20200512070020.22782-3-f4bug@amsat.org>
      [Trivial rebase conflict in hw/s390x/sclp.c resolved]
      688ffbb4
    • P
      target: Remove unnecessary CPU() cast · 96449e4a
      Philippe Mathieu-Daudé 提交于
      The CPU() macro is defined as:
      
        #define CPU(obj) ((CPUState *)(obj))
      
      which expands to:
      
        ((CPUState *)object_dynamic_cast_assert((Object *)(obj), (name),
                                                __FILE__, __LINE__, __func__))
      
      This assertion can only fail when @obj points to something other
      than its stated type, i.e. when we're in undefined behavior country.
      
      Remove the unnecessary CPU() casts when we already know the pointer
      is of CPUState type.
      
      Patch created mechanically using spatch with this script:
      
        @@
        typedef CPUState;
        CPUState *s;
        @@
        -   CPU(s)
        +   s
      Acked-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NCédric Le Goater <clg@kaod.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <20200512070020.22782-2-f4bug@amsat.org>
      96449e4a
    • M
      qom: Drop @errp parameter of object_property_del() · df4fe0b2
      Markus Armbruster 提交于
      Same story as for object_property_add(): the only way
      object_property_del() can fail is when the property with this name
      does not exist.  Since our property names are all hardcoded, failure
      is a programming error, and the appropriate way to handle it is
      passing &error_abort.  Most callers do that, the commit before
      previous fixed one that didn't (and got the error handling wrong), and
      the two remaining exceptions ignore errors.
      
      Drop the @errp parameter.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200505152926.18877-19-armbru@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      df4fe0b2
    • M
      spapr_pci: Drop some dead error handling · 7ef1553d
      Markus Armbruster 提交于
      chassis_from_bus() uses object_property_get_uint() to get property
      "chassis_nr" of the bridge device.  Failure would be a programming
      error.  Pass &error_abort, and simplify its callers.
      
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: qemu-ppc@nongnu.org
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Acked-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200505152926.18877-18-armbru@redhat.com>
      7ef1553d
    • M
      qdev: Unrealize must not fail · b69c3c21
      Markus Armbruster 提交于
      Devices may have component devices and buses.
      
      Device realization may fail.  Realization is recursive: a device's
      realize() method realizes its components, and device_set_realized()
      realizes its buses (which should in turn realize the devices on that
      bus, except bus_set_realized() doesn't implement that, yet).
      
      When realization of a component or bus fails, we need to roll back:
      unrealize everything we realized so far.  If any of these unrealizes
      failed, the device would be left in an inconsistent state.  Must not
      happen.
      
      device_set_realized() lets it happen: it ignores errors in the roll
      back code starting at label child_realize_fail.
      
      Since realization is recursive, unrealization must be recursive, too.
      But how could a partly failed unrealize be rolled back?  We'd have to
      re-realize, which can fail.  This design is fundamentally broken.
      
      device_set_realized() does not roll back at all.  Instead, it keeps
      unrealizing, ignoring further errors.
      
      It can screw up even for a device with no buses: if the lone
      dc->unrealize() fails, it still unregisters vmstate, and calls
      listeners' unrealize() callback.
      
      bus_set_realized() does not roll back either.  Instead, it stops
      unrealizing.
      
      Fortunately, no unrealize method can fail, as we'll see below.
      
      To fix the design error, drop parameter @errp from all the unrealize
      methods.
      
      Any unrealize method that uses @errp now needs an update.  This leads
      us to unrealize() methods that can fail.  Merely passing it to another
      unrealize method cannot cause failure, though.  Here are the ones that
      do other things with @errp:
      
      * virtio_serial_device_unrealize()
      
        Fails when qbus_set_hotplug_handler() fails, but still does all the
        other work.  On failure, the device would stay realized with its
        resources completely gone.  Oops.  Can't happen, because
        qbus_set_hotplug_handler() can't actually fail here.  Pass
        &error_abort to qbus_set_hotplug_handler() instead.
      
      * hw/ppc/spapr_drc.c's unrealize()
      
        Fails when object_property_del() fails, but all the other work is
        already done.  On failure, the device would stay realized with its
        vmstate registration gone.  Oops.  Can't happen, because
        object_property_del() can't actually fail here.  Pass &error_abort
        to object_property_del() instead.
      
      * spapr_phb_unrealize()
      
        Fails and bails out when remove_drcs() fails, but other work is
        already done.  On failure, the device would stay realized with some
        of its resources gone.  Oops.  remove_drcs() fails only when
        chassis_from_bus()'s object_property_get_uint() fails, and it can't
        here.  Pass &error_abort to remove_drcs() instead.
      
      Therefore, no unrealize method can fail before this patch.
      
      device_set_realized()'s recursive unrealization via bus uses
      object_property_set_bool().  Can't drop @errp there, so pass
      &error_abort.
      
      We similarly unrealize with object_property_set_bool() elsewhere,
      always ignoring errors.  Pass &error_abort instead.
      
      Several unrealize methods no longer handle errors from other unrealize
      methods: virtio_9p_device_unrealize(),
      virtio_input_device_unrealize(), scsi_qdev_unrealize(), ...
      Much of the deleted error handling looks wrong anyway.
      
      One unrealize methods no longer ignore such errors:
      usb_ehci_pci_exit().
      
      Several realize methods no longer ignore errors when rolling back:
      v9fs_device_realize_common(), pci_qdev_unrealize(),
      spapr_phb_realize(), usb_qdev_realize(), vfio_ccw_realize(),
      virtio_device_realize().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200505152926.18877-17-armbru@redhat.com>
      b69c3c21
    • M
      Drop more @errp parameters after previous commit · 40c2281c
      Markus Armbruster 提交于
      Several functions can't fail anymore: ich9_pm_add_properties(),
      device_add_bootindex_property(), ppc_compat_add_property(),
      spapr_caps_add_properties(), PropertyInfo.create().  Drop their @errp
      parameter.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200505152926.18877-16-armbru@redhat.com>
      40c2281c
    • M
      qom: Drop parameter @errp of object_property_add() & friends · d2623129
      Markus Armbruster 提交于
      The only way object_property_add() can fail is when a property with
      the same name already exists.  Since our property names are all
      hardcoded, failure is a programming error, and the appropriate way to
      handle it is passing &error_abort.
      
      Same for its variants, except for object_property_add_child(), which
      additionally fails when the child already has a parent.  Parentage is
      also under program control, so this is a programming error, too.
      
      We have a bit over 500 callers.  Almost half of them pass
      &error_abort, slightly fewer ignore errors, one test case handles
      errors, and the remaining few callers pass them to their own callers.
      
      The previous few commits demonstrated once again that ignoring
      programming errors is a bad idea.
      
      Of the few ones that pass on errors, several violate the Error API.
      The Error ** argument must be NULL, &error_abort, &error_fatal, or a
      pointer to a variable containing NULL.  Passing an argument of the
      latter kind twice without clearing it in between is wrong: if the
      first call sets an error, it no longer points to NULL for the second
      call.  ich9_pm_add_properties(), sparc32_ledma_realize(),
      sparc32_dma_realize(), xilinx_axidma_realize(), xilinx_enet_realize()
      are wrong that way.
      
      When the one appropriate choice of argument is &error_abort, letting
      users pick the argument is a bad idea.
      
      Drop parameter @errp and assert the preconditions instead.
      
      There's one exception to "duplicate property name is a programming
      error": the way object_property_add() implements the magic (and
      undocumented) "automatic arrayification".  Don't drop @errp there.
      Instead, rename object_property_add() to object_property_try_add(),
      and add the obvious wrapper object_property_add().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200505152926.18877-15-armbru@redhat.com>
      [Two semantic rebase conflicts resolved]
      d2623129
    • M
      qdev: Clean up qdev_connect_gpio_out_named() · 9f742c28
      Markus Armbruster 提交于
      Both qdev_connect_gpio_out_named() and device_set_realized() put
      objects without a parent into the "/machine/unattached/" orphanage.
      
      qdev_connect_gpio_out_named() needs a lengthy comment to explain how
      it works.  It exploits that object_property_add_child() can fail only
      when we got a parent already, and ignoring that error does what we
      want.  True.  If it failed due to "duplicate property", we'd be in
      trouble, but that would be a programming error.
      
      device_set_realized() is cleaner: it checks whether we need a parent,
      then calls object_property_add_child(), aborting on failure.  No need
      for a comment, and programming errors get caught.
      
      Change qdev_connect_gpio_out_named() to match.
      
      Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20200505152926.18877-14-armbru@redhat.com>
      9f742c28
    • M
      hw/arm/bcm2835: Drop futile attempts at QOM-adopting memory · 5462cc81
      Markus Armbruster 提交于
      The "bcm2835-peripherals" device's .instance_init() method
      bcm2835_peripherals_init() attempts to make two memory regions QOM
      children of the device.  This is futile, because memory_region_init()
      already did.  The errors are ignored (a later commit will change
      that).  Drop the useless calls.
      
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Andrew Baumann <Andrew.Baumann@microsoft.com>
      Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>
      Cc: qemu-arm@nongnu.org
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Message-Id: <20200505152926.18877-13-armbru@redhat.com>
      5462cc81
    • M
      e1000: Don't run e1000_instance_init() twice · a13f2042
      Markus Armbruster 提交于
      QOM object initialization runs .instance_init() for the type and all
      its supertypes; see object_init_with_type().
      
      Both TYPE_E1000_BASE and its concrete subtypes set .instance_init() to
      e1000_instance_init().  For the concrete subtypes, it duly gets run
      twice.  The second run fails, but the error gets ignored (a later
      commit will change that).
      
      Remove it from the subtypes.
      
      Cc: Jason Wang <jasowang@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Acked-by: NJason Wang <jasowang@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200505152926.18877-12-armbru@redhat.com>
      a13f2042
    • M
      hw/isa/superio: Make the components QOM children · e5084306
      Markus Armbruster 提交于
      isa_superio_realize() attempts to make isa-parallel and isa-serial QOM
      children, but this does not work, because it calls
      object_property_add_child() after realizing with qdev_init_nofail().
      Realizing a device without a parent gives it one: it gets put into the
      "/machine/unattached/" orphanage.  The extra
      object_property_add_child() fails, and isa_superio_realize() ignores
      the error.
      
      Move the object_property_add_child() before qdev_init_nofail(), and
      pass &error_abort.
      
      For the other components, isa_superio_realize() doesn't even try.  Add
      object_property_add_child() there.
      
      This affects machines 40p, clipper and fulong2e.
      
      For instance, fulong2e has its vt82c686b-superio (which is an
      isa-superio) at /machine/unattached/device[9].  Before the patch, its
      components are at /machine/unattached/device[10] .. [14].  Afterwards,
      they are at
      /machine/unattached/device[9]/{parallel0,serial0,serial1,isa-fdc,i8042}.
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Tested-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200505152926.18877-11-armbru@redhat.com>
      e5084306
    • M
      s390x/cpumodel: Fix UI to CPU features pcc-cmac-{aes,eaes}-256 · e274408c
      Markus Armbruster 提交于
      Both s390_features[S390_FEAT_PCC_CMAC_AES_256].name and
      s390_features[S390_FEAT_PCC_CMAC_EAES_256].name is
      "pcc-cmac-eaes-256".  The former is obviously a pasto.
      
      Impact:
      
      * s390_feat_bitmap_to_ascii() misidentifies S390_FEAT_PCC_CMAC_AES_256
        as "pcc-cmac-eaes-256".  Affects QMP commands query-cpu-definitions,
        query-cpu-model-expansion, query-cpu-model-baseline,
        query-cpu-model-comparison, and the error message when
        s390_realize_cpu_model() fails in check_compatibility().
      
      * s390_cpu_list() also misidentifies it.  Affects -cpu help.
      
      * s390_cpu_model_register_props() creates CPU property
        "pcc-cmac-eaes-256" twice.  The second one fails, but the error is
        ignored (a later commit will change that).  Results in a single
        property "pcc-cmac-eaes-256" with the description for
        S390_FEAT_PCC_CMAC_AES_256, and no property for
        S390_FEAT_PCC_CMAC_EAES_256.  CPU properties are visible in CLI -cpu
        and -device, QMP & HMP device_add, QMP device-list-properties, and
        QOM introspection.
      
      The two features are almost always used via their group msa4.  Such
      use is not affected by this bug.
      
      Fix by deleting the wayward 'e'.
      
      Fixes: 78241744 ("s390x/cpumodel: introduce CPU features")
      Cc: Halil Pasic <pasic@linux.ibm.com>
      Cc: Cornelia Huck <cohuck@redhat.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: qemu-s390x@nongnu.org
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NDavid Hildenbrand <david@redhat.com>
      Tested-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Message-Id: <20200505152926.18877-10-armbru@redhat.com>
      Reviewed-by: NCornelia Huck <cohuck@redhat.com>
      [Lost paragraph in commit message restored, Fixes: tweaked]
      e274408c
    • M
      tests/check-qom-proplist: Improve iterator coverage · 48942138
      Markus Armbruster 提交于
      The tests' "qemu-dummy" device has only class properties.  Turn one of
      them into an instance property.  test_dummy_class_iterator() expects
      one fewer property than test_dummy_iterator().  Rewrite
      test_dummy_prop_iterator() to take expected properties as argument.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200505152926.18877-9-armbru@redhat.com>
      48942138
    • M
      qom: Drop object_property_set_description() parameter @errp · 7eecec7d
      Markus Armbruster 提交于
      object_property_set_description() and
      object_class_property_set_description() fail only when property @name
      is not found.
      
      There are 85 calls of object_property_set_description() and
      object_class_property_set_description().  None of them can fail:
      
      * 84 immediately follow the creation of the property.
      
      * The one in spapr_rng_instance_init() refers to a property created in
        spapr_rng_class_init(), from spapr_rng_properties[].
      
      Every one of them still gets to decide what to pass for @errp.
      
      51 calls pass &error_abort, 32 calls pass NULL, one receives the error
      and propagates it to &error_abort, and one propagates it to
      &error_fatal.  I'm actually surprised none of them violates the Error
      API.
      
      What are we gaining by letting callers handle the "property not found"
      error?  Use when the property is not known to exist is simpler: you
      don't have to guard the call with a check.  We haven't found such a
      use in 5+ years.  Until we do, let's make life a bit simpler and drop
      the @errp parameter.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200505152926.18877-8-armbru@redhat.com>
      [One semantic rebase conflict resolved]
      7eecec7d
    • M
      qom: Make all the object_property_add_FOO() return the property · 70251887
      Markus Armbruster 提交于
      Some object_property_add_FOO() return the newly added property, some
      don't.  Clean that up.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200505152926.18877-7-armbru@redhat.com>
      70251887
    • M
      qom: Drop convenience method object_property_get_uint16List() · 44a17fe0
      Markus Armbruster 提交于
      qom/object.c provides object_property_get_TYPE() and
      object_property_set_TYPE() for a number of common types.  These are
      all convenience wrappers around object_property_get_qobject() and
      object_property_set_qobject().
      
      Except for object_property_get_uint16List(), which is unusual in two ways:
      
      * It bypasses object_property_get_qobject().  Fixable; the previous
        commit did it for object_property_get_enum())
      
      * It stores the value through a parameter.  Its contract claims it
        returns the value, like the other functions do.  Also fixable.
      
      Fixing is not worthwhile, though: object_property_get_uint16List() has
      seen exactly one user in six years.
      
      Convert the lone user to do its job with the generic
      object_property_get_qobject(), and drop object_property_get_uint16List().
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20200505152926.18877-6-armbru@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      [Commit message typo fixed]
      44a17fe0
    • M
      qom: Simplify object_property_get_enum() · b555f89f
      Markus Armbruster 提交于
      Reuse object_property_get_str().  Switches from the string to the
      qobject visitor under the hood.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20200505152926.18877-5-armbru@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      b555f89f
    • M
      qom: Drop object_property_del_child()'s unused parameter @errp · f73a32a5
      Markus Armbruster 提交于
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200505152926.18877-4-armbru@redhat.com>
      f73a32a5
    • M
      qom: Clean up inconsistent use of gchar * vs. char * · ddfb0baa
      Markus Armbruster 提交于
      Uses of gchar * in qom/object.h:
      
      * ObjectProperty member @name
      
        Functions that take a property name argument all use char *.  Change
        the member to match.
      
      * ObjectProperty member @type
      
        Functions that take a property type argument or return it all use
        char *.  Change the member to match.
      
      * ObjectProperty member @description
      
        Functions that take a property description argument all use char *.
        Change the member to match.
      
      * object_resolve_path_component() parameter @part
      
        Path components are property names.  Most callers pass char *
        arguments.  Change the parameter to match.  Adjust the few callers
        that pass gchar * to pass char *.
      
      * Return value of object_get_canonical_path_component(),
        object_get_canonical_path()
      
        Most callers convert their return values right back to char *.
        Change the return value to match.  Adjust the few callers where that
        would add a conversion to gchar * to use char * instead.
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200505152926.18877-3-armbru@redhat.com>
      ddfb0baa
    • M
      qom: Clearer reference counting in object_initialize_childv() · 975ac455
      Markus Armbruster 提交于
      Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: NEric Blake <eblake@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-Id: <20200505152926.18877-2-armbru@redhat.com>
      975ac455
  2. 14 5月, 2020 7 次提交
    • P
      Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20200514' into staging · 013a18ed
      Peter Maydell 提交于
      target-arm queue:
       * target/arm: Use correct GDB XML for M-profile cores
       * target/arm: Code cleanup to use gvec APIs better
       * aspeed: Add support for the sonorapass-bmc board
       * target/arm: Support reporting KVM host memory errors
         to the guest via ACPI notifications
       * target/arm: Finish conversion of Neon 3-reg-same insns to decodetree
      
      # gpg: Signature made Thu 14 May 2020 15:19:15 BST
      # gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
      # gpg:                issuer "peter.maydell@linaro.org"
      # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [ultimate]
      # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [ultimate]
      # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [ultimate]
      # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
      
      * remotes/pmaydell/tags/pull-target-arm-20200514: (45 commits)
        target/arm: Convert NEON VFMA, VFMS 3-reg-same insns to decodetree
        target/arm: Convert Neon fp VMAX/VMIN/VMAXNM/VMINNM/VRECPS/VRSQRTS to decodetree
        target/arm: Move 'env' argument of recps_f32 and rsqrts_f32 helpers to usual place
        target/arm: Convert Neon 3-reg-same compare insns to decodetree
        target/arm: Convert Neon fp VMUL, VMLA, VMLS 3-reg-same insns to decodetree
        target/arm: Convert Neon VPMIN/VPMAX/VPADD float 3-reg-same insns to decodetree
        target/arm: Convert Neon VADD, VSUB, VABD 3-reg-same insns to decodetree
        target/arm: Convert Neon VQDMULH/VQRDMULH 3-reg-same to decodetree
        target/arm: Convert Neon VPADD 3-reg-same insns to decodetree
        target/arm: Convert Neon VPMAX/VPMIN 3-reg-same insns to decodetree
        target/arm: Convert Neon VQSHL, VRSHL, VQRSHL 3-reg-same insns to decodetree
        target/arm: Convert Neon VRHADD, VHSUB 3-reg-same insns to decodetree
        target/arm: Convert Neon VABA/VABD 3-reg-same to decodetree
        target/arm: Convert Neon VHADD 3-reg-same insns
        target/arm: Convert Neon 64-bit element 3-reg-same insns
        target/arm: Convert Neon 3-reg-same SHA to decodetree
        target/arm: Convert Neon 3-reg-same VQRDMLAH/VQRDMLSH to decodetree
        MAINTAINERS: Add ACPI/HEST/GHES entries
        target-arm: kvm64: handle SIGBUS signal from kernel or KVM
        ACPI: Record Generic Error Status Block(GESB) table
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      013a18ed
    • P
      Merge remote-tracking branch... · 0ffd3d64
      Peter Maydell 提交于
      Merge remote-tracking branch 'remotes/edgar/tags/edgar/xilinx-next-2020-05-14.for-upstream' into staging
      
      Upstream
      
      # gpg: Signature made Thu 14 May 2020 15:04:44 BST
      # gpg:                using RSA key AC44FEDC14F7F1EBEDBF415129C596780F6BCA83
      # gpg: Good signature from "Edgar E. Iglesias (Xilinx key) <edgar.iglesias@xilinx.com>" [unknown]
      # gpg:                 aka "Edgar E. Iglesias <edgar.iglesias@gmail.com>" [full]
      # Primary key fingerprint: AC44 FEDC 14F7 F1EB EDBF  4151 29C5 9678 0F6B CA83
      
      * remotes/edgar/tags/edgar/xilinx-next-2020-05-14.for-upstream:
        target/microblaze: monitor: Increase the number of registers reported
        target/microblaze: gdb: Fix incorrect SReg reporting
        target/microblaze: gdb: Extend the number of registers presented to GDB
        target/microblaze: Fix FPU2 instruction check
        target/microblaze: Add MFS Rd,EDR translation
        MAINTAINERS: Add myself as streams maintainer
        hw/dma/xilinx_axidma: s2mm: Support stream fragments
        hw/dma/xilinx_axidma: mm2s: Stream descriptor by descriptor
        hw/net/xilinx_axienet: Handle fragmented packets from DMA
        hw/core: stream: Add an end-of-packet flag
        hw/dma/xilinx_axidma: Add DMA memory-region property
        hw/net/xilinx_axienet: Remove unncessary cast
        hw/net/xilinx_axienet: Cleanup stream->push assignment
        hw/net/xilinx_axienet: Auto-clear PHY Autoneg
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      0ffd3d64
    • P
      target/arm: Convert NEON VFMA, VFMS 3-reg-same insns to decodetree · e95485f8
      Peter Maydell 提交于
      Convert the Neon floating point VFMA and VFMS insn to decodetree.
      These are the last insns in the 3-reg-same group so we can
      remove all the support/loop code from the old decoder.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20200512163904.10918-18-peter.maydell@linaro.org
      e95485f8
    • P
      target/arm: Convert Neon fp VMAX/VMIN/VMAXNM/VMINNM/VRECPS/VRSQRTS to decodetree · d5fdf9e9
      Peter Maydell 提交于
      Convert the Neon fp VMAX/VMIN/VMAXNM/VMINNM/VRECPS/VRSQRTS 3-reg-same
      insns to decodetree. (These are all the remaining non-accumulation
      instructions in this group.)
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20200512163904.10918-17-peter.maydell@linaro.org
      d5fdf9e9
    • P
      target/arm: Move 'env' argument of recps_f32 and rsqrts_f32 helpers to usual place · 26c6f695
      Peter Maydell 提交于
      The usual location for the env argument in the argument list of a TCG helper
      is immediately after the return-value argument. recps_f32 and rsqrts_f32
      differ in that they put it at the end.
      
      Move the env argument to its usual place; this will allow us to
      more easily use these helper functions with the gvec APIs.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20200512163904.10918-16-peter.maydell@linaro.org
      26c6f695
    • P
      target/arm: Convert Neon 3-reg-same compare insns to decodetree · 727ff1d6
      Peter Maydell 提交于
      Convert the Neon integer 3-reg-same compare insns VCGE, VCGT,
      VCEQ, VACGE and VACGT to decodetree.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20200512163904.10918-15-peter.maydell@linaro.org
      727ff1d6
    • P
      target/arm: Convert Neon fp VMUL, VMLA, VMLS 3-reg-same insns to decodetree · 8aa71ead
      Peter Maydell 提交于
      Convert the Neon integer VMUL, VMLA, and VMLS 3-reg-same inssn to
      decodetree.
      
      We don't have a gvec helper for multiply-accumulate, so VMLA and VMLS
      need a loop function do_3same_fp().  This takes a reads_vd parameter
      to do_3same_fp() which tells it to load the old value into vd before
      calling the callback function, in the same way that the do_vfp_3op_sp()
      and do_vfp_3op_dp() functions in translate-vfp.inc.c work. (The
      only uses in this patch pass reads_vd == true, but later commits
      will use reads_vd == false.)
      
      This conversion fixes in passing an underdecoding for VMUL
      (originally reported by Fredrik Strupe <fredrik@strupe.net>): bit 1
      of the 'size' field must be 0.  The old decoder didn't enforce this,
      but the decodetree pattern does.
      
      The gen_VMLA_fp_reg() function performs the addition operation
      with the operands in the opposite order to the old decoder:
      since Neon sets 'default NaN mode' float32_add operations are
      commutative so there is no behaviour difference, but putting
      them this way around matches the Arm ARM pseudocode and the
      required operation order for the subtraction in gen_VMLS_fp_reg().
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20200512163904.10918-14-peter.maydell@linaro.org
      8aa71ead