WSL2-Linux-Kernel/arch/x86
Jeffrey Hugo 35d24b115a PCI: hv: Fix hv_arch_irq_unmask() for multi-MSI
commit 455880dfe2 upstream.

In the multi-MSI case, hv_arch_irq_unmask() will only operate on the first
MSI of the N allocated.  This is because only the first msi_desc is cached
and it is shared by all the MSIs of the multi-MSI block.  This means that
hv_arch_irq_unmask() gets the correct address, but the wrong data (always
0).

This can break MSIs.

Lets assume MSI0 is vector 34 on CPU0, and MSI1 is vector 33 on CPU0.

hv_arch_irq_unmask() is called on MSI0.  It uses a hypercall to configure
the MSI address and data (0) to vector 34 of CPU0.  This is correct.  Then
hv_arch_irq_unmask is called on MSI1.  It uses another hypercall to
configure the MSI address and data (0) to vector 33 of CPU0.  This is
wrong, and results in both MSI0 and MSI1 being routed to vector 33.  Linux
will observe extra instances of MSI1 and no instances of MSI0 despite the
endpoint device behaving correctly.

For the multi-MSI case, we need unique address and data info for each MSI,
but the cached msi_desc does not provide that.  However, that information
can be gotten from the int_desc cached in the chip_data by
compose_msi_msg().  Fix the multi-MSI case to use that cached information
instead.  Since hv_set_msi_entry_from_desc() is no longer applicable,
remove it.

5.15 backport - no changes to code, but merge conflict due to refactor.

Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/1651068453-29588-1-git-send-email-quic_jhugo@quicinc.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Carl Vanderlip <quic_carlv@quicinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-29 17:25:06 +02:00
..
boot x86: Prepare asm files for straight-line-speculation 2022-05-15 20:18:49 +02:00
configs x86/kbuild: Enable CONFIG_KALLSYMS_ALL=y in the defconfigs 2022-01-27 11:04:56 +01:00
crypto lib/crypto: blake2s: avoid indirect calls to compression function for Clang CFI 2022-05-30 09:28:59 +02:00
entry x86/entry: Move PUSH_AND_CLEAR_REGS() back into error_entry 2022-07-23 12:54:10 +02:00
events perf/amd/ibs: Use interrupt regs ip for stack unwinding 2022-06-09 10:22:55 +02:00
hyperv x86/hyperv: Properly deal with empty cpumasks in hyperv_flush_tlb_multi() 2022-03-08 19:12:36 +01:00
ia32 binfmt: remove in-tree usage of MAP_DENYWRITE 2021-09-03 18:42:01 +02:00
include PCI: hv: Fix hv_arch_irq_unmask() for multi-MSI 2022-07-29 17:25:06 +02:00
kernel x86/bugs: Remove apostrophe typo 2022-07-23 12:54:13 +02:00
kvm KVM: emulate: do not adjust size of fastop and setcc subroutines 2022-07-23 12:54:13 +02:00
lib x86/retbleed: Add fine grained Kconfig knobs 2022-07-23 12:54:10 +02:00
math-emu x86: Prepare asm files for straight-line-speculation 2022-05-15 20:18:49 +02:00
mm objtool: Update Retpoline validation 2022-07-23 12:54:04 +02:00
net x86/bpf: Use alternative RET encoding 2022-07-23 12:53:59 +02:00
pci x86/PCI: Fix ALi M1487 (IBC) PIRQ router link value interpretation 2022-06-09 10:22:46 +02:00
platform efi/x86: use naked RET on mixed mode call wrapper 2022-07-23 12:54:12 +02:00
power x86: Prepare asm files for straight-line-speculation 2022-05-15 20:18:49 +02:00
purgatory kernel.h: split out panic and oops helpers 2021-07-01 11:06:04 -07:00
ras
realmode x86/mm: Flush global TLB when switching to trampoline page-table 2022-01-27 11:04:35 +01:00
tools - Remove cc-option checks which are old and already supported by the 2021-08-30 13:27:16 -07:00
um um: Fix out-of-bounds read in LDT setup 2022-06-09 10:23:27 +02:00
video
xen x86/xen: Fix initialisation in hypercall_page after rethunk 2022-07-23 12:54:11 +02:00
.gitignore
Kbuild
Kconfig x86/retbleed: Add fine grained Kconfig knobs 2022-07-23 12:54:10 +02:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug tracing: Refactor TRACE_IRQFLAGS_SUPPORT in Kconfig 2021-08-16 11:37:21 -04:00
Makefile x86/realmode: build with -D__DISABLE_EXPORTS 2022-07-23 12:53:56 +02:00
Makefile.um um: allow not setting extra rpaths in the linux binary 2021-06-17 21:54:15 +02:00
Makefile_32.cpu x86/build: Do not add -falign flags unconditionally for clang 2021-09-19 10:35:53 +09:00