Skip to content
Snippets Groups Projects
  1. Jul 07, 2023
    • Richard Henderson's avatar
      Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging · 3b08e40b
      Richard Henderson authored
      * Granite Rapids CPU model
      * Miscellaneous bugfixes
      
      # -----BEGIN PGP SIGNATURE-----
      #
      # iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmSn7uYUHHBib256aW5p
      # QHJlZGhhdC5jb20ACgkQv/vSX3jHroPi1gf+MJNyMneyyEZgBwlwgs2NYjz+cKwW
      # KxtCOHDfew5S1qpq+gyvUnq5K0JJBGZKoFMwS6JwOpHASGx1o6mlF06CgLAk7wKh
      # yCf1kzvRA4y3tYbSwvxD5iKV3YSsayIHuJ8q2GslVXBtAZ0xC2cREQLzKLNuEV6M
      # rO4bj6QUV2fRc9u9TlurXijsdalUAEjmkIeZhtghhkD+lJo44yzcF7qAROaE3pFa
      # IYEp8pTgcbJeiI0BUNFTRk0OlE5f7MT3GIQwTC34WWPO+r/uBXL5FXNqN38svugh
      # 7hjOliIMU4I6jpL1t7v2+9Vs38gAEPchJ0Nly4TV+dydh7l1pIn9G7ssoA==
      # =OBRZ
      # -----END PGP SIGNATURE-----
      # gpg: Signature made Fri 07 Jul 2023 11:54:30 AM BST
      # gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
      # gpg:                issuer "pbonzini@redhat.com"
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [undefined]
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [undefined]
      # 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: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
      #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
      
      * tag 'for-upstream' of https://gitlab.com/bonzini/qemu
      
      :
        target/i386: Add new CPU model GraniteRapids
        target/i386: Add few security fix bits in ARCH_CAPABILITIES into SapphireRapids CPU model
        target/i386: Add new bit definitions of MSR_IA32_ARCH_CAPABILITIES
        target/i386: Allow MCDT_NO if host supports
        target/i386: Add support for MCDT_NO in CPUID enumeration
        target/i386: Adjust feature level according to FEAT_7_1_EDX
        qemu_cleanup: begin drained section after vm_shutdown()
        meson.build: Remove the logic to link C code with the C++ linker
        python: bump minimum requirements so they are compatible with 3.12
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      3b08e40b
    • Tao Su's avatar
      target/i386: Add new CPU model GraniteRapids · 6d5e9694
      Tao Su authored
      
      The GraniteRapids CPU model mainly adds the following new features
      based on SapphireRapids:
      - PREFETCHITI CPUID.(EAX=7,ECX=1):EDX[bit 14]
      - AMX-FP16 CPUID.(EAX=7,ECX=1):EAX[bit 21]
      
      And adds the following security fix for corresponding vulnerabilities:
      - MCDT_NO CPUID.(EAX=7,ECX=2):EDX[bit 5]
      - SBDR_SSDP_NO MSR_IA32_ARCH_CAPABILITIES[bit 13]
      - FBSDP_NO MSR_IA32_ARCH_CAPABILITIES[bit 14]
      - PSDP_NO MSR_IA32_ARCH_CAPABILITIES[bit 15]
      - PBRSB_NO MSR_IA32_ARCH_CAPABILITIES[bit 24]
      
      Signed-off-by: default avatarTao Su <tao1.su@linux.intel.com>
      Tested-by: default avatarXuelian Guo <xuelian.guo@intel.com>
      Reviewed-by: default avatarXiaoyao Li <xiaoyao.li@intel.com>
      Message-ID: <20230706054949.66556-7-tao1.su@linux.intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      6d5e9694
    • Lei Wang's avatar
      target/i386: Add few security fix bits in ARCH_CAPABILITIES into SapphireRapids CPU model · 3baf7ae6
      Lei Wang authored
      
      SapphireRapids has bit 13, 14 and 15 of MSR_IA32_ARCH_CAPABILITIES
      enabled, which are related to some security fixes.
      
      Add version 2 of SapphireRapids CPU model with those bits enabled also.
      
      Signed-off-by: default avatarLei Wang <lei4.wang@intel.com>
      Signed-off-by: default avatarTao Su <tao1.su@linux.intel.com>
      Message-ID: <20230706054949.66556-6-tao1.su@linux.intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      3baf7ae6
    • Tao Su's avatar
      target/i386: Add new bit definitions of MSR_IA32_ARCH_CAPABILITIES · 6c43ec3b
      Tao Su authored
      
      Currently, bit 13, 14, 15 and 24 of MSR_IA32_ARCH_CAPABILITIES are
      disclosed for fixing security issues, so add those bit definitions.
      
      Signed-off-by: default avatarTao Su <tao1.su@linux.intel.com>
      Reviewed-by: default avatarIgor Mammedov <imammedo@redhat.com>
      Message-ID: <20230706054949.66556-5-tao1.su@linux.intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      6c43ec3b
    • Tao Su's avatar
      target/i386: Allow MCDT_NO if host supports · ba3709fe
      Tao Su authored
      
      MCDT_NO bit indicates HW contains the security fix and doesn't need to
      be mitigated to avoid data-dependent behaviour for certain instructions.
      It needs no hypervisor support. Treat it as supported regardless of what
      KVM reports.
      
      Signed-off-by: default avatarTao Su <tao1.su@linux.intel.com>
      Reviewed-by: default avatarXiaoyao Li <xiaoyao.li@intel.com>
      Message-ID: <20230706054949.66556-4-tao1.su@linux.intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ba3709fe
    • Tao Su's avatar
      target/i386: Add support for MCDT_NO in CPUID enumeration · 9dd8b710
      Tao Su authored
      
      CPUID.(EAX=7,ECX=2):EDX[bit 5] enumerates MCDT_NO. Processors enumerate
      this bit as 1 do not exhibit MXCSR Configuration Dependent Timing (MCDT)
      behavior and do not need to be mitigated to avoid data-dependent behavior
      for certain instructions.
      
      Since MCDT_NO is in a new sub-leaf, add a new CPUID feature word
      FEAT_7_2_EDX. Also update cpuid_level_func7 by FEAT_7_2_EDX.
      
      Signed-off-by: default avatarTao Su <tao1.su@linux.intel.com>
      Reviewed-by: default avatarXiaoyao Li <xiaoyao.li@intel.com>
      Message-ID: <20230706054949.66556-3-tao1.su@linux.intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9dd8b710
    • Tao Su's avatar
      target/i386: Adjust feature level according to FEAT_7_1_EDX · 8731336e
      Tao Su authored
      
      If FEAT_7_1_EAX is 0 and FEAT_7_1_EDX is non-zero, as is the case
      with a Granite Rapids host and
      '-cpu host,-avx-vnni,-avx512-bf16,-fzrm,-fsrs,-fsrc,-amx-fp16', we can't
      get CPUID_7_1 leaf even though CPUID_7_1_EDX has non-zero value.
      
      Update cpuid_level_func7 according to CPUID_7_1_EDX, otherwise
      guest may report wrong maximum number sub-leaves in leaf 07H.
      
      Fixes: eaaa197d ("target/i386: Add support for AVX-VNNI-INT8 in CPUID enumeration")
      Cc: qemu-stable@nongnu.org
      Signed-off-by: default avatarTao Su <tao1.su@linux.intel.com>
      Reviewed-by: default avatarXiaoyao Li <xiaoyao.li@intel.com>
      Message-ID: <20230706054949.66556-2-tao1.su@linux.intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      8731336e
    • Fiona Ebner's avatar
      qemu_cleanup: begin drained section after vm_shutdown() · ca2a5e63
      Fiona Ebner authored
      
      in order to avoid requests being stuck in a BlockBackend's request
      queue during cleanup. Having such requests can lead to a deadlock [0]
      with a virtio-scsi-pci device using iothread that's busy with IO when
      initiating a shutdown with QMP 'quit'.
      
      There is a race where such a queued request can continue sometime
      (maybe after bdrv_child_free()?) during bdrv_root_unref_child() [1].
      The completion will hold the AioContext lock and wait for the BQL
      during SCSI completion, but the main thread will hold the BQL and
      wait for the AioContext as part of bdrv_root_unref_child(), leading to
      the deadlock [0].
      
      [0]:
      
      > Thread 3 (Thread 0x7f3bbd87b700 (LWP 135952) "qemu-system-x86"):
      > #0  __lll_lock_wait (futex=futex@entry=0x564183365f00 <qemu_global_mutex>, private=0) at lowlevellock.c:52
      > #1  0x00007f3bc1c0d843 in __GI___pthread_mutex_lock (mutex=0x564183365f00 <qemu_global_mutex>) at ../nptl/pthread_mutex_lock.c:80
      > #2  0x0000564182939f2e in qemu_mutex_lock_impl (mutex=0x564183365f00 <qemu_global_mutex>, file=0x564182b7f774 "../softmmu/physmem.c", line=2593) at ../util/qemu-thread-posix.c:94
      > #3  0x000056418247cc2a in qemu_mutex_lock_iothread_impl (file=0x564182b7f774 "../softmmu/physmem.c", line=2593) at ../softmmu/cpus.c:504
      > #4  0x00005641826d5325 in prepare_mmio_access (mr=0x5641856148a0) at ../softmmu/physmem.c:2593
      > #5  0x00005641826d6fe7 in address_space_stl_internal (as=0x56418679b310, addr=4276113408, val=16418, attrs=..., result=0x0, endian=DEVICE_LITTLE_ENDIAN) at /home/febner/repos/qemu/memory_ldst.c.inc:318
      > #6  0x00005641826d7154 in address_space_stl_le (as=0x56418679b310, addr=4276113408, val=16418, attrs=..., result=0x0) at /home/febner/repos/qemu/memory_ldst.c.inc:357
      > #7  0x0000564182374b07 in pci_msi_trigger (dev=0x56418679b0d0, msg=...) at ../hw/pci/pci.c:359
      > #8  0x000056418237118b in msi_send_message (dev=0x56418679b0d0, msg=...) at ../hw/pci/msi.c:379
      > #9  0x0000564182372c10 in msix_notify (dev=0x56418679b0d0, vector=8) at ../hw/pci/msix.c:542
      > #10 0x000056418243719c in virtio_pci_notify (d=0x56418679b0d0, vector=8) at ../hw/virtio/virtio-pci.c:77
      > #11 0x00005641826933b0 in virtio_notify_vector (vdev=0x5641867a34a0, vector=8) at ../hw/virtio/virtio.c:1985
      > #12 0x00005641826948d6 in virtio_irq (vq=0x5641867ac078) at ../hw/virtio/virtio.c:2461
      > #13 0x0000564182694978 in virtio_notify (vdev=0x5641867a34a0, vq=0x5641867ac078) at ../hw/virtio/virtio.c:2473
      > #14 0x0000564182665b83 in virtio_scsi_complete_req (req=0x7f3bb000e5d0) at ../hw/scsi/virtio-scsi.c:115
      > #15 0x00005641826670ce in virtio_scsi_complete_cmd_req (req=0x7f3bb000e5d0) at ../hw/scsi/virtio-scsi.c:641
      > #16 0x000056418266736b in virtio_scsi_command_complete (r=0x7f3bb0010560, resid=0) at ../hw/scsi/virtio-scsi.c:712
      > #17 0x000056418239aac6 in scsi_req_complete (req=0x7f3bb0010560, status=2) at ../hw/scsi/scsi-bus.c:1526
      > #18 0x000056418239e090 in scsi_handle_rw_error (r=0x7f3bb0010560, ret=-123, acct_failed=false) at ../hw/scsi/scsi-disk.c:242
      > #19 0x000056418239e13f in scsi_disk_req_check_error (r=0x7f3bb0010560, ret=-123, acct_failed=false) at ../hw/scsi/scsi-disk.c:265
      > #20 0x000056418239e482 in scsi_dma_complete_noio (r=0x7f3bb0010560, ret=-123) at ../hw/scsi/scsi-disk.c:340
      > #21 0x000056418239e5d9 in scsi_dma_complete (opaque=0x7f3bb0010560, ret=-123) at ../hw/scsi/scsi-disk.c:371
      > #22 0x00005641824809ad in dma_complete (dbs=0x7f3bb000d9d0, ret=-123) at ../softmmu/dma-helpers.c:107
      > #23 0x0000564182480a72 in dma_blk_cb (opaque=0x7f3bb000d9d0, ret=-123) at ../softmmu/dma-helpers.c:127
      > #24 0x00005641827bf78a in blk_aio_complete (acb=0x7f3bb00021a0) at ../block/block-backend.c:1563
      > #25 0x00005641827bfa5e in blk_aio_write_entry (opaque=0x7f3bb00021a0) at ../block/block-backend.c:1630
      > #26 0x000056418295638a in coroutine_trampoline (i0=-1342102448, i1=32571) at ../util/coroutine-ucontext.c:177
      > #27 0x00007f3bc0caed40 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
      > #28 0x00007f3bbd8757f0 in ?? ()
      > #29 0x0000000000000000 in ?? ()
      >
      > Thread 1 (Thread 0x7f3bbe3e9280 (LWP 135944) "qemu-system-x86"):
      > #0  __lll_lock_wait (futex=futex@entry=0x5641856f2a00, private=0) at lowlevellock.c:52
      > #1  0x00007f3bc1c0d8d1 in __GI___pthread_mutex_lock (mutex=0x5641856f2a00) at ../nptl/pthread_mutex_lock.c:115
      > #2  0x0000564182939f2e in qemu_mutex_lock_impl (mutex=0x5641856f2a00, file=0x564182c0e319 "../util/async.c", line=728) at ../util/qemu-thread-posix.c:94
      > #3  0x000056418293a140 in qemu_rec_mutex_lock_impl (mutex=0x5641856f2a00, file=0x564182c0e319 "../util/async.c", line=728) at ../util/qemu-thread-posix.c:149
      > #4  0x00005641829532d5 in aio_context_acquire (ctx=0x5641856f29a0) at ../util/async.c:728
      > #5  0x000056418279d5df in bdrv_set_aio_context_commit (opaque=0x5641856e6e50) at ../block.c:7493
      > #6  0x000056418294e288 in tran_commit (tran=0x56418630bfe0) at ../util/transactions.c:87
      > #7  0x000056418279d880 in bdrv_try_change_aio_context (bs=0x5641856f7130, ctx=0x56418548f810, ignore_child=0x0, errp=0x0) at ../block.c:7626
      > #8  0x0000564182793f39 in bdrv_root_unref_child (child=0x5641856f47d0) at ../block.c:3242
      > #9  0x00005641827be137 in blk_remove_bs (blk=0x564185709880) at ../block/block-backend.c:914
      > #10 0x00005641827bd689 in blk_remove_all_bs () at ../block/block-backend.c:583
      > #11 0x0000564182798699 in bdrv_close_all () at ../block.c:5117
      > #12 0x000056418248a5b2 in qemu_cleanup () at ../softmmu/runstate.c:821
      > #13 0x0000564182738603 in qemu_default_main () at ../softmmu/main.c:38
      > #14 0x0000564182738631 in main (argc=30, argv=0x7ffd675a8a48) at ../softmmu/main.c:48
      >
      > (gdb) p *((QemuMutex*)0x5641856f2a00)
      > $1 = {lock = {__data = {__lock = 2, __count = 2, __owner = 135952, ...
      > (gdb) p *((QemuMutex*)0x564183365f00)
      > $2 = {lock = {__data = {__lock = 2, __count = 0, __owner = 135944, ...
      
      [1]:
      
      > Thread 1 "qemu-system-x86" hit Breakpoint 5, bdrv_drain_all_end () at ../block/io.c:551
      > #0  bdrv_drain_all_end () at ../block/io.c:551
      > #1  0x00005569810f0376 in bdrv_graph_wrlock (bs=0x0) at ../block/graph-lock.c:156
      > #2  0x00005569810bd3e0 in bdrv_replace_child_noperm (child=0x556982e2d7d0, new_bs=0x0) at ../block.c:2897
      > #3  0x00005569810bdef2 in bdrv_root_unref_child (child=0x556982e2d7d0) at ../block.c:3227
      > #4  0x00005569810e8137 in blk_remove_bs (blk=0x556982e42880) at ../block/block-backend.c:914
      > #5  0x00005569810e7689 in blk_remove_all_bs () at ../block/block-backend.c:583
      > #6  0x00005569810c2699 in bdrv_close_all () at ../block.c:5117
      > #7  0x0000556980db45b2 in qemu_cleanup () at ../softmmu/runstate.c:821
      > #8  0x0000556981062603 in qemu_default_main () at ../softmmu/main.c:38
      > #9  0x0000556981062631 in main (argc=30, argv=0x7ffd7a82a418) at ../softmmu/main.c:48
      > [Switching to Thread 0x7fe76dab2700 (LWP 103649)]
      >
      > Thread 3 "qemu-system-x86" hit Breakpoint 4, blk_inc_in_flight (blk=0x556982e42880) at ../block/block-backend.c:1505
      > #0  blk_inc_in_flight (blk=0x556982e42880) at ../block/block-backend.c:1505
      > #1  0x00005569810e8f36 in blk_wait_while_drained (blk=0x556982e42880) at ../block/block-backend.c:1312
      > #2  0x00005569810e9231 in blk_co_do_pwritev_part (blk=0x556982e42880, offset=3422961664, bytes=4096, qiov=0x556983028060, qiov_offset=0, flags=0) at ../block/block-backend.c:1402
      > #3  0x00005569810e9a4b in blk_aio_write_entry (opaque=0x556982e2cfa0) at ../block/block-backend.c:1628
      > #4  0x000055698128038a in coroutine_trampoline (i0=-2090057872, i1=21865) at ../util/coroutine-ucontext.c:177
      > #5  0x00007fe770f50d40 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
      > #6  0x00007ffd7a829570 in ?? ()
      > #7  0x0000000000000000 in ?? ()
      
      Signed-off-by: default avatarFiona Ebner <f.ebner@proxmox.com>
      Message-ID: <20230706131418.423713-1-f.ebner@proxmox.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ca2a5e63
    • Thomas Huth's avatar
      meson.build: Remove the logic to link C code with the C++ linker · 785abf0d
      Thomas Huth authored
      
      We are not mixing C++ with C code anymore, the only remaining
      C++ code in qga/vss-win32/ is used for a plain C++ executable.
      Thus we can remove the hacks for linking C code with the C++ linker
      now to simplify meson.build a little bit, and also to avoid that
      some C++ code sneaks in by accident again.
      
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Message-ID: <20230706064736.178962-1-thuth@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      785abf0d
    • Paolo Bonzini's avatar
      python: bump minimum requirements so they are compatible with 3.12 · 3d7b8974
      Paolo Bonzini authored
      
      There are many Python 3.12 issues right now, but a particularly
      problematic one when debugging them is that one cannot even use
      minreqs.txt in a Python 3.12 virtual environment to test with
      locked package versions.
      
      Bump the mypy and wrapt versions to fix this, while remaining
      within the realm of versions compatible with Python 3.7.
      
      This requires a workaround for a mypy false positive
      
          qemu/qmp/qmp_tui.py:350: error: Non-overlapping equality check (left operand type: "Literal[Runstate.DISCONNECTING]", right operand type: "Literal[Runstate.IDLE]")  [comparison-overlap]
      
      where mypy does not realize that self.disconnect() could change
      the value of self.runstate.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      3d7b8974
    • Richard Henderson's avatar
      Merge tag 'net-pull-request' of https://github.com/jasowang/qemu into staging · 4f7c7b40
      Richard Henderson authored
      # -----BEGIN PGP SIGNATURE-----
      # Version: GnuPG v1
      #
      # iQEcBAABAgAGBQJkp86uAAoJEO8Ells5jWIRX00H/1T20eOfMZ+8ZyO32P1DBl5U
      # ZQNl5/rcg5cqjatragwagAHGYzmoegJlY3/JbWju09SPtsgbMT/nQI6EFDfpTHb6
      # 9HB2h+43eHq+OBpmPPsmqVRzjuNi9lUmJ20We4aqJe/VM4/DHMtKW3EXGmORb7cF
      # wjazN5FVn+YQHgA+pckQ79k6h/lJhtLv+MuainS12o8yyCO8OyqP6Bm4lYPbBNpb
      # Im3HXiv05gFuS2P4lD8ZvjcdWalHDzDZW4RzKHlpcic0GBN/rcU3FDqGeOIP8qWL
      # oxokpjd2QmW1rX/TwaweiObEjo/3n7ymRu5PofE3T7e+gnAVfAyqDxrgAU6fMjA=
      # =CGHw
      # -----END PGP SIGNATURE-----
      # gpg: Signature made Fri 07 Jul 2023 09:37:02 AM BST
      # gpg:                using RSA key EF04965B398D6211
      # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" [undefined]
      # 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: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211
      
      * tag 'net-pull-request' of https://github.com/jasowang/qemu
      
      :
        igb: Remove obsolete workaround for Windows
        e1000e: Add ICR clearing by corresponding IMS bit
        net: socket: remove net_init_socket()
        net: socket: move fd type checking to its own function
        net: socket: prepare to cleanup net_init_socket()
        hw/net: ftgmac100: Drop the small packet check in the receive path
        hw/net: sunhme: Remove the logic of padding short frames in the receive path
        hw/net: sungem: Remove the logic of padding short frames in the receive path
        hw/net: rtl8139: Remove the logic of padding short frames in the receive path
        hw/net: pcnet: Remove the logic of padding short frames in the receive path
        hw/net: ne2000: Remove the logic of padding short frames in the receive path
        hw/net: i82596: Remove the logic of padding short frames in the receive path
        hw/net: vmxnet3: Remove the logic of padding short frames in the receive path
        hw/net: e1000: Remove the logic of padding short frames in the receive path
        virtio-net: correctly report maximum tx_queue_size value
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      4f7c7b40
    • Akihiko Odaki's avatar
      igb: Remove obsolete workaround for Windows · da9f7f77
      Akihiko Odaki authored
      
      I confirmed it works with Windows even without this workaround. It is
      likely to be a mistake so remove it.
      
      Fixes: 3a977dee ("Intrdocue igb device emulation")
      Signed-off-by: default avatarAkihiko Odaki <akihiko.odaki@daynix.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      da9f7f77
    • Akihiko Odaki's avatar
      e1000e: Add ICR clearing by corresponding IMS bit · e4142700
      Akihiko Odaki authored
      The datasheet does not say what happens when interrupt was asserted
      (ICR.INT_ASSERT=1) and auto mask is *not* active.
      However, section of 13.3.27 the PCIe* GbE Controllers Open Source
      Software Developer’s Manual, which were written for older devices,
      namely 631xESB/632xESB, 82563EB/82564EB, 82571EB/82572EI &
      82573E/82573V/82573L, does say:
      > If IMS = 0b, then the ICR register is always clear-on-read. If IMS is
      > not 0b, but some ICR bit is set where the corresponding IMS bit is not
      > set, then a read does not clear the ICR register. For example, if
      > IMS = 10101010b and ICR = 01010101b, then a read to the ICR register
      > does not clear it. If IMS = 10101010b and ICR = 0101011b, then a read
      > to the ICR register clears it entirely (ICR.INT_ASSERTED = 1b).
      
      Linux does no longer activate auto mask since commit
      0a8047ac68e50e4ccbadcfc6b6b070805b976885 and the real hardware clears
      ICR even in such a case so we also should do so.
      
      Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1707441
      
      
      Signed-off-by: default avatarAndrew Melnychenko <andrew@daynix.com>
      Signed-off-by: default avatarAkihiko Odaki <akihiko.odaki@daynix.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      e4142700
    • Laurent Vivier's avatar
      net: socket: remove net_init_socket() · b6aeee02
      Laurent Vivier authored
      
      Move the file descriptor type checking before doing anything with it.
      If it's not usable, don't close it as it could be in use by another
      part of QEMU, only fail and report an error.
      
      Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: default avatarLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      b6aeee02
    • Laurent Vivier's avatar
    • Laurent Vivier's avatar
      net: socket: prepare to cleanup net_init_socket() · 006c3fa7
      Laurent Vivier authored
      
      Use directly net_socket_fd_init_stream() and net_socket_fd_init_dgram()
      when the socket type is already known.
      
      Reviewed-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Signed-off-by: default avatarLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      006c3fa7
    • Bin Meng's avatar
      hw/net: ftgmac100: Drop the small packet check in the receive path · 71e11da1
      Bin Meng authored
      
      Now that we have implemented unified short frames padding in the
      QEMU networking codes, the small packet check logic in the receive
      path is no longer needed.
      
      Suggested-by: default avatarCédric Le Goater <clg@kaod.org>
      Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
      Signed-off-by: default avatarBin Meng <bmeng@tinylab.org>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      71e11da1
    • Bin Meng's avatar
      hw/net: sunhme: Remove the logic of padding short frames in the receive path · 0fe0efc9
      Bin Meng authored
      
      Now that we have implemented unified short frames padding in the
      QEMU networking codes, remove the same logic in the NIC codes.
      
      Signed-off-by: default avatarBin Meng <bmeng@tinylab.org>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      0fe0efc9
    • Bin Meng's avatar
      hw/net: sungem: Remove the logic of padding short frames in the receive path · aee87b43
      Bin Meng authored
      
      Now that we have implemented unified short frames padding in the
      QEMU networking codes, remove the same logic in the NIC codes.
      
      Signed-off-by: default avatarBin Meng <bmeng@tinylab.org>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      aee87b43
    • Bin Meng's avatar
      hw/net: rtl8139: Remove the logic of padding short frames in the receive path · 63b901bf
      Bin Meng authored
      
      Now that we have implemented unified short frames padding in the
      QEMU networking codes, remove the same logic in the NIC codes.
      
      Signed-off-by: default avatarBin Meng <bmeng@tinylab.org>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      63b901bf
    • Bin Meng's avatar
      hw/net: pcnet: Remove the logic of padding short frames in the receive path · 6d0d261d
      Bin Meng authored
      
      Now that we have implemented unified short frames padding in the
      QEMU networking codes, remove the same logic in the NIC codes.
      
      Signed-off-by: default avatarBin Meng <bmeng@tinylab.org>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      6d0d261d
    • Bin Meng's avatar
      hw/net: ne2000: Remove the logic of padding short frames in the receive path · 05db4476
      Bin Meng authored
      
      Now that we have implemented unified short frames padding in the
      QEMU networking codes, remove the same logic in the NIC codes.
      
      Signed-off-by: default avatarBin Meng <bmeng@tinylab.org>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      05db4476
    • Bin Meng's avatar
      hw/net: i82596: Remove the logic of padding short frames in the receive path · c58da33f
      Bin Meng authored
      
      Now that we have implemented unified short frames padding in the
      QEMU networking codes, remove the same logic in the NIC codes.
      
      Signed-off-by: default avatarBin Meng <bmeng@tinylab.org>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      c58da33f
    • Bin Meng's avatar
      hw/net: vmxnet3: Remove the logic of padding short frames in the receive path · c445f200
      Bin Meng authored
      
      Now that we have implemented unified short frames padding in the
      QEMU networking codes, remove the same logic in the NIC codes.
      
      This actually reverts commit 40a87c6c.
      
      Signed-off-by: default avatarBin Meng <bmeng@tinylab.org>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      c445f200
    • Bin Meng's avatar
      hw/net: e1000: Remove the logic of padding short frames in the receive path · 140eae9c
      Bin Meng authored
      
      Now that we have implemented unified short frames padding in the
      QEMU networking codes, remove the same logic in the NIC codes.
      
      This actually reverts commit 78aeb23e.
      
      Signed-off-by: default avatarBin Meng <bmeng@tinylab.org>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      140eae9c
    • Laurent Vivier's avatar
      virtio-net: correctly report maximum tx_queue_size value · 4271f403
      Laurent Vivier authored
      
      Maximum value for tx_queue_size depends on the backend type.
      1024 for vDPA/vhost-user, 256 for all the others.
      
      The value is returned by virtio_net_max_tx_queue_size() to set the
      parameter:
      
          n->net_conf.tx_queue_size = MIN(virtio_net_max_tx_queue_size(n),
                                          n->net_conf.tx_queue_size);
      
      But the parameter checking uses VIRTQUEUE_MAX_SIZE (1024).
      
      So the parameter is silently ignored and ethtool reports a different
      value than the one provided by the user.
      
         ... -netdev tap,... -device virtio-net,tx_queue_size=1024
      
          # ethtool -g enp0s2
          Ring parameters for enp0s2:
          Pre-set maximums:
          RX:		256
          RX Mini:	n/a
          RX Jumbo:	n/a
          TX:		256
          Current hardware settings:
          RX:		256
          RX Mini:	n/a
          RX Jumbo:	n/a
          TX:		256
      
         ... -netdev vhost-user,... -device virtio-net,tx_queue_size=2048
      
          Invalid tx_queue_size (= 2048), must be a power of 2 between 256 and 1024
      
      With this patch the correct maximum value is checked and displayed.
      
      For vDPA/vhost-user:
      
          Invalid tx_queue_size (= 2048), must be a power of 2 between 256 and 1024
      
      For all the others:
      
          Invalid tx_queue_size (= 512), must be a power of 2 between 256 and 256
      
      Fixes: 2eef278b ("virtio-net: fix tx queue size for !vhost-user")
      Cc: mst@redhat.com
      Cc: qemu-stable@nongnu.org
      Signed-off-by: default avatarLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      4271f403
  2. Jul 06, 2023
    • Richard Henderson's avatar
      Merge tag 'pull-9p-20230706' of https://github.com/cschoenebeck/qemu into staging · 97c81ef4
      Richard Henderson authored
      Administrative changes only:
      
      * Deprecate 9p 'proxy' backend.
      
      * Raise status of 9p to 'Maintained'.
      
      # -----BEGIN PGP SIGNATURE-----
      #
      # iQJLBAABCgA1FiEEltjREM96+AhPiFkBNMK1h2Wkc5UFAmSmkAsXHHFlbXVfb3Nz
      # QGNydWRlYnl0ZS5jb20ACgkQNMK1h2Wkc5We1xAAol+HbhQ2zNCJUbZ2/WY3Jf0H
      # K86DRQIs6w6UkL9msFz+id+tR5i50HoJ3+RnOKvy/fPqO8Rv6mb0d9r+bIG1JJCc
      # ubHP91x/nyDbP0XbLMtmtCz/T4g67E11Qqriq7lH1bPF7ccU3iXHZNup9HARjOoE
      # SQo9x4e7IDi1WdmM2vjvRXCh4ZLIlBv7c+2vAeP4V7FhJhDkL+1y+w6aCFw0xpd8
      # lto3Egnhz6pk7+SJfQwCl3rfozHhCxlNmcNa+7vqckVFpdJrvtKOQB4cn9yVDPr/
      # WjmYoB2J3MwYuZz+qAkdRJ6dUTLJb87YqJJe6lcKq0lqjiFBk7TccvIN9WgyJQd/
      # eLUPCCyo98g9RCaPzjLc4MgbpCPCmqJkg8A1vJzykvq51BqJZcdkwfJ7LFmsvTSo
      # IfR1Seq4OUUzTZ2gWh8wJBNcPpAbilHzQnumxBEupe0Dg/pwoQWCywTYJN6Yf/6+
      # PzcK39bVFKrEyc4Z1Y/yXvAzD7nX8X78kSHvxYYEQfzruLIVQjUUQ7Mp3TiJvljk
      # mLdcYqavjawgC2zmZU4L2Lx4Su7iVIkhNWj57WkfooSzLrAjueYQIJEltAt8Qmn6
      # x3+u3xI/myNKujMpaqgTAU5Gk2J2UApshq5Zwe8HpnVwWoxS3QetXdA/f4AXwZOk
      # TpnKPYQa7edPLSSAbAs=
      # =GzjR
      # -----END PGP SIGNATURE-----
      # gpg: Signature made Thu 06 Jul 2023 10:57:31 AM BST
      # gpg:                using RSA key 96D8D110CF7AF8084F88590134C2B58765A47395
      # gpg:                issuer "qemu_oss@crudebyte.com"
      # gpg: Good signature from "Christian Schoenebeck <qemu_oss@crudebyte.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: ECAB 1A45 4014 1413 BA38  4926 30DB 47C3 A012 D5F4
      #      Subkey fingerprint: 96D8 D110 CF7A F808 4F88  5901 34C2 B587 65A4 7395
      
      * tag 'pull-9p-20230706' of https://github.com/cschoenebeck/qemu
      
      :
        MAINTAINERS: raise status of 9p to 'Maintained'
        9pfs: deprecate 'proxy' backend
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      97c81ef4
    • Richard Henderson's avatar
      Merge tag 'pull-target-arm-20230706' of... · 822cb97c
      Richard Henderson authored
      Merge tag 'pull-target-arm-20230706' of https://git.linaro.org/people/pmaydell/qemu-arm into staging
      
      target-arm queue:
       * Add raw_writes ops for register whose write induce TLB maintenance
       * hw/arm/sbsa-ref: use XHCI to replace EHCI
       * Avoid splitting Zregs across lines in dump
       * Dump ZA[] when active
       * Fix SME full tile indexing
       * Handle IC IVAU to improve compatibility with JITs
       * xlnx-canfd-test: Fix code coverity issues
       * gdbstub: Guard M-profile code with CONFIG_TCG
       * allwinner-sramc: Set class_size
       * target/xtensa: Assert that interrupt level is within bounds
       * Avoid over-length shift in arm_cpu_sve_finalize() error case
       * Define new 'neoverse-v1' CPU type
      
      # -----BEGIN PGP SIGNATURE-----
      #
      # iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmSmwEEZHHBldGVyLm1h
      # eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3vBcD/4vKUw6klRV7vyz/KBr2AOi
      # Z1FnkLmOhwdp7CKvAVfU58TbPEJ8Fjo7OjziByV5nn/Ht9XrXcdl/E+0JamgrJ/n
      # G90ZfpoY3Boan4XBukBz/KX63sT1erF4io1NxbvqLxZ2mbZWNb0D1v2qkxC5zPFE
      # 97knlbSle4/VB8N6VgaPaWKVy5gmBZQwl7NUlFtB8TTZp3HPo0V77E9p1Wqpwpls
      # BNbqdtgUre3dlJci2f24PmXHYraKa68qk9xGnsSae96EY2+pOHbKhoZ/Fobaor2C
      # u+dfgQ3fY3aLDVKx8UESIUoqkGoVqwEbmt+pWG2rJiljLkdsI3ZsVq7p3+VGbLAN
      # berL14kCC2vRQYeNUwxeh5wdNVXc58xhWI5KXQRe8hr1dKWS5LQEHWgr7g7mb0+m
      # zPHqbdF4FR1DAV29vQ9WyK4zttrinFAYl+zvLyd8dX2ogoUeivR+4o3YX4hlFr4H
      # vcrglZbCGqAb3oKQG3PSGliS9GYtBwodLqKEH8PfcwfOP5PIcnSVc0Kl9DSzf7um
      # dAuYpaK/XW3MPx5qpWjnip4dRWUV5m/6nSCJr+fELEv3A0sGZY4pywv5NS/Yg1wE
      # nXdi8D+nyx9+AAiWTcB+ePsLuDEO2gYtubfqed99TFoJbL6/b4NbH8YE6cF3N/gY
      # lqFyvEIYNJZ9klf7XKnX2w==
      # =/MkB
      # -----END PGP SIGNATURE-----
      # gpg: Signature made Thu 06 Jul 2023 02:23:13 PM BST
      # 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]
      
      * tag 'pull-target-arm-20230706' of https://git.linaro.org/people/pmaydell/qemu-arm
      
      :
        target/arm: Avoid over-length shift in arm_cpu_sve_finalize() error case
        target/arm: Define neoverse-v1
        target/arm: Suppress more TCG unimplemented features in ID registers
        target/xtensa: Assert that interrupt level is within bounds
        hw: arm: allwinner-sramc: Set class_size
        target/arm: gdbstub: Guard M-profile code with CONFIG_TCG
        tests/qtest: xlnx-canfd-test: Fix code coverity issues
        target/arm: Handle IC IVAU to improve compatibility with JITs
        target/arm: Fix SME full tile indexing
        target/arm: Dump ZA[] when active
        target/arm: Avoid splitting Zregs across lines in dump
        tests/tcg/aarch64/sysregs.c: Use S syntax for id_aa64zfr0_el1 and id_aa64smfr0_el1
        hw/arm/sbsa-ref: use XHCI to replace EHCI
        target/arm: Add raw_writes ops for register whose write induce TLB maintenance
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      822cb97c
    • Peter Maydell's avatar
      target/arm: Avoid over-length shift in arm_cpu_sve_finalize() error case · c4107723
      Peter Maydell authored
      
      If you build QEMU with the clang sanitizer enabled, you can see it
      fire when running the arm-cpu-features test:
      
      $ QTEST_QEMU_BINARY=./build/arm-clang/qemu-system-aarch64 ./build/arm-clang/tests/qtest/arm-cpu-features
      [...]
      ../../target/arm/cpu64.c:125:19: runtime error: shift exponent 64 is too large for 64-bit type 'unsigned long long'
      [...]
      
      This happens because the user can specify some incorrect SVE
      properties that result in our calculating a max_vq of 0.  We catch
      this and error out, but before we do that we calculate
      
       vq_mask = MAKE_64BIT_MASK(0, max_vq);$
      
      and the MAKE_64BIT_MASK() call is only valid for lengths that are
      greater than zero, so we hit the undefined behaviour.
      
      Change the logic so that if max_vq is 0 we specifically set vq_mask
      to 0 without going via MAKE_64BIT_MASK().  This lets us drop the
      max_vq check from the error-exit logic, because if max_vq is 0 then
      vq_map must now be 0.
      
      The UB only happens in the case where the user passed us an incorrect
      set of SVE properties, so it's not a big problem in practice.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20230704154332.3014896-1-peter.maydell@linaro.org
      c4107723
    • Peter Maydell's avatar
      target/arm: Define neoverse-v1 · c74138c6
      Peter Maydell authored
      
      Now that we have implemented support for FEAT_LSE2, we can define
      a CPU model for the Neoverse-V1, and enable it for the virt and
      sbsa-ref boards.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-id: 20230704130647.2842917-3-peter.maydell@linaro.org
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      c74138c6
    • Peter Maydell's avatar
      target/arm: Suppress more TCG unimplemented features in ID registers · 7d8c283e
      Peter Maydell authored
      
      We already squash the ID register field for FEAT_SPE (the Statistical
      Profiling Extension) because TCG does not implement it and if we
      advertise it to the guest the guest will crash trying to look at
      non-existent system registers.  Do the same for some other features
      which a real hardware Neoverse-V1 implements but which TCG doesn't:
       * FEAT_TRF (Self-hosted Trace Extension)
       * Trace Macrocell system register access
       * Memory mapped trace
       * FEAT_AMU (Activity Monitors Extension)
       * FEAT_MPAM (Memory Partitioning and Monitoring Extension)
       * FEAT_NV (Nested Virtualization)
      
      Most of these, like FEAT_SPE, are "introspection/trace" type features
      which QEMU is unlikely to ever implement.  The odd-one-out here is
      FEAT_NV -- we could implement that and at some point we probably
      will.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-id: 20230704130647.2842917-2-peter.maydell@linaro.org
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      7d8c283e
    • Peter Maydell's avatar
      target/xtensa: Assert that interrupt level is within bounds · ad18376b
      Peter Maydell authored
      
      In handle_interrupt() we use level as an index into the interrupt_vector[]
      array. This is safe because we have checked it against env->config->nlevel,
      but Coverity can't see that (and it is only true because each CPU config
      sets its XCHAL_NUM_INTLEVELS to something less than MAX_NLEVELS), so it
      complains about a possible array overrun (CID 1507131)
      
      Add an assert() which will make Coverity happy and catch the unlikely
      case of a mis-set XCHAL_NUM_INTLEVELS in future.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Acked-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      Message-id: 20230623154135.1930261-1-peter.maydell@linaro.org
      ad18376b
    • Akihiko Odaki's avatar
      hw: arm: allwinner-sramc: Set class_size · 9057e5f7
      Akihiko Odaki authored
      
      AwSRAMCClass is larger than SysBusDeviceClass so the class size must be
      advertised accordingly.
      
      Fixes: 05def917 ("hw: arm: allwinner-sramc: Add SRAM Controller support for R40")
      Signed-off-by: default avatarAkihiko Odaki <akihiko.odaki@daynix.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20230628110905.38125-1-akihiko.odaki@daynix.com
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      9057e5f7
    • Fabiano Rosas's avatar
      target/arm: gdbstub: Guard M-profile code with CONFIG_TCG · 893ca916
      Fabiano Rosas authored
      
      This code is only relevant when TCG is present in the build. Building
      with --disable-tcg --enable-xen on an x86 host we get:
      
      $ ../configure --target-list=x86_64-softmmu,aarch64-softmmu --disable-tcg --enable-xen
      $ make -j$(nproc)
      ...
      libqemu-aarch64-softmmu.fa.p/target_arm_gdbstub.c.o: in function `m_sysreg_ptr':
       ../target/arm/gdbstub.c:358: undefined reference to `arm_v7m_get_sp_ptr'
       ../target/arm/gdbstub.c:361: undefined reference to `arm_v7m_get_sp_ptr'
      
      libqemu-aarch64-softmmu.fa.p/target_arm_gdbstub.c.o: in function `arm_gdb_get_m_systemreg':
      ../target/arm/gdbstub.c:405: undefined reference to `arm_v7m_mrs_control'
      
      Signed-off-by: default avatarFabiano Rosas <farosas@suse.de>
      Message-id: 20230628164821.16771-1-farosas@suse.de
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      893ca916
    • Vikram Garhwal's avatar
      tests/qtest: xlnx-canfd-test: Fix code coverity issues · b52aa865
      Vikram Garhwal authored
      
      Following are done to fix the coverity issues:
      1. Change read_data to fix the CID 1512899: Out-of-bounds access (OVERRUN)
      2. Fix match_rx_tx_data to fix CID 1512900: Logically dead code (DEADCODE)
      3. Replace rand() in generate_random_data() with g_rand_int()
      
      Signed-off-by: default avatarVikram Garhwal <vikram.garhwal@amd.com>
      Message-id: 20230628202758.16398-1-vikram.garhwal@amd.com
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      b52aa865
    • John Högberg's avatar
      target/arm: Handle IC IVAU to improve compatibility with JITs · 9719f125
      John Högberg authored
      Unlike architectures with precise self-modifying code semantics
      (e.g. x86) ARM processors do not maintain coherency for instruction
      execution and memory, requiring an instruction synchronization
      barrier on every core that will execute the new code, and on many
      models also the explicit use of cache management instructions.
      
      While this is required to make JITs work on actual hardware, QEMU
      has gotten away with not handling this since it does not emulate
      caches, and unconditionally invalidates code whenever the softmmu
      or the user-mode page protection logic detects that code has been
      modified.
      
      Unfortunately the latter does not work in the face of dual-mapped
      code (a common W^X workaround), where one page is executable and
      the other is writable: user-mode has no way to connect one with the
      other as that is only known to the kernel and the emulated
      application.
      
      This commit works around the issue by telling software that
      instruction cache invalidation is required by clearing the
      CPR_EL0.DIC flag (regardless of whether the emulated processor
      needs it), and then invalidating code in IC IVAU instructions.
      
      Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1034
      
      
      
      Co-authored-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: default avatarJohn Högberg <john.hogberg@ericsson.com>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 168778890374.24232.3402138851538068785-1@git.sr.ht
      [PMM: removed unnecessary AArch64 feature check; moved
       "clear CTR_EL1.DIC" code up a bit so it's not in the middle
       of the vfp/neon related tests]
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      9719f125
    • Richard Henderson's avatar
      target/arm: Fix SME full tile indexing · 1f51573f
      Richard Henderson authored
      For the outer product set of insns, which take an entire matrix
      tile as output, the argument is not a combined tile+column.
      Therefore using get_tile_rowcol was incorrect, as we extracted
      the tile number from itself.
      
      The test case relies only on assembler support for SME, since
      no release of GCC recognizes -march=armv9-a+sme yet.
      
      Cc: qemu-stable@nongnu.org
      Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1620
      
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20230622151201.1578522-5-richard.henderson@linaro.org
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      [PMM: dropped now-unneeded changes to sysregs CFLAGS]
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      1f51573f
    • Richard Henderson's avatar
      target/arm: Dump ZA[] when active · 270bea47
      Richard Henderson authored
      
      Always print each matrix row whole, one per line, so that we
      get the entire matrix in the proper shape.
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20230622151201.1578522-3-richard.henderson@linaro.org
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      270bea47
    • Richard Henderson's avatar
      target/arm: Avoid splitting Zregs across lines in dump · a9d84070
      Richard Henderson authored
      
      Allow the line length to extend to 548 columns.  While annoyingly wide,
      it's still less confusing than the continuations we print.  Also, the
      default VL used by Linux (and max for A64FX) uses only 140 columns.
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20230622151201.1578522-2-richard.henderson@linaro.org
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      a9d84070
    • Peter Maydell's avatar
      tests/tcg/aarch64/sysregs.c: Use S syntax for id_aa64zfr0_el1 and id_aa64smfr0_el1 · 3dc2afea
      Peter Maydell authored
      
      Some assemblers will complain about attempts to access
      id_aa64zfr0_el1 and id_aa64smfr0_el1 by name if the test
      binary isn't built for the right processor type:
      
       /tmp/ccASXpLo.s:782: Error: selected processor does not support system register name 'id_aa64zfr0_el1'
       /tmp/ccASXpLo.s:829: Error: selected processor does not support system register name 'id_aa64smfr0_el1'
      
      However, these registers are in the ID space and are guaranteed to
      read-as-zero on older CPUs, so the access is both safe and sensible.
      Switch to using the S syntax, as we already do for ID_AA64ISAR2_EL1
      and ID_AA64MMFR2_EL1.  This allows us to drop the HAS_ARMV9_SME check
      and the makefile machinery to adjust the CFLAGS for this test, so we
      don't rely on having a sufficiently new compiler to be able to check
      these registers.
      
      This means we're actually testing the SME ID register: no released
      GCC yet recognizes -march=armv9-a+sme, so that was always skipped.
      It also avoids a future problem if we try to switch the "do we have
      SME support in the toolchain" check from "in the compiler" to "in the
      assembler" (at which point we would otherwise run into the above
      errors).
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      3dc2afea
Loading