Skip to content
Snippets Groups Projects
  1. Oct 29, 2019
    • Jens Freimann's avatar
      pci: mark device having guest unplug request pending · c000a9bd
      Jens Freimann authored
      
      Set pending_deleted_event in DeviceState for failover
      primary devices that were successfully unplugged by the Guest OS.
      
      Signed-off-by: default avatarJens Freimann <jfreimann@redhat.com>
      Message-Id: <20191029114905.6856-5-jfreimann@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      c000a9bd
    • Jens Freimann's avatar
      pci: mark devices partially unplugged · a99c4da9
      Jens Freimann authored
      
      Only the guest unplug request was triggered. This is needed for
      the failover feature. In case of a failed migration we need to
      plug the device back to the guest.
      
      Signed-off-by: default avatarJens Freimann <jfreimann@redhat.com>
      Message-Id: <20191029114905.6856-4-jfreimann@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      a99c4da9
    • Jens Freimann's avatar
      pci: add option for net failover · 4f5b6a05
      Jens Freimann authored
      
      This patch adds a failover_pair_id property to PCIDev which is
      used to link the primary device in a failover pair (the PCI dev) to
      a standby (a virtio-net-pci) device.
      
      It only supports ethernet devices. Also currently it only supports
      PCIe devices. The requirement for PCIe is because it doesn't support
      other hotplug controllers at the moment. The failover functionality can
      be added to other hotplug controllers like ACPI, SHCP,... later on.
      
      Signed-off-by: default avatarJens Freimann <jfreimann@redhat.com>
      Message-Id: <20191029114905.6856-3-jfreimann@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      4f5b6a05
    • Jens Freimann's avatar
      qdev/qbus: add hidden device support · f3a85056
      Jens Freimann authored
      This adds support for hiding a device to the qbus and qdev APIs.  The
      first user of this will be the virtio-net failover feature but the API
      introduced with this patch could be used to implement other features as
      well, for example hiding pci devices when a pci bus is powered off.
      
      qdev_device_add() is modified to check for a failover_pair_id
      argument in the option string. A DeviceListener callback
      should_be_hidden() is added. It can be used by a standby device to
      inform qdev that this device should not be added now. The standby device
      handler can store the device options to plug the device in at a later
      point in time.
      
      One reason for hiding the device is that we don't want to expose both
      devices to the guest kernel until the respective virtio feature bit
      VIRTIO_NET_F_STANDBY was negotiated and we know that the devices will be
      handled correctly by the guest.
      
      More information on the kernel feature this is using:
       https://www.kernel.org/doc/html/latest/networking/net_failover.html
      
      
      
      An example where the primary device is a vfio-pci device and the standby
      device is a virtio-net device:
      
      A device is hidden when it has an "failover_pair_id" option, e.g.
      
       -device virtio-net-pci,...,failover=on,...
       -device vfio-pci,...,failover_pair_id=net1,...
      
      Signed-off-by: default avatarJens Freimann <jfreimann@redhat.com>
      Message-Id: <20191029114905.6856-2-jfreimann@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      f3a85056
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2019-10-29' into staging · 16884391
      Peter Maydell authored
      
      QAPI patches for 2019-10-29
      
      # gpg: Signature made Tue 29 Oct 2019 06:40:56 GMT
      # 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-qapi-2019-10-29:
        qapi: Check feature documentation against the schema
        qapi: Polish reporting of bogus member documentation
        qapi: Lift features into QAPISchemaEntity
        qapi: Fold normalize_enum() into check_enum()
        qapi: Fold normalize_features() into check_features()
        qapi: Fold normalize_if() into check_if()
        qapi: Eliminate .check_doc() overrides
        qapi: Simplify ._make_implicit_object_type()
        qapi: Fix doc comment checking for commands and events
        qapi: Clean up doc comment checking for implicit union base
        qapi: Fix enum doc comment checking
        qapi: Split .connect_doc(), .check_doc() off .check()
        qapi: De-duplicate entity documentation generation code
        qapi: Implement boxed event argument documentation
        qemu-doc: Belatedly document QMP command deprecation
        tests/qapi-schema: Fix feature documentation testing
        tests/qapi-schema: Cover alternate documentation comments
        tests/qapi-schema: Demonstrate command and event doc comment bugs
        tests/qapi-schema: Demonstrate feature and enum doc comment bugs
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      16884391
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging · 1cfe28cd
      Peter Maydell authored
      
      # gpg: Signature made Tue 29 Oct 2019 02:33:36 GMT
      # gpg:                using RSA key EF04965B398D6211
      # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" [marginal]
      # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
      # gpg:          It is not certain that the signature belongs to the owner.
      # Primary key fingerprint: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211
      
      * remotes/jasowang/tags/net-pull-request:
        COLO-compare: Fix incorrect `if` logic
        virtio-net: prevent offloads reset on migration
        virtio: new post_load hook
        net: add tulip (dec21143) driver
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      1cfe28cd
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/mcayland/tags/qemu-openbios-20191028' into staging · 69f73517
      Peter Maydell authored
      
      qemu-openbios queue
      
      # gpg: Signature made Mon 28 Oct 2019 19:03:44 GMT
      # gpg:                using RSA key CC621AB98E82200D915CC9C45BC2C56FAE0F321F
      # gpg:                issuer "mark.cave-ayland@ilande.co.uk"
      # gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>" [full]
      # Primary key fingerprint: CC62 1AB9 8E82 200D 915C  C9C4 5BC2 C56F AE0F 321F
      
      * remotes/mcayland/tags/qemu-openbios-20191028:
        Update OpenBIOS images to 7e5b89e4 built from submodule.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      69f73517
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/vivier/tags/q800-branch-pull-request' into staging · f724de8d
      Peter Maydell authored
      
      Add Macintosh Quadra 800 machine in hw/m68k
      
      # gpg: Signature made Mon 28 Oct 2019 18:14:25 GMT
      # gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
      # gpg:                issuer "laurent@vivier.eu"
      # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
      # gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
      # gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
      # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C
      
      * remotes/vivier/tags/q800-branch-pull-request:
        BootLinuxConsoleTest: Test the Quadra 800
        hw/m68k: define Macintosh Quadra 800
        hw/m68k: add a dummy SWIM floppy controller
        hw/m68k: add Nubus macfb video card
        hw/m68k: add Nubus support
        hw/m68k: implement ADB bus support for via
        hw/m68k: add VIA support
        dp8393x: manage big endian bus
        esp: add pseudo-DMA as used by Macintosh
        esp: move get_cmd() post-DMA code to get_cmd_cb()
        esp: move handle_ti_cmd() cleanup code to esp_do_dma().
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      f724de8d
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/berrange/tags/crypto-luks-pull-request' into staging · 4599cb95
      Peter Maydell authored
      
      crypto: improve performance of ciphers in XTS mode
      
      Currently QEMU uses its own XTS cipher mode, however, this has
      relatively poor performance.
      
      Gcrypt now includes its own XTS cipher which is at least x2 faster than
      what we get with QEMU's on Fedora/RHEL hosts. With gcrypt git master, a
      further x5-6 speed up is seen.
      
      This is essential for QEMU's LUKS performance to be viable.
      
      # gpg: Signature made Mon 28 Oct 2019 15:48:38 GMT
      # gpg:                using RSA key DAF3A6FDB26B62912D0E8E3FBE86EBB415104FDF
      # gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full]
      # gpg:                 aka "Daniel P. Berrange <berrange@redhat.com>" [full]
      # Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF
      
      * remotes/berrange/tags/crypto-luks-pull-request:
        crypto: add support for nettle's native XTS impl
        crypto: add support for gcrypt's native XTS impl
        tests: benchmark crypto with fixed data size, not time period
        tests: allow filtering crypto cipher benchmark tests
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      4599cb95
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20191028' into staging · 8c68ff25
      Peter Maydell authored
      
      Improvements for TARGET_PAGE_BITS_VARY
      Fix for TCI ld16u_i64.
      Fix for segv on icount execute from i/o memory.
      Two misc cleanups.
      
      # gpg: Signature made Mon 28 Oct 2019 14:55:08 GMT
      # gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
      # gpg:                issuer "richard.henderson@linaro.org"
      # gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full]
      # Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F
      
      * remotes/rth/tags/pull-tcg-20191028:
        translate-all: Remove tb_alloc
        translate-all: fix uninitialized tb->orig_tb
        cputlb: Fix tlb_vaddr_to_host
        exec: Cache TARGET_PAGE_MASK for TARGET_PAGE_BITS_VARY
        exec: Promote TARGET_PAGE_MASK to target_long
        exec: Restrict TARGET_PAGE_BITS_VARY assert to CONFIG_DEBUG_TCG
        exec: Use const alias for TARGET_PAGE_BITS_VARY
        configure: Detect compiler support for __attribute__((alias))
        exec: Split out variable page size support to exec-vary.c
        cpu: use ROUND_UP() to define xxx_PAGE_ALIGN
        cputlb: ensure _cmmu helper functions follow the naming standard
        tci: Add implementation for INDEX_op_ld16u_i64
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      8c68ff25
    • Markus Armbruster's avatar
      qapi: Check feature documentation against the schema · e151941d
      Markus Armbruster authored
      
      Commit f3ed93d5 "qapi: Allow documentation for features" neglected
      to check documentation against the schema.  Fix that: check them the
      same way we check arguments.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-20-armbru@redhat.com>
      e151941d
    • Markus Armbruster's avatar
      qapi: Polish reporting of bogus member documentation · e4def787
      Markus Armbruster authored
      
      Improve error messages from
      
          the following documented members are not in the declaration: a
          the following documented members are not in the declaration: aa, bb
      
      to the more concise
      
          documented member 'a' does not exist
          documented members 'aa', 'bb' do not exist
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-19-armbru@redhat.com>
      e4def787
    • Markus Armbruster's avatar
      qapi: Lift features into QAPISchemaEntity · b3cdff10
      Markus Armbruster authored
      
      Commit 6a8c0b51 "qapi: Add feature flags to struct types" added
      features to QAPISchemaObjectType.  Commit a95daa5093 "qapi: Add
      feature flags to commands in qapi" added them to QAPISchemaCommand,
      duplicating the code.  Tolerable, but the duplication will only get
      worse as we add features to more definitions.
      
      To de-duplicate, lift features from QAPISchemaObjectType and
      QAPISchemaCommand into QAPISchemaEntity.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-18-armbru@redhat.com>
      b3cdff10
    • Markus Armbruster's avatar
      qapi: Fold normalize_enum() into check_enum() · ad1ecfc6
      Markus Armbruster authored
      
      check_features() is always called together with normalize_features().
      Fold the latter into the former.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-17-armbru@redhat.com>
      ad1ecfc6
    • Markus Armbruster's avatar
      qapi: Fold normalize_features() into check_features() · 2ce51ef6
      Markus Armbruster authored
      
      check_features() is always called together with normalize_features():
      the former in check_struct() and check_command(), the latter in their
      caller check_exprs().  Fold the latter into the former.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-16-armbru@redhat.com>
      2ce51ef6
    • Markus Armbruster's avatar
      qapi: Fold normalize_if() into check_if() · c145bfda
      Markus Armbruster authored
      
      check_if() is always called together with normalize_if().  Fold the
      latter into the former.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-15-armbru@redhat.com>
      c145bfda
    • Markus Armbruster's avatar
      qapi: Eliminate .check_doc() overrides · 1192a486
      Markus Armbruster authored
      
      All sub-classes of QAPISchemaEntity now override .check_doc() the same
      way, except for QAPISchemaType and and QAPISchemaArrayType.
      
      Put the overrides' code in QAPISchemaEntity.check_doc(), and drop the
      overrides.  QAPISchemaType doesn't care because it's abstract.
      QAPISchemaArrayType doesn't care because its .doc is always None.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-14-armbru@redhat.com>
      1192a486
    • Markus Armbruster's avatar
      qapi: Simplify ._make_implicit_object_type() · a710e1c8
      Markus Armbruster authored
      
      All callers now pass doc=None.  Drop the argument.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-13-armbru@redhat.com>
      a710e1c8
    • Markus Armbruster's avatar
      qapi: Fix doc comment checking for commands and events · bf83f04e
      Markus Armbruster authored
      
      When a command's 'data' is an object, its doc comment describes the
      arguments defined there.  When 'data' names a type, the doc comment
      does not describe arguments.  Instead, the doc generator inserts a
      pointer to the named type.
      
      An event's doc comment works the same.
      
      We don't actually check doc comments for commands and events.
      Instead, QAPISchema._def_command() forwards the doc comment to the
      implicit argument type, where it gets checked.  Works because the
      check only cares for the implicit argument type's members.
      
      Not only is this needlessly hard to understand, it actually falls
      apart in two cases:
      
      * When 'data' is empty, there is nothing to forward to, and the doc
        comment remains unchecked.  Demonstrated by test doc-bad-event-arg.
      
      * When 'data' names a type, we can't forward, as the type has its own
        doc comment.  The command or event's doc comment remains unchecked.
        Demonstrated by test doc-bad-boxed-command-arg.
      
      The forwarding goes back to commit 069fb5b2 "qapi: Prepare for
      requiring more complete documentation", put to use in commit
      816a57cd "qapi: Fix detection of bogus member documentation".  That
      fix was incomplete.
      
      To fix this, make QAPISchemaCommand and QAPISchemaEvent check doc
      comments, and drop the forwarding of doc comments to implicit argument
      types.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-12-armbru@redhat.com>
      bf83f04e
    • Markus Armbruster's avatar
      qapi: Clean up doc comment checking for implicit union base · 7faefad1
      Markus Armbruster authored
      
      An object type's doc comment describes the type's members, less the
      ones defined in a named base type.  Cases:
      
      * Struct: the members are defined in 'data' and inherited from 'base'.
        Since the base type cannot be implicit, the doc comment describes
        just 'data'.
      
      * Simple union: the only member is the implicit tag member @type, and
        the doc comment describes it.
      
      * Flat union with implicit base type: the members are defined in
        'base', and the doc comment describes it.
      
      * Flat union with named base type: the members are inherited from
        'base'.  The doc comment describes no members.
      
      Before we can check a doc comment with .check_doc(), we need
      .connect_doc() connect each of its "argument sections" to the member
      it documents.
      
      For structs and simple unions, this is straightforward: the members in
      question are in .local_members, and .connect_doc() connects them.
      
      For flat unions with a named base type, it's trivial: .local_members
      is empty, and .connect_doc() does nothing.
      
      For flat unions with an implicit base type, it's tricky.  We have
      QAPISchema._make_implicit_object_type() forward the union's doc
      comment to the implicit base type, so that the base type's
      .connect_doc() connects the members.  The union's .connect_doc() does
      nothing, as .local_members is empty.
      
      Dirt effect: we check the doc comment twice, once for the union type,
      and once for the implicit base type.
      
      This is needlessly brittle and hard to understand.  Clean up as
      follows.  Make the union's .connect_doc() connect an implicit base's
      members itself.  Do not forward the union's doc comment to its
      implicit base type.
      
      Requires extending .connect_doc() so it can work with a doc comment
      other than self.doc.  Add an optional argument for that.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-11-armbru@redhat.com>
      7faefad1
    • Markus Armbruster's avatar
      qapi: Fix enum doc comment checking · 36a43905
      Markus Armbruster authored
      
      Enumeration type documentation comments are not checked, as
      demonstrated by test doc-bad-enum-member.  This is because we neglect
      to call self.doc.check() for enumeration types.  Messed up in
      816a57cd "qapi: Fix detection of bogus member documentation".  Fix
      it.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-10-armbru@redhat.com>
      36a43905
    • Markus Armbruster's avatar
      qapi: Split .connect_doc(), .check_doc() off .check() · ee1e6a1f
      Markus Armbruster authored
      
      Splitting documentation checking off the .check() methods makes them a
      bit more focused, which is welcome, as some of them are pretty big.
      It also prepares the ground for the following commits.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-9-armbru@redhat.com>
      ee1e6a1f
    • Markus Armbruster's avatar
      qapi: De-duplicate entity documentation generation code · a4bd91d3
      Markus Armbruster authored
      
      QAPISchemaGenDocVisitor.visit_command() duplicates texi_entity() for
      its boxed arguments case.  The previous commit added another copy in
      .visit_event().
      
      Replace texi_entity() by texi_type() and texi_msg().  Use texi_msg()
      for the boxed arguments case as well.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-8-armbru@redhat.com>
      a4bd91d3
    • Markus Armbruster's avatar
      qapi: Implement boxed event argument documentation · b621a260
      Markus Armbruster authored
      
      Generate a reference "Arguments: the members of ...", just like we do
      for commands since commit c2dd311c "qapi2texi: Implement boxed
      argument documentation".
      
      No change to generated QMP documentation; we don't yet use boxed
      events outside tests/.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-7-armbru@redhat.com>
      b621a260
    • Markus Armbruster's avatar
      qemu-doc: Belatedly document QMP command deprecation · 6d570ca1
      Markus Armbruster authored
      
      Commit 24fb4133 "qmp: Introduce blockdev-change-medium" (v2.5.0)
      deprecated change.
      
      Commit 2ff30257 "migrate: move max-bandwidth and downtime-limit to
      migrate_set_parameter" (v2.8.0) deprecated migrate_set_downtime and
      migrate_set_speed.
      
      These wre missed in commit eb22aeca "docs: document deprecation
      policy & deprecated features in appendix" (v2.10.0).
      
      Commit 73af8dd8 "migration: Make xbzrle_cache_size a migration
      parameter" (v2.11.0) deprecated migrate-set-cache-size and
      query-migrate-cache-size, but neglected to update qemu-doc.
      
      Make up for that.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-6-armbru@redhat.com>
      6d570ca1
    • Markus Armbruster's avatar
      tests/qapi-schema: Fix feature documentation testing · a0418a4a
      Markus Armbruster authored
      
      Commit 8aa3a33e "tests/qapi-schema: Test for good feature lists in
      structs" made test-qapi.py show features, but neglected to show their
      documentation.  Fix that.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-5-armbru@redhat.com>
      a0418a4a
    • Markus Armbruster's avatar
      tests/qapi-schema: Cover alternate documentation comments · f6401deb
      Markus Armbruster authored
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-4-armbru@redhat.com>
      f6401deb
    • Markus Armbruster's avatar
      tests/qapi-schema: Demonstrate command and event doc comment bugs · 717cfcfa
      Markus Armbruster authored
      
      Add negative tests doc-bad-boxed-command-arg and doc-bad-event-arg to
      cover boxed and no arguments.  They demonstrate insufficient doc
      comment checking.
      
      Update positive test doc-good to cover boxed event arguments.  It
      demonstrates the generated doc comment misses arguments.
      
      These bugs will be fixed later in this series.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-3-armbru@redhat.com>
      717cfcfa
    • Markus Armbruster's avatar
      tests/qapi-schema: Demonstrate feature and enum doc comment bugs · f035b47e
      Markus Armbruster authored
      
      Add negative tests doc-bad-enum-member and doc-bad-feature to cover
      documentation for nonexistent enum members and features, and test
      doc-undoc-feature to cover features lacking documentation.  None of
      them works.  To be fixed later in this series.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20191024110237.30963-2-armbru@redhat.com>
      f035b47e
    • Fan Yang's avatar
      COLO-compare: Fix incorrect `if` logic · 1e907a32
      Fan Yang authored
      
      'colo_mark_tcp_pkt' should return 'true' when packets are the same, and
      'false' otherwise.  However, it returns 'true' when
      'colo_compare_packet_payload' returns non-zero while
      'colo_compare_packet_payload' is just a 'memcmp'.  The result is that
      COLO-compare reports inconsistent TCP packets when they are actually
      the same.
      
      Fixes: f449c9e5 ("colo: compare the packet based on the tcp sequence number")
      Cc: qemu-stable@nongnu.org
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Signed-off-by: default avatarFan Yang <Fan_Yang@sjtu.edu.cn>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      1e907a32
    • Mikhail Sennikovsky's avatar
      virtio-net: prevent offloads reset on migration · 7788c3f2
      Mikhail Sennikovsky authored
      
      Currently offloads disabled by guest via the VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET
      command are not preserved on VM migration.
      Instead all offloads reported by guest features (via VIRTIO_PCI_GUEST_FEATURES)
      get enabled.
      What happens is: first the VirtIONet::curr_guest_offloads gets restored and offloads
      are getting set correctly:
      
       #0  qemu_set_offload (nc=0x555556a11400, csum=1, tso4=0, tso6=0, ecn=0, ufo=0) at net/net.c:474
       #1  virtio_net_apply_guest_offloads (n=0x555557701ca0) at hw/net/virtio-net.c:720
       #2  virtio_net_post_load_device (opaque=0x555557701ca0, version_id=11) at hw/net/virtio-net.c:2334
       #3  vmstate_load_state (f=0x5555569dc010, vmsd=0x555556577c80 <vmstate_virtio_net_device>, opaque=0x555557701ca0, version_id=11)
           at migration/vmstate.c:168
       #4  virtio_load (vdev=0x555557701ca0, f=0x5555569dc010, version_id=11) at hw/virtio/virtio.c:2197
       #5  virtio_device_get (f=0x5555569dc010, opaque=0x555557701ca0, size=0, field=0x55555668cd00 <__compound_literal.5>) at hw/virtio/virtio.c:2036
       #6  vmstate_load_state (f=0x5555569dc010, vmsd=0x555556577ce0 <vmstate_virtio_net>, opaque=0x555557701ca0, version_id=11) at migration/vmstate.c:143
       #7  vmstate_load (f=0x5555569dc010, se=0x5555578189e0) at migration/savevm.c:829
       #8  qemu_loadvm_section_start_full (f=0x5555569dc010, mis=0x5555569eee20) at migration/savevm.c:2211
       #9  qemu_loadvm_state_main (f=0x5555569dc010, mis=0x5555569eee20) at migration/savevm.c:2395
       #10 qemu_loadvm_state (f=0x5555569dc010) at migration/savevm.c:2467
       #11 process_incoming_migration_co (opaque=0x0) at migration/migration.c:449
      
      However later on the features are getting restored, and offloads get reset to
      everything supported by features:
      
       #0  qemu_set_offload (nc=0x555556a11400, csum=1, tso4=1, tso6=1, ecn=0, ufo=0) at net/net.c:474
       #1  virtio_net_apply_guest_offloads (n=0x555557701ca0) at hw/net/virtio-net.c:720
       #2  virtio_net_set_features (vdev=0x555557701ca0, features=5104441767) at hw/net/virtio-net.c:773
       #3  virtio_set_features_nocheck (vdev=0x555557701ca0, val=5104441767) at hw/virtio/virtio.c:2052
       #4  virtio_load (vdev=0x555557701ca0, f=0x5555569dc010, version_id=11) at hw/virtio/virtio.c:2220
       #5  virtio_device_get (f=0x5555569dc010, opaque=0x555557701ca0, size=0, field=0x55555668cd00 <__compound_literal.5>) at hw/virtio/virtio.c:2036
       #6  vmstate_load_state (f=0x5555569dc010, vmsd=0x555556577ce0 <vmstate_virtio_net>, opaque=0x555557701ca0, version_id=11) at migration/vmstate.c:143
       #7  vmstate_load (f=0x5555569dc010, se=0x5555578189e0) at migration/savevm.c:829
       #8  qemu_loadvm_section_start_full (f=0x5555569dc010, mis=0x5555569eee20) at migration/savevm.c:2211
       #9  qemu_loadvm_state_main (f=0x5555569dc010, mis=0x5555569eee20) at migration/savevm.c:2395
       #10 qemu_loadvm_state (f=0x5555569dc010) at migration/savevm.c:2467
       #11 process_incoming_migration_co (opaque=0x0) at migration/migration.c:449
      
      Fix this by preserving the state in saved_guest_offloads field and
      pushing out offload initialization to the new post load hook.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: default avatarMikhail Sennikovsky <mikhail.sennikovskii@cloud.ionos.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      7788c3f2
    • Michael S. Tsirkin's avatar
      virtio: new post_load hook · 1dd71383
      Michael S. Tsirkin authored
      
      Post load hook in virtio vmsd is called early while device is processed,
      and when VirtIODevice core isn't fully initialized.  Most device
      specific code isn't ready to deal with a device in such state, and
      behaves weirdly.
      
      Add a new post_load hook in a device class instead.  Devices should use
      this unless they specifically want to verify the migration stream as
      it's processed, e.g. for bounds checking.
      
      Cc: qemu-stable@nongnu.org
      Suggested-by: default avatar"Dr. David Alan Gilbert" <dgilbert@redhat.com>
      Cc: Mikhail Sennikovsky <mikhail.sennikovskii@cloud.ionos.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      1dd71383
    • Sven Schnelle's avatar
      net: add tulip (dec21143) driver · 34ea023d
      Sven Schnelle authored
      
      This adds the basic functionality to emulate a Tulip NIC.
      
      Implemented are:
      
      - RX and TX functionality
      - Perfect Frame Filtering
      - Big/Little Endian descriptor support
      - 93C46 EEPROM support
      - LXT970 PHY
      
      Not implemented, mostly because i had no OS using these functions:
      
      - Imperfect frame filtering
      - General Purpose Timer
      - Transmit automatic polling
      - Boot ROM support
      - SIA interface
      - Big/Little Endian data buffer conversion
      
      Successfully tested with the following Operating Systems:
      
      - MSDOS with Microsoft Network Client 3.0 and DEC ODI drivers
      - HPPA Linux
      - Windows XP
      - HP-UX
      
      Signed-off-by: default avatarSven Schnelle <svens@stackframe.org>
      Message-Id: <20191022155413.4619-1-svens@stackframe.org>
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      34ea023d
  2. Oct 28, 2019
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/palmer/tags/riscv-for-master-4.2-sf2' into staging · b13197b1
      Peter Maydell authored
      
      RISC-V Patches for the 4.2 Soft Freeze, Part 2
      
      This patch set contains a handful of small fixes for RISC-V targets that
      I'd like to target for the 4.2 soft freeze.  They include:
      
      * A fix to allow the debugger to access the state of all privilege
        modes, as opposed to just the currently executing one.
      * A pair of cleanups to implement cpu_do_transaction_failed.
      * Fixes to the device tree.
      * The addition of various memory regions to make the sifive_u machine
        more closely match the HiFive Unleashed board.
      * Fixes to our GDB interface to allow CSRs to be accessed.
      * A fix to a memory leak pointed out by coverity.
      * A fix that prevents PMP checks from firing incorrectly.
      
      This passes "make chcek" and boots Open Embedded for me.
      
      # gpg: Signature made Mon 28 Oct 2019 15:47:52 GMT
      # gpg:                using RSA key 00CE76D1834960DFCE886DF8EF4CA1502CCBAB41
      # gpg:                issuer "palmer@dabbelt.com"
      # gpg: Good signature from "Palmer Dabbelt <palmer@dabbelt.com>" [unknown]
      # gpg:                 aka "Palmer Dabbelt <palmer@sifive.com>" [unknown]
      # gpg: WARNING: This key is not certified with a trusted signature!
      # gpg:          There is no indication that the signature belongs to the owner.
      # Primary key fingerprint: 00CE 76D1 8349 60DF CE88  6DF8 EF4C A150 2CCB AB41
      
      * remotes/palmer/tags/riscv-for-master-4.2-sf2:
        target/riscv: PMP violation due to wrong size parameter
        riscv/boot: Fix possible memory leak
        target/riscv: Make the priv register writable by GDB
        target/riscv: Expose "priv" register for GDB for reads
        target/riscv: Tell gdbstub the correct number of CSRs
        riscv/virt: Jump to pflash if specified
        riscv/virt: Add the PFlash CFI01 device
        riscv/virt: Manually define the machine
        riscv/sifive_u: Add the start-in-flash property
        riscv/sifive_u: Manually define the machine
        riscv/sifive_u: Add QSPI memory region
        riscv/sifive_u: Add L2-LIM cache memory
        linux-user/riscv: Propagate fault address
        riscv: sifive_u: Add ethernet0 to the aliases node
        riscv: hw: Drop "clock-frequency" property of cpu nodes
        RISC-V: Implement cpu_do_transaction_failed
        RISC-V: Handle bus errors in the page table walker
        riscv: Skip checking CSR privilege level in debugger mode
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      b13197b1
    • Philippe Mathieu-Daudé's avatar
      BootLinuxConsoleTest: Test the Quadra 800 · f7d85525
      Philippe Mathieu-Daudé authored
      
      This test boots a Linux kernel on a Quadra 800 board
      and verify the serial is working.
      
      Example:
      
        $ avocado --show=app,console run -t machine:q800 tests/acceptance/boot_linux_console.py
        console: ABCFGHIJK
        console: Linux version 5.2.0-2-m68k (debian-kernel@lists.debian.org) (gcc version 8.3.0 (Debian 8.3.0-21)) #1 Debian 5.2.9-2 (2019-08-21)
        console: Detected Macintosh model: 35
        console: Apple Macintosh Quadra 800
        console: Built 1 zonelists, mobility grouping on.  Total pages: 32448
        console: Kernel command line: printk.time=0 console=ttyS0 vga=off
        [...]
        console: Calibrating delay loop... 1236.99 BogoMIPS (lpj=6184960)
        [...]
        console: NuBus: Scanning NuBus slots.
        console: Slot 9: Board resource not found!
        console: SCSI subsystem initialized
        console: clocksource: Switched to clocksource via1
        [...]
        console: macfb: framebuffer at 0xf9001000, mapped to 0x(ptrval), size 468k
        console: macfb: mode is 800x600x8, linelength=800
        console: Console: switching to colour frame buffer device 100x37
        console: fb0: DAFB frame buffer device
        console: pmac_zilog: 0.6 (Benjamin Herrenschmidt <benh@kernel.crashing.org>)
        console: scc.0: ttyS0 at MMIO 0x50f0c022 (irq = 4, base_baud = 230400) is a Z85c30 ESCC - Serial port
        console: scc.1: ttyS1 at MMIO 0x50f0c020 (irq = 4, base_baud = 230400) is a Z85c30 ESCC - Serial port
        console: Non-volatile memory driver v1.3
        console: adb: Mac II ADB Driver v1.0 for Unified ADB
        console: mousedev: PS/2 mouse device common for all mice
        console: random: fast init done
        console: Detected ADB keyboard, type <unknown>.
        console: input: ADB keyboard as /devices/virtual/input/input0
        console: input: ADB mouse as /devices/virtual/input/input1
        console: rtc-generic rtc-generic: registered as rtc0
        console: ledtrig-cpu: registered to indicate activity on CPUs
        [...]
        console: rtc-generic rtc-generic: setting system clock to 2019-09-10T16:20:25 UTC (1568132425)
        console: List of all partitions:
        console: No filesystem could mount root, tried:
        JOB TIME   : 2.91 s
      
      Signed-off-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Reviewed-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Tested-by: default avatarCleber Rosa <crosa@redhat.com>
      Reviewed-by: default avatarCleber Rosa <crosa@redhat.com>
      Message-Id: <20190910163430.11326-1-f4bug@amsat.org>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Message-Id: <20191026164546.30020-12-laurent@vivier.eu>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      f7d85525
    • Laurent Vivier's avatar
      hw/m68k: define Macintosh Quadra 800 · 04e7ca8d
      Laurent Vivier authored
      
      If you want to test the machine, it doesn't yet boot a MacROM, but you can
      boot a linux kernel from the command line.
      
      You can install your own disk using debian-installer with:
      
          ./qemu-system-m68k \
          -M q800 \
          -serial none -serial mon:stdio \
          -m 1000M -drive file=m68k.qcow2,format=qcow2 \
          -net nic,model=dp83932,addr=09:00:07:12:34:57 \
          -append "console=ttyS0 vga=off" \
          -kernel vmlinux-4.15.0-2-m68k \
          -initrd initrd.gz \
          -drive file=debian-9.0-m68k-NETINST-1.iso \
          -drive file=m68k.qcow2,format=qcow2 \
          -nographic
      
      If you use a graphic adapter instead of "-nographic", you can use "-g"
      to set the size of the display (I use "-g 1600x800x24").
      
      Tested-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
      Co-developed-by: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Signed-off-by: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Message-Id: <20191026164546.30020-11-laurent@vivier.eu>
      04e7ca8d
    • Laurent Vivier's avatar
      hw/m68k: add a dummy SWIM floppy controller · c701ec62
      Laurent Vivier authored
      
      SWIM (Sander-Wozniak Integrated Machine) is the floppy controller of
      the 680x0 Macintosh.
      
      This patch introduces only the basic support: it allows to switch from
      IWM (Integrated WOZ Machine) mode to the SWIM mode and makes the linux
      driver happy.
      
      It cannot read any floppy image.
      
      Co-developed-by: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Signed-off-by: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Reviewed-by: default avatarHervé Poussineau <hpoussin@reactos.org>
      Message-Id: <20191026164546.30020-10-laurent@vivier.eu>
      c701ec62
    • Laurent Vivier's avatar
      hw/m68k: add Nubus macfb video card · 8ac919a0
      Laurent Vivier authored
      
      This patch adds support for a graphic framebuffer device.
      This device can be added as a sysbus device or as a NuBus device.
      
      It is accessed as a framebuffer but the color palette can be set.
      
      Co-developed-by: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Signed-off-by: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Reviewed-by: default avatarHervé Poussineau <hpoussin@reactos.org>
      Reviewed-by: default avatarThomas Huth <huth@tuxfamily.org>
      Message-Id: <20191026164546.30020-9-laurent@vivier.eu>
      8ac919a0
    • Laurent Vivier's avatar
      hw/m68k: add Nubus support · fa2ba3b8
      Laurent Vivier authored
      
      This patch adds basic support for the NuBus bus. This is used by 680x0
      Macintosh.
      
      Co-developed-by: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Signed-off-by: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Reviewed-by: default avatarThomas Huth <huth@tuxfamily.org>
      Message-Id: <20191026164546.30020-8-laurent@vivier.eu>
      fa2ba3b8
    • Laurent Vivier's avatar
      hw/m68k: implement ADB bus support for via · 87a34e2a
      Laurent Vivier authored
      
      VIA needs to be able to poll the ADB interface and to read/write data
      from/to the bus.
      
      This patch adds functions allowing that.
      
      Co-developed-by: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Signed-off-by: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Signed-off-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Reviewed-by: default avatarHervé Poussineau <hpoussin@reactos.org>
      Reviewed-by: default avatarThomas Huth <huth@tuxfamily.org>
      Message-Id: <20191026164546.30020-7-laurent@vivier.eu>
      87a34e2a
Loading