]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: hv: Reuse existing IRTE allocation in compose_msi_msg()
authorJeffrey Hugo <quic_jhugo@quicinc.com>
Mon, 18 Jul 2022 15:20:31 +0000 (15:20 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Jul 2022 15:25:06 +0000 (17:25 +0200)
commit0b80a410c20c641365e97c07d7af0473c8e7817a
treeebc56f2b847847ae5e0432c46f8bd43cb35d3338
parent339ba902ba6108598a140815d8475b5b8d3c9717
PCI: hv: Reuse existing IRTE allocation in compose_msi_msg()

commit e1828508621f8938ce350019d5c9d87ffda5f667 upstream.

Currently if compose_msi_msg() is called multiple times, it will free any
previous IRTE allocation, and generate a new allocation.  While nothing
prevents this from occurring, it is extraneous when Linux could just reuse
the existing allocation and avoid a bunch of overhead.

However, when future IRTE allocations operate on blocks of MSIs instead of
a single line, freeing the allocation will impact all of the lines.  This
could cause an issue where an allocation of N MSIs occurs, then some of
the lines are retargeted, and finally the allocation is freed/reallocated.
The freeing of the allocation removes all of the configuration for the
entire block, which requires all the lines to be retargeted, which might
not happen since some lines might already be unmasked/active.

Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Dexuan Cui <decui@microsoft.com>
Tested-by: Dexuan Cui <decui@microsoft.com>
Tested-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/1652282582-21595-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>
drivers/pci/controller/pci-hyperv.c