kernel_optimize_test/arch/x86
Jeffrey Hugo 73bf070408 PCI: hv: Fix hv_arch_irq_unmask() for multi-MSI
commit 455880dfe292a2bdd3b4ad6a107299fce610e64b 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.10 backport - removed unused hv_set_msi_entry_from_desc function from
mshyperv.h instead of pci-hyperv.c. msi_entry.address/data.as_uint32
changed to direct reference (as they are u32's, just sans union).

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:19:09 +02:00
..
boot x86: Prepare asm files for straight-line-speculation 2022-07-25 11:26:28 +02:00
configs
crypto crypto: x86/poly1305 - Fixup SLS 2022-07-25 11:26:32 +02:00
entry x86/retbleed: Add fine grained Kconfig knobs 2022-07-25 11:26:50 +02:00
events perf/amd/ibs: Use interrupt regs ip for stack unwinding 2022-06-09 10:21:07 +02:00
hyperv
ia32
include PCI: hv: Fix hv_arch_irq_unmask() for multi-MSI 2022-07-29 17:19:09 +02:00
kernel x86/bugs: Remove apostrophe typo 2022-07-25 11:26:55 +02:00
kvm kvm: fix objtool relocation warning 2022-07-25 11:26:55 +02:00
lib x86/retbleed: Add fine grained Kconfig knobs 2022-07-25 11:26:50 +02:00
math-emu x86: Prepare asm files for straight-line-speculation 2022-07-25 11:26:28 +02:00
mm objtool: Update Retpoline validation 2022-07-25 11:26:44 +02:00
net x86/bpf: Use alternative RET encoding 2022-07-25 11:26:38 +02:00
oprofile
pci x86/pci/xen: Disable PCI/MSI[-X] masking for XEN_HVM guests 2022-05-09 09:05:00 +02:00
platform efi/x86: use naked RET on mixed mode call wrapper 2022-07-25 11:26:53 +02:00
power x86: Prepare asm files for straight-line-speculation 2022-07-25 11:26:28 +02:00
purgatory
ras
realmode
tools
um x86: Prepare asm files for straight-line-speculation 2022-07-25 11:26:28 +02:00
video
xen x86/xen: Fix initialisation in hypercall_page after rethunk 2022-07-25 11:26:52 +02:00
.gitignore
Kbuild
Kconfig x86/retbleed: Add fine grained Kconfig knobs 2022-07-25 11:26:50 +02:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug
Makefile x86/realmode: build with -D__DISABLE_EXPORTS 2022-07-25 11:26:33 +02:00
Makefile_32.cpu
Makefile.um