1. 09 Jan, 2023 2 commits
  2. 03 Jan, 2023 4 commits
    • Cristian Marussi's avatar
      firmware: arm_scmi: Fix virtio channels cleanup on shutdown · e325285d
      Cristian Marussi authored
      When unloading the SCMI core stack module, configured to use the virtio
      SCMI transport, LOCKDEP reports the splat down below about unsafe locks
      dependencies.
      
      In order to avoid this possible unsafe locking scenario call upfront
      virtio_break_device() before getting hold of vioch->lock.
      
      =====================================================
       WARNING: HARDIRQ-safe -> HARDIRQ-unsafe lock order detected
       6.1.0-00067-g6b934395ba07-dirty #4 Not tainted
       -----------------------------------------------------
       rmmod/307 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
       ffff000080c510e0 (&dev->vqs_list_lock){+.+.}-{3:3}, at: virtio_break_device+0x28/0x68
      
       and this task is already holding:
       ffff00008288ada0 (&channels[i].lock){-.-.}-{3:3}, at: virtio_chan_free+0x60/0x168 [scmi_module]
      
       which would create a new lock dependency:
        (&channels[i].lock){-.-.}-{3:3} -> (&dev->vqs_list_lock){+.+.}-{3:3}
      
       but this new dependency connects a HARDIRQ-irq-safe lock:
        (&channels[i].lock){-.-.}-{3:3}
      
       ... which became HARDIRQ-irq-safe at:
         lock_acquire+0x128/0x398
         _raw_spin_lock_irqsave+0x78/0x140
         scmi_vio_complete_cb+0xb4/0x3b8 [scmi_module]
         vring_interrupt+0x84/0x120
         vm_interrupt+0x94/0xe8
         __handle_irq_event_percpu+0xb4/0x3d8
         handle_irq_event_percpu+0x20/0x68
         handle_irq_event+0x50/0xb0
         handle_fasteoi_irq+0xac/0x138
         generic_handle_domain_irq+0x34/0x50
         gic_handle_irq+0xa0/0xd8
         call_on_irq_stack+0x2c/0x54
         do_interrupt_handler+0x8c/0x90
         el1_interrupt+0x40/0x78
         el1h_64_irq_handler+0x18/0x28
         el1h_64_irq+0x64/0x68
         _raw_write_unlock_irq+0x48/0x80
         ep_start_scan+0xf0/0x128
         do_epoll_wait+0x390/0x858
         do_compat_epoll_pwait.part.34+0x1c/0xb8
         __arm64_sys_epoll_pwait+0x80/0xd0
         invoke_syscall+0x4c/0x110
         el0_svc_common.constprop.3+0x98/0x120
         do_el0_svc+0x34/0xd0
         el0_svc+0x40/0x98
         el0t_64_sync_handler+0x98/0xc0
         el0t_64_sync+0x170/0x174
      
       to a HARDIRQ-irq-unsafe lock:
        (&dev->vqs_list_lock){+.+.}-{3:3}
      
       ... which became HARDIRQ-irq-unsafe at:
       ...
         lock_acquire+0x128/0x398
         _raw_spin_lock+0x58/0x70
         __vring_new_virtqueue+0x130/0x1c0
         vring_create_virtqueue+0xc4/0x2b8
         vm_find_vqs+0x20c/0x430
         init_vq+0x308/0x390
         virtblk_probe+0x114/0x9b0
         virtio_dev_probe+0x1a4/0x248
         really_probe+0xc8/0x3a8
         __driver_probe_device+0x84/0x190
         driver_probe_device+0x44/0x110
         __driver_attach+0x104/0x1e8
         bus_for_each_dev+0x7c/0xd0
         driver_attach+0x2c/0x38
         bus_add_driver+0x1e4/0x258
         driver_register+0x6c/0x128
         register_virtio_driver+0x2c/0x48
         virtio_blk_init+0x70/0xac
         do_one_initcall+0x84/0x420
         kernel_init_freeable+0x2d0/0x340
         kernel_init+0x2c/0x138
         ret_from_fork+0x10/0x20
      
       other info that might help us debug this:
      
        Possible interrupt unsafe locking scenario:
      
              CPU0                    CPU1
              ----                    ----
         lock(&dev->vqs_list_lock);
                                      local_irq_disable();
                                      lock(&channels[i].lock);
                                      lock(&dev->vqs_list_lock);
         <Interrupt>
           lock(&channels[i].lock);
      
        *** DEADLOCK ***
      ================
      
      Fixes: 42e90eb5 ("firmware: arm_scmi: Add a virtio channel refcount")
      Signed-off-by: default avatarCristian Marussi <cristian.marussi@arm.com>
      Link: https://lore.kernel.org/r/20221222183823.518856-6-cristian.marussi@arm.comSigned-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      e325285d
    • Cristian Marussi's avatar
      firmware: arm_scmi: Harden shared memory access in fetch_notification · 9bae076c
      Cristian Marussi authored
      A misbheaving SCMI platform firmware could reply with out-of-spec
      notifications, shorter than the mimimum size comprising a header.
      
      Fixes: d5141f37 ("firmware: arm_scmi: Add notifications support in transport layer")
      Signed-off-by: default avatarCristian Marussi <cristian.marussi@arm.com>
      Link: https://lore.kernel.org/r/20221222183823.518856-4-cristian.marussi@arm.comSigned-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      9bae076c
    • Cristian Marussi's avatar
      firmware: arm_scmi: Harden shared memory access in fetch_response · ad78b81a
      Cristian Marussi authored
      A misbheaving SCMI platform firmware could reply with out-of-spec messages,
      shorter than the mimimum size comprising a header and a status field.
      
      Harden shmem_fetch_response to properly truncate such a bad messages.
      
      Fixes: 5c8a47a5 ("firmware: arm_scmi: Make scmi core independent of the transport type")
      Signed-off-by: default avatarCristian Marussi <cristian.marussi@arm.com>
      Link: https://lore.kernel.org/r/20221222183823.518856-3-cristian.marussi@arm.comSigned-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      ad78b81a
    • Cristian Marussi's avatar
      firmware: arm_scmi: Clear stale xfer->hdr.status · f6ca5059
      Cristian Marussi authored
      Stale error status reported from a previous message transaction must be
      cleared before starting a new transaction to avoid being confusingly
      reported in the following SCMI message dump traces.
      Signed-off-by: default avatarCristian Marussi <cristian.marussi@arm.com>
      Link: https://lore.kernel.org/r/20221222183823.518856-2-cristian.marussi@arm.comSigned-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      f6ca5059
  3. 01 Jan, 2023 6 commits
  4. 31 Dec, 2022 2 commits
  5. 30 Dec, 2022 19 commits
  6. 29 Dec, 2022 3 commits
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 2258c2dc
      Linus Torvalds authored
      Pull kvm fixes from Paolo Bonzini:
       "Changes that were posted too late for 6.1, or after the release.
      
        x86:
      
         - several fixes to nested VMX execution controls
      
         - fixes and clarification to the documentation for Xen emulation
      
         - do not unnecessarily release a pmu event with zero period
      
         - MMU fixes
      
         - fix Coverity warning in kvm_hv_flush_tlb()
      
        selftests:
      
         - fixes for the ucall mechanism in selftests
      
         - other fixes mostly related to compilation with clang"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (41 commits)
        KVM: selftests: restore special vmmcall code layout needed by the harness
        Documentation: kvm: clarify SRCU locking order
        KVM: x86: fix deadlock for KVM_XEN_EVTCHN_RESET
        KVM: x86/xen: Documentation updates and clarifications
        KVM: x86/xen: Add KVM_XEN_INVALID_GPA and KVM_XEN_INVALID_GFN to uapi
        KVM: x86/xen: Simplify eventfd IOCTLs
        KVM: x86/xen: Fix SRCU/RCU usage in readers of evtchn_ports
        KVM: x86/xen: Use kvm_read_guest_virt() instead of open-coding it badly
        KVM: x86/xen: Fix memory leak in kvm_xen_write_hypercall_page()
        KVM: Delete extra block of "};" in the KVM API documentation
        kvm: x86/mmu: Remove duplicated "be split" in spte.h
        kvm: Remove the unused macro KVM_MMU_READ_{,UN}LOCK()
        MAINTAINERS: adjust entry after renaming the vmx hyperv files
        KVM: selftests: Mark correct page as mapped in virt_map()
        KVM: arm64: selftests: Don't identity map the ucall MMIO hole
        KVM: selftests: document the default implementation of vm_vaddr_populate_bitmap
        KVM: selftests: Use magic value to signal ucall_alloc() failure
        KVM: selftests: Disable "gnu-variable-sized-type-not-at-end" warning
        KVM: selftests: Include lib.mk before consuming $(CC)
        KVM: selftests: Explicitly disable builtins for mem*() overrides
        ...
      2258c2dc
    • Jens Axboe's avatar
      Merge tag 'nvme-6.2-2022-12-29' of git://git.infradead.org/nvme into block-6.2 · 1551ed5a
      Jens Axboe authored
      Pull NVMe fixes from Christoph:
      
      "nvme fixes for Linux 6.2
      
       - fix various problems in handling the Command Supported and Effects log
         (Christoph Hellwig)
       - don't allow unprivileged passthrough of commands that don't transfer
         data but modify logical block content (Christoph Hellwig)
       - add a features and quirks policy document (Christoph Hellwig)
       - fix some really nasty code that was correct but made smatch complain
         (Sagi Grimberg)"
      
      * tag 'nvme-6.2-2022-12-29' of git://git.infradead.org/nvme:
        nvme-auth: fix smatch warning complaints
        nvme: consult the CSE log page for unprivileged passthrough
        nvme: also return I/O command effects from nvme_command_effects
        nvmet: don't defer passthrough commands with trivial effects to the workqueue
        nvmet: set the LBCC bit for commands that modify data
        nvmet: use NVME_CMD_EFFECTS_CSUPP instead of open coding it
        nvme: fix the NVME_CMD_EFFECTS_CSE_MASK definition
        docs, nvme: add a feature and quirk policy document
      1551ed5a
    • Bhaskar Chowdhury's avatar
      kconfig: Add static text for search information in help menu · da8daff9
      Bhaskar Chowdhury authored
      Add few static text to explain how one can bring up the search dialog
      box by pressing the forward slash key anywhere on this interface.
      Signed-off-by: default avatarBhaskar Chowdhury <unixbhaskar@gmail.com>
      Acked-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      da8daff9
  7. 28 Dec, 2022 4 commits