Skip to content
Snippets Groups Projects
  1. Nov 23, 2022
  2. Nov 22, 2022
  3. Nov 21, 2022
    • Stefan Hajnoczi's avatar
      rtl8139: honor large send MSS value · 6d71357a
      Stefan Hajnoczi authored
      The Large-Send Task Offload Tx Descriptor (9.2.1 Transmit) has a
      Large-Send MSS value where the driver specifies the MSS. See the
      datasheet here:
      http://realtek.info/pdf/rtl8139cp.pdf
      
      The code ignores this value and uses a hardcoded MSS of 1500 bytes
      instead. When the MTU is less than 1500 bytes the hardcoded value
      results in IP fragmentation and poor performance.
      
      Use the Large-Send MSS value to correctly size Large-Send packets.
      
      Jason Wang <jasowang@redhat.com> noticed that the Large-Send MSS value
      mask was incorrect so it is adjusted to match the datasheet and Linux
      8139cp driver.
      
      This issue was discussed in the past here:
      https://lore.kernel.org/all/20161114162505.GD26664@stefanha-x1.localdomain/
      
      
      
      Reported-by: default avatarRussell King - ARM Linux <linux@armlinux.org.uk>
      Reported-by: default avatarTobias Fiebig <tobias+git@fiebig.nl>
      Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1312
      
      
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Message-Id: <20221117165554.1773409-4-stefanha@redhat.com>
      6d71357a
    • Stefan Hajnoczi's avatar
      rtl8139: keep Tx command mode 0 and 1 separate · c74831a0
      Stefan Hajnoczi authored
      
      There are two Tx Descriptor formats called mode 0 and mode 1. The mode
      is determined by the Large Send bit.
      
      CP_TX_IPCS (bit 18) is defined in mode 1 but the code checks the bit
      unconditionally. In mode 0 bit 18 is part of the Large Send MSS value.
      
      Explicitly check the Large Send bit to distinguish Tx command modes.
      This avoids bugs where modes are confused. Note that I didn't find any
      actual bugs aside from needlessly computing the IP checksum when the
      Large Send bit is enabled.
      
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Message-Id: <20221117165554.1773409-3-stefanha@redhat.com>
      c74831a0
    • Stefan Hajnoczi's avatar
      rtl8139: avoid clobbering tx descriptor bits · bd142b23
      Stefan Hajnoczi authored
      
      The device turns the Tx Descriptor into a Tx Status descriptor after
      fully reading the descriptor. This involves clearing Tx Own (bit 31) to
      indicate that the driver has ownership of the descriptor again as well
      as several other bits.
      
      The code keeps the first dword of the Tx Descriptor in the txdw0 local
      variable. txdw0 is reused to build the first word of the Tx Status
      descriptor. Later on the code uses txdw0 again, incorrectly assuming
      that it still contains the first dword of the Tx Descriptor. The tx
      offloading code misbehaves because it sees bogus bits in txdw0.
      
      Use a separate local variable for Tx Status and preserve Tx Descriptor
      in txdw0.
      
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Message-Id: <20221117165554.1773409-2-stefanha@redhat.com>
      bd142b23
    • Stefan Hajnoczi's avatar
      Merge tag 'pull-target-arm-20221121' of... · 0b710ae5
      Stefan Hajnoczi authored
      Merge tag 'pull-target-arm-20221121' of https://git.linaro.org/people/pmaydell/qemu-arm into staging
      
      target-arm queue:
       * hw/sd: Fix sun4i allwinner-sdhost for U-Boot
       * hw/intc: add implementation of GICD_IIDR to Arm GIC
       * tests/avocado/boot_linux.py: Bump aarch64 virt test timeout
       * target/arm: Limit LPA2 effective output address when TCR.DS == 0
      
      # -----BEGIN PGP SIGNATURE-----
      #
      # iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmN7disZHHBldGVyLm1h
      # eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3i8sEACcJmCKplkJ3KlBqBCXdldF
      # pNQde6fIAEvUtFGkPr8OLFixIp13aLlw3/7sieHl6o76GMw1u26kd/qTykypID/T
      # j3rxZC7ospo2j3MfLLy0TiG/fwzCwa6G0SIdKUOjkwX52IgWE/gUlvtjJvtLcNEN
      # nta2dm5PWcF6fxDZwdYUGo3akwi8qbIlBxUeQR3VTUzXC+7F22pDzA8lp8QpHeW0
      # inaLNtlEbRc5+rnOuwhOK5mnYiTwTN40vEz89v940Ii/CIFmPOAmx2rxsrmnVbLq
      # uGqzXoN4OMurl2gco7LUMS2mshVBfpVOyZqaaXn/3dXkQ/W1fN37iCZF8Z2E8P2M
      # YvcdxgYWoFmP7mlr9S1k4RgQTGVRS9j6XviGi62Zra2enNx5769JUhJFifQBYqLA
      # V3FcizuHqUKsItJtGMO3gXR02BEE53o8c6WJ18uflTNVaY9wZ5MDqgGw/hKmfWLS
      # /mjFdwwTbW7IZ0beW3pl9szXAduhGNoegTsfkn9xrANa62Jx1GSs/G0+mdSnA9oL
      # 1YB2EDidiTlizbrn0aK+Lgls5/FG9qP+ReY7GhW2ZYvPuKesja6BJEAyEW6Xg3Sj
      # D70L8/AzZtn8AHu/aKotLZ6UHVTNxFg4AHwte9fJYrZe72e6aR+8XQaCBPz47pi8
      # NHAnGWWc28SdNCau7I8uMg==
      # =0yEm
      # -----END PGP SIGNATURE-----
      # gpg: Signature made Mon 21 Nov 2022 07:59:23 EST
      # gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
      # gpg:                issuer "peter.maydell@linaro.org"
      # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [full]
      # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [full]
      # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [full]
      # gpg:                 aka "Peter Maydell <peter@archaic.org.uk>" [unknown]
      # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
      
      * tag 'pull-target-arm-20221121' of https://git.linaro.org/people/pmaydell/qemu-arm
      
      :
        target/arm: Limit LPA2 effective output address when TCR.DS == 0
        tests/avocado/boot_linux.py: Bump aarch64 virt test timeout to 720s
        hw/intc: add implementation of GICD_IIDR to Arm GIC
        hw/intc: clean-up access to GIC multi-byte registers
        hw/sd: Fix sun4i allwinner-sdhost for U-Boot
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      0b710ae5
    • Stefan Hajnoczi's avatar
      Merge tag 'next-pull-request' of https://gitlab.com/juan.quintela/qemu into staging · af29446f
      Stefan Hajnoczi authored
      Migration PULL request (take 3)
      
      Hi
      
      Drop everything that is not a bug fix:
      - fixes by peter
      - fix comment on block creation (me)
      - fix return values from qio_channel_block()
      
      Please, apply.
      
      (take 1)
      It includes:
      - Leonardo fix for zero_copy flush
      - Fiona fix for return value of readv/writev
      - Peter Xu cleanups
      - Peter Xu preempt patches
      - Patches ready from zero page (me)
      - AVX2 support (ling)
      - fix for slow networking and reordering of first packets (manish)
      
      Please, apply.
      
      # -----BEGIN PGP SIGNATURE-----
      #
      # iQIzBAABCAAdFiEEGJn/jt6/WMzuA0uC9IfvGFhy1yMFAmN7dhUACgkQ9IfvGFhy
      # 1yN0GhAAmpBGFomPXqOhixXcZdCOpFvLVKU13O+okp2NgY9W5Qlicf6ANo0cbvUh
      # VVLCnXToySbP+7TLLqZjT4mVgM6EUIk1xqUXXICJ1mXIznvMnMtnseMNX033E2RL
      # mhIVx+2AsoClWR9AdQVrzvjwR/gmzEa915w1HnHVfLFSPWmIfd9iWvOEenf5SYY5
      # R7yAq0tWohOAtPiyrFAchcyTidW7pB2ZqD85ZEuGQ6EBpPxHM2NZ46NuK52j02k3
      # eKGrKBFAh4QTRf5+QT0ASAGUqxPYM3iT/WOw3FZkZDQoedcReeECgDh1gfdd27iH
      # Rebn+UHThgofBAspFVrJs9rSVlOnDdDp7yY1YDC6s6285Dci9JyWe0raIyvfdBK7
      # h+AtBFLZVkIR0LXu4NlVe4IHnO5t/XVsLPwZ+7SQ9fc3gezAn4kAiEf+m8umTgho
      # n3Jo+2dl52QoMOW2OsX9199g0lorQAby6bJVG4xbq82ijE9N1NHuLe44w9OGZTKg
      # 697cNPDaoSRrvAdCPPh5KaZXsxpfLPxoMlZWxCTsNvs/jCzGs7AnvbU0QHlB+skU
      # R2Ae42QBq6ZSogtN8tNZFPH82Z6xTOJNILtmMgEQGAjLf3yOd8T5gZLsYNujTOyJ
      # ZsahXU0yRTkGmCkzCyr//mGu4KEPWtDOq27QqQPFfayvhr16ECw=
      # =dosb
      # -----END PGP SIGNATURE-----
      # gpg: Signature made Mon 21 Nov 2022 07:59:01 EST
      # gpg:                using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723
      # gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [full]
      # gpg:                 aka "Juan Quintela <quintela@trasno.org>" [full]
      # Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723
      
      * tag 'next-pull-request' of https://gitlab.com/juan.quintela/qemu
      
      :
        migration: Block migration comment or code is wrong
        migration: Disable multifd explicitly with compression
        migration: Use non-atomic ops for clear log bitmap
        migration: Disallow postcopy preempt to be used with compress
        migration: Fix race on qemu_file_shutdown()
        migration: Fix possible infinite loop of ram save process
        migration/multifd/zero-copy: Create helper function for flushing
        migration/channel-block: fix return value for qio_channel_block_{readv,writev}
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      af29446f
    • Stefan Hajnoczi's avatar
      Merge tag 'chr-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging · 050143bf
      Stefan Hajnoczi authored
      chardev fixes
      
      # -----BEGIN PGP SIGNATURE-----
      #
      # iQJQBAABCAA6FiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmN7KeQcHG1hcmNhbmRy
      # ZS5sdXJlYXVAcmVkaGF0LmNvbQAKCRDa6OEJdZac5TSbD/4vqW5PGyXZw2q9h46S
      # TuQ76IxPdN81j5dZg6wt+yq8XTTDGnufYTE8WLA3b9zCQCEJbPXbS7d1Zrx9gJrW
      # UuRC19p6b9FR9iU4w/SKWN/XKUpmM+3qCCwad1N/Rn3I2cRU1YsWFR6hL1L7IQLA
      # 3LEImZIPKBWQ2Sf2mgYmxlmO+xMuAxPefQ1/t/62yKjYrFzWkjIduKO1oUXfFlE2
      # GYrz5x1+AaZ00GOnOJpvEBZdqZEVePIrd/AJAPTrmdRjiZWbq93a0ss5nZq2OT2V
      # 25QG+CXzBht8gDAXZ9aIrFP5muarCuHrz5dvuTAkcGa+SfgkXiFovb7Mp2OE2nef
      # COP4emq50WJWUM8+k2W9jc93Rg27tQhXt3JC9v8Cm6mgs00QZpCvPB/EhhEa46fz
      # Gq/+g084Urb2JnTX2g/eog6+yboLsXhAq/Ke3FT7gzsD/JwkawnG5LG8gmEztnzG
      # yjlX5HLsgS7dhg9BAfM2d3oVQM4Y1G8O8Xr3dfGQocRS3AYTHMw69AeIfxPb4Ax9
      # 1vd+viS+dtabGpDYmKyT58ZVFOREYtTPTcU2ym5CxbR+B6DDUXwMhM7CESXwB96R
      # +iv2La5g7HbXemgUWa54/HqIGJtgJAEHWdgcZ6mzYMtyGAJL7YC7I/Yx93M1A21G
      # o5BpcgZ2ZzbUot6vISs2r4SE2A==
      # =AcEH
      # -----END PGP SIGNATURE-----
      # gpg: Signature made Mon 21 Nov 2022 02:33:56 EST
      # gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
      # gpg:                issuer "marcandre.lureau@redhat.com"
      # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
      # gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
      # Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5
      
      * tag 'chr-pull-request' of https://gitlab.com/marcandre.lureau/qemu
      
      :
        chardev/char-win-stdio: Pass Ctrl+C to guest with a multiplexed monitor
      
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      050143bf
    • Ard Biesheuvel's avatar
      target/arm: Limit LPA2 effective output address when TCR.DS == 0 · 312b71ab
      Ard Biesheuvel authored
      
      With LPA2, the effective output address size is at most 48 bits when
      TCR.DS == 0. This case is currently unhandled in the page table walker,
      where we happily assume LVA/64k granule when outputsize > 48 and
      param.ds == 0, resulting in the wrong conversion to be used from a
      page table descriptor to a physical address.
      
          if (outputsize > 48) {
              if (param.ds) {
                  descaddr |= extract64(descriptor, 8, 2) << 50;
              } else {
                  descaddr |= extract64(descriptor, 12, 4) << 48;
              }
      
      So cap the outputsize to 48 when TCR.DS is cleared, as per the
      architecture.
      
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Philippe Mathieu-Daudé <f4bug@amsat.org>
      Cc: Richard Henderson <richard.henderson@linaro.org>
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20221116170316.259695-1-ardb@kernel.org
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      312b71ab
    • Peter Maydell's avatar
      tests/avocado/boot_linux.py: Bump aarch64 virt test timeout to 720s · c4462523
      Peter Maydell authored
      
      The two tests
      tests/avocado/boot_linux.py:BootLinuxAarch64.test_virt_tcg_gicv2
      tests/avocado/boot_linux.py:BootLinuxAarch64.test_virt_tcg_gicv3
      
      take quite a long time to run, and the current timeout of 240s
      is not enough for the tests to complete on slow machines:
      we've seen these tests time out in the gitlab CI in the
      'avocado-system-alpine' CI job, for instance. The timeout
      is also insufficient for running the test with a debug build
      of QEMU: on my machine the tests take over 10 minutes to run
      in that config.
      
      Push the timeout up to 720s so that the test definitely has
      enough time to complete.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      c4462523
    • Alex Bennée's avatar
      hw/intc: add implementation of GICD_IIDR to Arm GIC · 3d5af538
      Alex Bennée authored
      
      a66a2458 (hw/intc/arm_gic: Implement read of GICC_IIDR) implemented
      this for the CPU interface register. The fact we don't implement it
      shows up when running Xen with -d guest_error which is definitely
      wrong because the guest is perfectly entitled to read it.
      
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      3d5af538
    • Alex Bennée's avatar
      hw/intc: clean-up access to GIC multi-byte registers · 69e7e60d
      Alex Bennée authored
      
      gic_dist_readb was returning a word value which just happened to work
      as a result of the way we OR the data together. Lets fix it so only
      the explicit byte is returned for each part of GICD_TYPER. I've
      changed the return type to uint8_t although the overflow is only
      detected with an explicit -Wconversion.
      
      Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      69e7e60d
    • Strahinja Jankovic's avatar
      hw/sd: Fix sun4i allwinner-sdhost for U-Boot · 93e2da36
      Strahinja Jankovic authored
      
      Trying to run U-Boot for Cubieboard (Allwinner A10) fails because it cannot
      access SD card. The problem is that FIFO register in current
      allwinner-sdhost implementation is at the address corresponding to
      Allwinner H3, but not A10.
      Linux kernel is not affected since Linux driver uses DMA access and does
      not use FIFO register for reading/writing.
      
      This patch adds new class parameter `is_sun4i` and based on that
      parameter uses register at offset 0x100 either as FIFO register (if
      sun4i) or as threshold register (if not sun4i; in this case register at
      0x200 is FIFO register).
      
      Tested with U-Boot and Linux kernel image built for Cubieboard and
      OrangePi PC.
      
      Signed-off-by: default avatarStrahinja Jankovic <strahinja.p.jankovic@gmail.com>
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-id: 20221112214900.24152-1-strahinja.p.jankovic@gmail.com
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      93e2da36
Loading