1. 19 5月, 2020 12 次提交
  2. 16 5月, 2020 5 次提交
  3. 15 5月, 2020 23 次提交
    • P
      Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-tcg-plugins-150520-2' into staging · 66706192
      Peter Maydell 提交于
      Various testing, tcg and plugin updates
      
        - fix bug in gdbstub tests that leave hanging QEMUs
        - tweak s390x travis test
        - re-factor guest_base handling
        - support "notes" in disassembler output
        - include guest address notes in out_asm
        - cleanup plugin headers and and constify hwaddr
        - updates MAINTAINERS for cpu-common.c
      
      # gpg: Signature made Fri 15 May 2020 15:40:40 BST
      # gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
      # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full]
      # Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44
      
      * remotes/stsquad/tags/pull-testing-tcg-plugins-150520-2:
        MAINTAINERS: update the orphaned cpus-common.c file
        qemu/qemu-plugin: Make qemu_plugin_hwaddr_is_io() hwaddr argument const
        qemu/plugin: Move !CONFIG_PLUGIN stubs altogether
        qemu/plugin: Trivial code movement
        translate-all: include guest address in out_asm output
        disas: add optional note support to cap_disas
        disas: include an optional note for the start of disassembly
        accel/tcg: don't disable exec_tb trace events
        accel/tcg: Relax va restrictions on 64-bit guests
        exec/cpu-all: Use bool for have_guest_base
        linux-user: completely re-write init_guest_space
        travis.yml: Improve the --disable-tcg test on s390x
        tests/guest-debug: catch hanging guests
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      66706192
    • A
      MAINTAINERS: update the orphaned cpus-common.c file · adf1cfbd
      Alex Bennée 提交于
      We forgot to update MAINTAINERS when this code was re-factored.
      
      Fixes: 267f685bSigned-off-by: NAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
      Message-Id: <20200513173200.11830-5-alex.bennee@linaro.org>
      adf1cfbd
    • P
      qemu/qemu-plugin: Make qemu_plugin_hwaddr_is_io() hwaddr argument const · 308e7549
      Philippe Mathieu-Daudé 提交于
      Rename qemu_plugin_hwaddr_is_io() address argument 'haddr'
      similarly to qemu_plugin_hwaddr_device_offset(), and make
      it const.
      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-4-f4bug@amsat.org>
      Message-Id: <20200513173200.11830-4-alex.bennee@linaro.org>
      308e7549
    • P
      qemu/plugin: Move !CONFIG_PLUGIN stubs altogether · 1b9905ca
      Philippe Mathieu-Daudé 提交于
      Simplify the ifdef'ry by moving all stubs together.
      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-3-f4bug@amsat.org>
      Message-Id: <20200513173200.11830-3-alex.bennee@linaro.org>
      1b9905ca
    • 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