Skip to content
  1. Mar 02, 2024
    • Linus Torvalds's avatar
      Merge tag 'iommu-fix-v6.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · 17ba5660
      Linus Torvalds authored
      Pull iommu fix from Joerg Roedel:
      
       - Fix SVA handle sharing in multi device case
      
      * tag 'iommu-fix-v6.8-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        iommu/sva: Fix SVA handle sharing in multi device case
      17ba5660
    • Linus Torvalds's avatar
      Merge tag 'mmc-v6.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · 371e4a1f
      Linus Torvalds authored
      Pull MMC fixes from Ulf Hansson:
       "MMC core:
         - Fix eMMC initialization with 1-bit bus connection
      
        MMC host:
         - mmci: Fix DMA API overlapping mappings for the stm32 variant
         - sdhci-xenon: Fix PHY stability issues"
      
      * tag 'mmc-v6.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
        mmc: sdhci-xenon: add timeout for PHY init complete
        mmc: sdhci-xenon: fix PHY init clock stability
        mmc: mmci: stm32: fix DMA API overlapping mappings warning
        mmc: core: Fix eMMC initialization with 1-bit bus connection
      371e4a1f
    • Linus Torvalds's avatar
      Merge tag 'pmdomain-v6.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm · fafbad4a
      Linus Torvalds authored
      Pull pmdomain fixes from Ulf Hansson:
      
       - qcom: Fix enabled_corner aggregation for rpmhpd
      
       - arm: Fix NULL dereference on scmi_perf_domain removal
      
      * tag 'pmdomain-v6.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/linux-pm:
        pmdomain: qcom: rpmhpd: Fix enabled_corner aggregation
        pmdomain: arm: Fix NULL dereference on scmi_perf_domain removal
      fafbad4a
    • Linus Torvalds's avatar
      Merge tag 'efi-fixes-for-v6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi · 2bbb54ba
      Linus Torvalds authored
      Pull EFI fixes from Ard Biesheuvel:
       "Only the EFI variable name size change is significant, and will be
        backported once it lands. The others are cleanup.
      
         - Fix phys_addr_t size confusion in 32-bit capsule loader
      
         - Reduce maximum EFI variable name size to 512 to work around buggy
           firmware
      
         - Drop some redundant code from efivarfs while at it"
      
      * tag 'efi-fixes-for-v6.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
        efivarfs: Drop 'duplicates' bool parameter on efivar_init()
        efivarfs: Drop redundant cleanup on fill_super() failure
        efivarfs: Request at most 512 bytes for variable names
        efi/capsule-loader: fix incorrect allocation size
      2bbb54ba
    • Linus Torvalds's avatar
      Merge tag 'sound-6.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · fbf9e3b6
      Linus Torvalds authored
      Pull sound fixes from Takashi Iwai:
       "The amount of changes wasn't as small as wished, but all reasonably
        small fixes. There is a PCM core API change, which is for correcting
        the behavior change we took in 6.8. The rest are device-specific fixes
        for ASoC AMD, Qualcomm, Cirrus codecs, HD-audio quirks & co"
      
      * tag 'sound-6.8-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ASoC: amd: yc: Fix non-functional mic on Lenovo 21J2
        ASoC: amd: yc: add new YC platform variant (0x63) support
        ALSA: hda/realtek - ALC285 reduce pop noise from Headphone port
        ASoC: amd: yc: Add Lenovo ThinkBook 21J0 into DMI quirk table
        ALSA: hda/realtek: Add special fixup for Lenovo 14IRP8
        ASoC: soc-card: Fix missing locking in snd_soc_card_get_kcontrol()
        ALSA: hda/realtek: tas2781: enable subwoofer volume control
        ALSA: pcm: clarify and fix default msbits value for all formats
        ASoC: qcom: Fix uninitialized pointer dmactl
        ALSA: hda/realtek: fix mute/micmute LED For HP mt440
        ALSA: Drop leftover snd-rtctimer stuff from Makefile
        ALSA: ump: Fix the discard error code from snd_ump_legacy_open()
        ALSA: hda/realtek: Enable Mute LED on HP 840 G8 (MB 8AB8)
        ASoC: cs35l56: Must clear HALO_STATE before issuing SYSTEM_RESET
        ALSA: hda/realtek: Fix top speaker connection on Dell Inspiron 16 Plus 7630
        ALSA: firewire-lib: fix to check cycle continuity
      fbf9e3b6
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2024-03-01' of https://gitlab.freedesktop.org/drm/kernel · 7187ea09
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Bunch of fixes, xe, amdgpu, nouveau and tegra all have a few. Then
        drm/bridge including some drivers/soc fallout fixes. The biggest thing
        in here is a new unit test for some buddy allocator fixes, otherwise a
        misc fbcon, ttm unit test and one msm revert.
      
        Seems pretty normal for this stage.
      
        buddy:
         - two allocation fixes + unit test
      
        fbcon:
         - font restore syzkaller fix
      
        ttm:
         - kunit test fix
      
        bridge:
         - fix aux-hpd leaks
         - fix aux-hpd registration
         - fix use after free in soc/qcom
         - fix boot on soc/qcom
      
        xe:
         - A couple of tracepoint updates from Priyanka and Lucas
         - Make sure BINDs are completed before accepting UNBINDs on LR vms
         - Don't arbitrarily restrict max number of batched binds
         - Add uapi for dumpable bos (agreed on IRC)
         - Remove unused uapi flags and a leftover comment
         - A couple of fixes related to the execlist backend
      
        msm:
         - DP: Revert a change which was causing a HDP regression
      
        amdgpu:
         - Fix potential buffer overflow
         - Fix power min cap
         - Suspend/resume fix
         - SI PM fix
         - eDP fix
      
        nouveau:
         - fix a misreported VRAM sizing
         - fix a regression in suspend/resume due to freeing
      
        tegra:
         - host1x reset fix
         - only remove existing driver if display is possible"
      
      * tag 'drm-fixes-2024-03-01' of https://gitlab.freedesktop.org/drm/kernel: (32 commits)
        drm/nouveau: keep DMA buffers required for suspend/resume
        nouveau: report byte usage in VRAM usage
        drm/xe/xe_trace: Add move_lacks_source detail to xe_bo_move trace
        drm/xe: Deny unbinds if uapi ufence pending
        drm/xe: Expose user fence from xe_sync_entry
        drm/xe: Use pointers in trace events
        drm/xe/xe_bo_move: Enhance xe_bo_move trace
        drm/xe/mmio: fix build warning for BAR resize on 32-bit
        drm/xe: get rid of MAX_BINDS
        drm/xe: Use vmalloc for array of bind allocation in bind IOCTL
        drm/xe: Don't support execlists in xe_gt_tlb_invalidation layer
        drm/xe: Fix execlist splat
        drm/xe/uapi: Remove unused flags
        drm/xe/uapi: Remove DRM_XE_VM_BIND_FLAG_ASYNC comment left over
        drm/xe: Add uapi for dumpable bos
        drm/amd/display: Add monitor patch for specific eDP
        Revert "drm/msm/dp: use drm_bridge_hpd_notify() to report HPD status changes"
        drm/tests/drm_buddy: add alloc_range_bias test
        drm/buddy: check range allocation matches alignment
        drm/buddy: fix range bias
        ...
      7187ea09
    • Linus Torvalds's avatar
      Merge tag 'probes-fixes-v6.8-rc5' of... · 161671a6
      Linus Torvalds authored
      Merge tag 'probes-fixes-v6.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
      
      Pull fprobe fix from Masami Hiramatsu:
      
       - allocate entry_data_size buffer for each rethook instance.
      
         This fixes a buffer overrun bug (which leads a kernel crash)
         when fprobe user uses its entry_data in the entry_handler.
      
      * tag 'probes-fixes-v6.8-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
        fprobe: Fix to allocate entry_data_size buffer with rethook instances
      161671a6
    • Tetsuo Handa's avatar
      tomoyo: fix UAF write bug in tomoyo_write_control() · 2f03fc34
      Tetsuo Handa authored
      
      
      Since tomoyo_write_control() updates head->write_buf when write()
      of long lines is requested, we need to fetch head->write_buf after
      head->io_sem is held.  Otherwise, concurrent write() requests can
      cause use-after-free-write and double-free problems.
      
      Reported-by: default avatarSam Sun <samsun1006219@gmail.com>
      Closes: https://lkml.kernel.org/r/CAEkJfYNDspuGxYx5kym8Lvp--D36CMDUErg4rxfWFJuPbbji8g@mail.gmail.com
      Fixes: bd03a3e4
      
       ("TOMOYO: Add policy namespace support.")
      Cc:  <stable@vger.kernel.org> # Linux 3.1+
      Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2f03fc34
  2. Mar 01, 2024
  3. Feb 29, 2024
    • Alexander Ofitserov's avatar
      gtp: fix use-after-free and null-ptr-deref in gtp_newlink() · 616d82c3
      Alexander Ofitserov authored
      
      
      The gtp_link_ops operations structure for the subsystem must be
      registered after registering the gtp_net_ops pernet operations structure.
      
      Syzkaller hit 'general protection fault in gtp_genl_dump_pdp' bug:
      
      [ 1010.702740] gtp: GTP module unloaded
      [ 1010.715877] general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] SMP KASAN NOPTI
      [ 1010.715888] KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f]
      [ 1010.715895] CPU: 1 PID: 128616 Comm: a.out Not tainted 6.8.0-rc6-std-def-alt1 #1
      [ 1010.715899] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.0-alt1 04/01/2014
      [ 1010.715908] RIP: 0010:gtp_newlink+0x4d7/0x9c0 [gtp]
      [ 1010.715915] Code: 80 3c 02 00 0f 85 41 04 00 00 48 8b bb d8 05 00 00 e8 ed f6 ff ff 48 89 c2 48 89 c5 48 b8 00 00 00 00 00 fc ff df 48 c1 ea 03 <80> 3c 02 00 0f 85 4f 04 00 00 4c 89 e2 4c 8b 6d 00 48 b8 00 00 00
      [ 1010.715920] RSP: 0018:ffff888020fbf180 EFLAGS: 00010203
      [ 1010.715929] RAX: dffffc0000000000 RBX: ffff88800399c000 RCX: 0000000000000000
      [ 1010.715933] RDX: 0000000000000001 RSI: ffffffff84805280 RDI: 0000000000000282
      [ 1010.715938] RBP: 000000000000000d R08: 0000000000000001 R09: 0000000000000000
      [ 1010.715942] R10: 0000000000000001 R11: 0000000000000001 R12: ffff88800399cc80
      [ 1010.715947] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000400
      [ 1010.715953] FS:  00007fd1509ab5c0(0000) GS:ffff88805b300000(0000) knlGS:0000000000000000
      [ 1010.715958] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 1010.715962] CR2: 0000000000000000 CR3: 000000001c07a000 CR4: 0000000000750ee0
      [ 1010.715968] PKRU: 55555554
      [ 1010.715972] Call Trace:
      [ 1010.715985]  ? __die_body.cold+0x1a/0x1f
      [ 1010.715995]  ? die_addr+0x43/0x70
      [ 1010.716002]  ? exc_general_protection+0x199/0x2f0
      [ 1010.716016]  ? asm_exc_general_protection+0x1e/0x30
      [ 1010.716026]  ? gtp_newlink+0x4d7/0x9c0 [gtp]
      [ 1010.716034]  ? gtp_net_exit+0x150/0x150 [gtp]
      [ 1010.716042]  __rtnl_newlink+0x1063/0x1700
      [ 1010.716051]  ? rtnl_setlink+0x3c0/0x3c0
      [ 1010.716063]  ? is_bpf_text_address+0xc0/0x1f0
      [ 1010.716070]  ? kernel_text_address.part.0+0xbb/0xd0
      [ 1010.716076]  ? __kernel_text_address+0x56/0xa0
      [ 1010.716084]  ? unwind_get_return_address+0x5a/0xa0
      [ 1010.716091]  ? create_prof_cpu_mask+0x30/0x30
      [ 1010.716098]  ? arch_stack_walk+0x9e/0xf0
      [ 1010.716106]  ? stack_trace_save+0x91/0xd0
      [ 1010.716113]  ? stack_trace_consume_entry+0x170/0x170
      [ 1010.716121]  ? __lock_acquire+0x15c5/0x5380
      [ 1010.716139]  ? mark_held_locks+0x9e/0xe0
      [ 1010.716148]  ? kmem_cache_alloc_trace+0x35f/0x3c0
      [ 1010.716155]  ? __rtnl_newlink+0x1700/0x1700
      [ 1010.716160]  rtnl_newlink+0x69/0xa0
      [ 1010.716166]  rtnetlink_rcv_msg+0x43b/0xc50
      [ 1010.716172]  ? rtnl_fdb_dump+0x9f0/0x9f0
      [ 1010.716179]  ? lock_acquire+0x1fe/0x560
      [ 1010.716188]  ? netlink_deliver_tap+0x12f/0xd50
      [ 1010.716196]  netlink_rcv_skb+0x14d/0x440
      [ 1010.716202]  ? rtnl_fdb_dump+0x9f0/0x9f0
      [ 1010.716208]  ? netlink_ack+0xab0/0xab0
      [ 1010.716213]  ? netlink_deliver_tap+0x202/0xd50
      [ 1010.716220]  ? netlink_deliver_tap+0x218/0xd50
      [ 1010.716226]  ? __virt_addr_valid+0x30b/0x590
      [ 1010.716233]  netlink_unicast+0x54b/0x800
      [ 1010.716240]  ? netlink_attachskb+0x870/0x870
      [ 1010.716248]  ? __check_object_size+0x2de/0x3b0
      [ 1010.716254]  netlink_sendmsg+0x938/0xe40
      [ 1010.716261]  ? netlink_unicast+0x800/0x800
      [ 1010.716269]  ? __import_iovec+0x292/0x510
      [ 1010.716276]  ? netlink_unicast+0x800/0x800
      [ 1010.716284]  __sock_sendmsg+0x159/0x190
      [ 1010.716290]  ____sys_sendmsg+0x712/0x880
      [ 1010.716297]  ? sock_write_iter+0x3d0/0x3d0
      [ 1010.716304]  ? __ia32_sys_recvmmsg+0x270/0x270
      [ 1010.716309]  ? lock_acquire+0x1fe/0x560
      [ 1010.716315]  ? drain_array_locked+0x90/0x90
      [ 1010.716324]  ___sys_sendmsg+0xf8/0x170
      [ 1010.716331]  ? sendmsg_copy_msghdr+0x170/0x170
      [ 1010.716337]  ? lockdep_init_map_type+0x2c7/0x860
      [ 1010.716343]  ? lockdep_hardirqs_on_prepare+0x430/0x430
      [ 1010.716350]  ? debug_mutex_init+0x33/0x70
      [ 1010.716360]  ? percpu_counter_add_batch+0x8b/0x140
      [ 1010.716367]  ? lock_acquire+0x1fe/0x560
      [ 1010.716373]  ? find_held_lock+0x2c/0x110
      [ 1010.716384]  ? __fd_install+0x1b6/0x6f0
      [ 1010.716389]  ? lock_downgrade+0x810/0x810
      [ 1010.716396]  ? __fget_light+0x222/0x290
      [ 1010.716403]  __sys_sendmsg+0xea/0x1b0
      [ 1010.716409]  ? __sys_sendmsg_sock+0x40/0x40
      [ 1010.716419]  ? lockdep_hardirqs_on_prepare+0x2b3/0x430
      [ 1010.716425]  ? syscall_enter_from_user_mode+0x1d/0x60
      [ 1010.716432]  do_syscall_64+0x30/0x40
      [ 1010.716438]  entry_SYSCALL_64_after_hwframe+0x62/0xc7
      [ 1010.716444] RIP: 0033:0x7fd1508cbd49
      [ 1010.716452] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d ef 70 0d 00 f7 d8 64 89 01 48
      [ 1010.716456] RSP: 002b:00007fff18872348 EFLAGS: 00000202 ORIG_RAX: 000000000000002e
      [ 1010.716463] RAX: ffffffffffffffda RBX: 000055f72bf0eac0 RCX: 00007fd1508cbd49
      [ 1010.716468] RDX: 0000000000000000 RSI: 0000000020000280 RDI: 0000000000000006
      [ 1010.716473] RBP: 00007fff18872360 R08: 00007fff18872360 R09: 00007fff18872360
      [ 1010.716478] R10: 00007fff18872360 R11: 0000000000000202 R12: 000055f72bf0e1b0
      [ 1010.716482] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
      [ 1010.716491] Modules linked in: gtp(+) udp_tunnel ib_core uinput af_packet rfkill qrtr joydev hid_generic usbhid hid kvm_intel iTCO_wdt intel_pmc_bxt iTCO_vendor_support kvm snd_hda_codec_generic ledtrig_audio irqbypass crct10dif_pclmul crc32_pclmul crc32c_intel ghash_clmulni_intel snd_hda_intel nls_utf8 snd_intel_dspcfg nls_cp866 psmouse aesni_intel vfat crypto_simd fat cryptd glue_helper snd_hda_codec pcspkr snd_hda_core i2c_i801 snd_hwdep i2c_smbus xhci_pci snd_pcm lpc_ich xhci_pci_renesas xhci_hcd qemu_fw_cfg tiny_power_button button sch_fq_codel vboxvideo drm_vram_helper drm_ttm_helper ttm vboxsf vboxguest snd_seq_midi snd_seq_midi_event snd_seq snd_rawmidi snd_seq_device snd_timer snd soundcore msr fuse efi_pstore dm_mod ip_tables x_tables autofs4 virtio_gpu virtio_dma_buf drm_kms_helper cec rc_core drm virtio_rng virtio_scsi rng_core virtio_balloon virtio_blk virtio_net virtio_console net_failover failover ahci libahci libata evdev scsi_mod input_leds serio_raw virtio_pci intel_agp
      [ 1010.716674]  virtio_ring intel_gtt virtio [last unloaded: gtp]
      [ 1010.716693] ---[ end trace 04990a4ce61e174b ]---
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAlexander Ofitserov <oficerovas@altlinux.org>
      Fixes: 459aa660
      
       ("gtp: add initial driver for datapath of GPRS Tunneling Protocol (GTP-U)")
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Link: https://lore.kernel.org/r/20240228114703.465107-1-oficerovas@altlinux.org
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      616d82c3
    • Priyanka Dandamudi's avatar
      drm/xe/xe_trace: Add move_lacks_source detail to xe_bo_move trace · 8188cae3
      Priyanka Dandamudi authored
      
      
      Add move_lacks_source detail to xe_bo_move trace to make it readable
      that is to check if it is migrate clear or migrate copy.
      
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Signed-off-by: default avatarPriyanka Dandamudi <priyanka.dandamudi@intel.com>
      Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Fixes: a09946a9
      
       ("drm/xe/xe_bo_move: Enhance xe_bo_move trace")
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240221101950.1019312-1-priyanka.dandamudi@intel.com
      (cherry picked from commit 8034f6b0
      
      )
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      8188cae3
    • Paolo Abeni's avatar
      Merge tag 'nf-24-02-29' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf · b611b776
      Paolo Abeni authored
      Pablo Neira Ayuso says:
      
      ====================
      Netfilter fixes for net
      
      Patch #1 restores NFPROTO_INET with nft_compat, from Ignat Korchagin.
      
      Patch #2 fixes an issue with bridge netfilter and broadcast/multicast
      packets.
      
      There is a day 0 bug in br_netfilter when used with connection tracking.
      
      Conntrack assumes that an nf_conn structure that is not yet added to
      hash table ("unconfirmed"), is only visible by the current cpu that is
      processing the sk_buff.
      
      For bridge this isn't true, sk_buff can get cloned in between, and
      clones can be processed in parallel on different cpu.
      
      This patch disables NAT and conntrack helpers for multicast packets.
      
      Patch #3 adds a selftest to cover for the br_netfilter bug.
      
      netfilter pull request 24-02-29
      
      * tag 'nf-24-02-29' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf:
        selftests: netfilter: add bridge conntrack + multicast test case
        netfilter: bridge: confirm multicast packets before passing them up the stack
        netfilter: nf_tables: allow NFPROTO_INET in nft_(match/target)_validate()
      ====================
      
      Link: https://lore.kernel.org/r/20240229000135.8780-1-pablo@netfilter.org
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      b611b776
    • Lukasz Majewski's avatar
      net: hsr: Use correct offset for HSR TLV values in supervisory HSR frames · 51dd4ee0
      Lukasz Majewski authored
      Current HSR implementation uses following supervisory frame (even for
      HSRv1 the HSR tag is not is not present):
      
      00000000: 01 15 4e 00 01 2d XX YY ZZ 94 77 10 88 fb 00 01
      00000010: 7e 1c 17 06 XX YY ZZ 94 77 10 1e 06 XX YY ZZ 94
      00000020: 77 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      00000030: 00 00 00 00 00 00 00 00 00 00 00 00
      
      The current code adds extra two bytes (i.e. sizeof(struct hsr_sup_tlv))
      when offset for skb_pull() is calculated.
      This is wrong, as both 'struct hsrv1_ethhdr_sp' and 'hsrv0_ethhdr_sp'
      already have 'struct hsr_sup_tag' defined in them, so there is no need
      for adding extra two bytes.
      
      This code was working correctly as with no RedBox support, the check for
      HSR_TLV_EOT (0x00) was off by two bytes, which were corresponding to
      zeroed padded bytes for minimal packet size.
      
      Fixes: eafaa88b
      
       ("net: hsr: Add support for redbox supervision frames")
      Signed-off-by: default avatarLukasz Majewski <lukma@denx.de>
      Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
      Link: https://lore.kernel.org/r/20240228085644.3618044-1-lukma@denx.de
      
      
      Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
      51dd4ee0
    • Mika Kuoppala's avatar
      drm/xe: Deny unbinds if uapi ufence pending · 785f4cc0
      Mika Kuoppala authored
      If user fence was provided for MAP in vm_bind_ioctl
      and it has still not been signalled, deny UNMAP of said
      vma with EBUSY as long as unsignalled fence exists.
      
      This guarantees that MAP vs UNMAP sequences won't
      escape under the radar if we ever want to track the
      client's state wrt to completed and accessible MAPs.
      By means of intercepting the ufence release signalling.
      
      v2: find ufence with num_fences > 1 (Matt)
      v3: careful on clearing vma ufence (Matt)
      
      Link: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/1159
      
      
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Cc: Matthew Brost <matthew.brost@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Signed-off-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240215181152.450082-3-mika.kuoppala@linux.intel.com
      (cherry picked from commit 158900ad
      
      )
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      785f4cc0
    • Mika Kuoppala's avatar
      drm/xe: Expose user fence from xe_sync_entry · 86b3cd6d
      Mika Kuoppala authored
      
      
      By allowing getting reference to user fence, we can
      control the lifetime outside of sync entries.
      
      This is needed to allow vma to track the associated
      user fence that was provided with bind ioctl.
      
      v2: xe_user_fence can be kept opaque (Jani, Matt)
      v3: indent fix (Matt)
      
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Cc: Matthew Brost <matthew.brost@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Signed-off-by: default avatarMika Kuoppala <mika.kuoppala@linux.intel.com>
      Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240215181152.450082-2-mika.kuoppala@linux.intel.com
      (cherry picked from commit 977e5b82
      
      )
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      86b3cd6d
    • Lucas De Marchi's avatar
      drm/xe: Use pointers in trace events · 4ca5c829
      Lucas De Marchi authored
      Commit a0df2cc8 ("drm/xe/xe_bo_move: Enhance xe_bo_move trace")
      inadvertently reverted commit 8d038f49
      
       ("drm/xe: Fix cast on trace
      variable"), breaking the build on 32bits.
      
      As noted by Ville, there's no point in converting the pointers to u64
      and add casts everywhere. In fact, it's better to just use %p and let
      the address be hashed. Convert all the cases in xe_trace.h to use
      pointers.
      
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Priyanka Dandamudi <priyanka.dandamudi@intel.com>
      Cc: Oak Zeng <oak.zeng@intel.com>
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240222144125.2862546-1-lucas.demarchi@intel.com
      (cherry picked from commit 7a975748
      
      )
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      4ca5c829
    • Priyanka Dandamudi's avatar
      drm/xe/xe_bo_move: Enhance xe_bo_move trace · a09946a9
      Priyanka Dandamudi authored
      
      
      Enhanced xe_bo_move trace to be more readable.
      It will help to show the migration details.
      Src and dst details.
      
      v2: Modify trace_xe_bo_move(), it takes the integer mem_type
      rather than a string.
      Make mem_type_to_name() extern, it will be used by trace.(Thomas)
      
      v3: Move mem_type_to_name() to xe_bo.[ch] (Thomas, Matt)
      
      v4: Add device details to reduce ambiquity related to vram0/vram1. (Oak)
      
      v5: Rename mem_type_to_name to xe_mem_type_to_name. (Thomas)
      
      v6: Optimised code to use xe_bo_device(__entry->bo). (Thomas)
      
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Cc: Oak Zeng <oak.zeng@intel.com>
      Cc: Kempczynski Zbigniew <Zbigniew.Kempczynski@intel.com>
      Cc: Matthew Brost <matthew.brost@intel.com>
      Cc: Brian Welty <brian.welty@intel.com>
      Signed-off-by: default avatarPriyanka Dandamudi <priyanka.dandamudi@intel.com>
      Reviewed-by: default avatarOak Zeng <oak.zeng@intel.com>
      Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240220044748.948496-1-priyanka.dandamudi@intel.com
      (cherry picked from commit a0df2cc8
      
      )
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      a09946a9
    • Arnd Bergmann's avatar
      drm/xe/mmio: fix build warning for BAR resize on 32-bit · 12cb2b21
      Arnd Bergmann authored
      clang complains about a nonsensical test on builds with a 32-bit phys_addr_t,
      which means resizing will always fail:
      
      drivers/gpu/drm/xe/xe_mmio.c:109:23: error: result of comparison of constant 4294967296 with expression of type 'resource_size_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
        109 |                     root_res->start > 0x100000000ull)
            |                     ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~
      
      Previously, BAR resize was always disallowed on 32-bit kernels, but
      this apparently changed recently. Since 32-bit machines can in theory
      support PAE/LPAE for large address spaces, this may end up useful,
      so change the driver to shut up the warning but still work when
      phys_addr_t/resource_size_t is 64 bit wide.
      
      Fixes: 9a6e6c14
      
       ("drm/xe/mmio: Use non-atomic writeq/readq variant for 32b")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      Acked-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240226124736.1272949-2-arnd@kernel.org
      
      
      Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
      (cherry picked from commit f5d39833
      
      )
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      12cb2b21
    • Paulo Zanoni's avatar
      drm/xe: get rid of MAX_BINDS · 14d4d0ad
      Paulo Zanoni authored
      Mesa has been issuing a single bind operation per ioctl since xe.ko
      changed to GPUVA due xe.ko bug #746. If I change Mesa to try again to
      issue every single bind operation it can in the same ioctl, it hits
      the MAX_BINDS assertion when running Vulkan conformance tests.
      
      Test dEQP-VK.sparse_resources.transfer_queue.3d.rgba32i.1024_128_8
      issues 960 bind operations in a single ioctl, it's the most I could
      find in the conformance suite.
      
      I don't see a reason to keep the MAX_BINDS restriction: it doesn't
      seem to be preventing any specific issue. If the number is too big for
      the memory allocations, then those will fail. Nothing related to
      num_binds seems to be using the stack. Let's just get rid of it.
      
      Fixes: dd08ebf6 ("drm/xe: Introduce a new DRM driver for Intel GPUs")
      Testcase: dEQP-VK.sparse_resources.transfer_queue.3d.rgba32i.1024_128_8
      References: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/746
      
      
      Cc: Matthew Brost <matthew.brost@intel.com>
      Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
      Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
      Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240215005353.1295420-1-paulo.r.zanoni@intel.com
      (cherry picked from commit ba6bbdc6
      
      )
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      14d4d0ad
    • Matthew Brost's avatar
      drm/xe: Use vmalloc for array of bind allocation in bind IOCTL · a41f6b0d
      Matthew Brost authored
      Use vmalloc in effort to allow a user pass in a large number of binds in
      an IOCTL (mesa use case). Also use array allocations rather open coding
      the size calculation.
      
      v2: Use __GFP_ACCOUNT for allocations (Thomas)
      
      Fixes: dd08ebf6
      
       ("drm/xe: Introduce a new DRM driver for Intel GPUs")
      Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
      Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240226155554.103384-1-matthew.brost@intel.com
      (cherry picked from commit 35ed1d2b
      
      )
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      a41f6b0d
    • Matthew Brost's avatar
      drm/xe: Don't support execlists in xe_gt_tlb_invalidation layer · ccff0b21
      Matthew Brost authored
      The xe_gt_tlb_invalidation layer implements TLB invalidations for a GuC
      backend. Simply return if in execlists mode. A follow up may properly
      implement the xe_gt_tlb_invalidation layer for both GuC and execlists.
      
      Fixes: a9351846
      
       ("drm/xe: Break of TLB invalidation into its own file")
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240222232021.3911545-4-matthew.brost@intel.com
      (cherry picked from commit a9e483dd
      
      )
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      ccff0b21
    • Matthew Brost's avatar
      drm/xe: Fix execlist splat · dc15bd0a
      Matthew Brost authored
      Although execlist submission is not supported it should be kept in a
      basic working state as it can be used for very early hardware bring up.
      Fix the below splat.
      
      WARNING: CPU: 3 PID: 11 at drivers/gpu/drm/xe/xe_execlist.c:217 execlist_run_job+0x1c2/0x220 [xe]
      Modules linked in: xe drm_kunit_helpers drm_gpuvm drm_ttm_helper ttm drm_exec drm_suballoc_helper drm_buddy gpu_sched mei_pxp mei_hdcp wmi_bmof x86_pkg_temp_thermal coretemp crct10dif_pclmul crc32_pclmul snd_hda_intel ghash_clmulni_intel snd_intel_dspcfg snd_hda_codec snd_hwdep snd_hda_core video snd_pcm mei_me mei wmi fuse e1000e i2c_i801 ptp i2c_smbus pps_core intel_lpss_pci
      CPU: 3 PID: 11 Comm: kworker/u16:0 Tainted: G     U             6.8.0-rc3-guc+ #1046
      Hardware name: Intel Corporation Tiger Lake Client Platform/TigerLake U DDR4 SODIMM RVP, BIOS TGLSFWI1.R00.3243.A01.2006102133 06/10/2020
      Workqueue: rcs0 drm_sched_run_job_work [gpu_sched]
      RIP: 0010:execlist_run_job+0x1c2/0x220 [xe]
      Code: 8b f8 03 00 00 4c 89 39 e9 e2 fe ff ff 49 8d 7d 20 be ff ff ff ff e8 ed fd a6 e1 85 c0 0f 85 e1 fe ff ff 0f 0b e9 da fe ff ff <0f> 0b 0f 0b 41 83 fc 03 0f 86 8a fe ff ff 0f 0b e9 83 fe ff ff be
      RSP: 0018:ffffc9000013bdb8 EFLAGS: 00010246
      RAX: ffff888105021a00 RBX: ffff888105078400 RCX: 0000000000000000
      RDX: 0000000000000001 RSI: ffffc9000013bd14 RDI: ffffc90001609090
      RBP: ffff88811e3f0040 R08: 0000000000000088 R09: 00000000ffffff81
      R10: 0000000000000001 R11: ffff88810c10c000 R12: 00000000fffffffe
      R13: ffff888109b72c28 R14: ffff8881050784a0 R15: ffff888105078408
      FS:  0000000000000000(0000) GS:ffff88849f980000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 0000563459d130f8 CR3: 000000000563a001 CR4: 0000000000f70ef0
      DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      PKRU: 55555554
      Call Trace:
       <TASK>
       ? __warn+0x7f/0x170
       ? execlist_run_job+0x1c2/0x220 [xe]
       ? report_bug+0x1c7/0x1d0
       ? handle_bug+0x3c/0x70
       ? exc_invalid_op+0x18/0x70
       ? asm_exc_invalid_op+0x1a/0x20
       ? execlist_run_job+0x1c2/0x220 [xe]
       ? execlist_run_job+0x2c/0x220 [xe]
       drm_sched_run_job_work+0x246/0x3f0 [gpu_sched]
       ? process_one_work+0x18d/0x4e0
       process_one_work+0x1f7/0x4e0
       worker_thread+0x1da/0x3e0
       ? __pfx_worker_thread+0x10/0x10
       kthread+0xfe/0x130
       ? __pfx_kthread+0x10/0x10
       ret_from_fork+0x2c/0x50
       ? __pfx_kthread+0x10/0x10
       ret_from_fork_asm+0x1b/0x30
       </TASK>
      
      Fixes: 9b9529ce
      
       ("drm/xe: Rename engine to exec_queue")
      Signed-off-by: default avatarMatthew Brost <matthew.brost@intel.com>
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240222232021.3911545-2-matthew.brost@intel.com
      (cherry picked from commit ddadc712
      
      )
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      dc15bd0a
    • Francois Dugast's avatar
      drm/xe/uapi: Remove unused flags · eaa367a0
      Francois Dugast authored
      Those cases missed in previous uAPI cleanups were mostly accidentally
      brought in from i915 or created to exercise the possibilities of gpuvm
      but they are not used by userspace yet, so let's remove them. They can
      still be brought back later if needed.
      
      v2:
      - Fix XE_VM_FLAG_FAULT_MODE support in xe_lrc.c (Brian Welty)
      - Leave DRM_XE_VM_BIND_OP_UNMAP_ALL (José Roberto de Souza)
      - Ensure invalid flag values are rejected (Rodrigo Vivi)
      
      v3: Rebase after removal of persistent exec_queues (Francois Dugast)
      
      v4: Rodrigo: Rebase after the new dumpable flag.
      
      Fixes: dd08ebf6
      
       ("drm/xe: Introduce a new DRM driver for Intel GPUs")
      Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarFrancois Dugast <francois.dugast@intel.com>
      Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20240222232356.175431-1-rodrigo.vivi@intel.com
      (cherry picked from commit 84a1ed5e
      
      )
      Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
      eaa367a0