1. 27 Jan, 2023 1 commit
    • Robert Richter's avatar
      cxl/mbox: Fix Payload Length check for Get Log command · 623c0751
      Robert Richter authored
      Commit 2aeaf663 introduced strict checking for variable length
      payload size validation. The payload length of received data must
      match the size of the requested data by the caller except for the case
      where the min_out value is set.
      
      The Get Log command does not have a header with a length field set.
      The Log size is determined by the Get Supported Logs command (CXL 3.0,
      8.2.9.5.1). However, the actual size can be smaller and the number of
      valid bytes in the payload output must be determined reading the
      Payload Length field (CXL 3.0, Table 8-36, Note 2).
      
      Two issues arise: The command can successfully complete with a payload
      length of zero. And, the valid payload length must then also be
      consumed by the caller.
      
      Change cxl_xfer_log() to pass the number of payload bytes back to the
      caller to determine the number of log entries. Implement the payload
      handling as a special case where mbox_cmd->size_out is consulted when
      cxl_internal_send_cmd() returns -EIO. A WARN_ONCE() is added to check
      that -EIO is only returned in case of an unexpected output size.
      
      Logs can be bigger than the maximum payload length and multiple Get
      Log commands can be issued. If the received payload size is smaller
      than the maximum payload size we can assume all valid bytes have been
      fetched. Stop sending further Get Log commands then.
      
      On that occasion, change debug messages to also report the opcodes of
      supported commands.
      
      The variable payload commands GET_LSA and SET_LSA are not affected by
      this strict check: SET_LSA cannot be broken because SET_LSA does not
      return an output payload, and GET_LSA never expects short reads.
      
      Fixes: 2aeaf663 ("cxl/mbox: Add variable output size validation for internal commands")
      Signed-off-by: default avatarRobert Richter <rrichter@amd.com>
      Reviewed-by: default avatarDave Jiang <dave.jiang@intel.com>
      Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
      Link: https://lore.kernel.org/r/20230119094934.86067-1-rrichter@amd.comSigned-off-by: default avatarDan Williams <dan.j.williams@intel.com>
      623c0751
  2. 26 Jan, 2023 3 commits
  3. 25 Jan, 2023 4 commits
  4. 05 Jan, 2023 4 commits
  5. 01 Jan, 2023 6 commits
  6. 31 Dec, 2022 2 commits
  7. 30 Dec, 2022 19 commits
  8. 29 Dec, 2022 1 commit
    • 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