Patch "PCI: hv: Propagate coherence from VMbus device to PCI device" has been added to the 5.17-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    PCI: hv: Propagate coherence from VMbus device to PCI device

to the 5.17-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     pci-hv-propagate-coherence-from-vmbus-device-to-pci-.patch
and it can be found in the queue-5.17 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit cac87d8f019848cc8af0283c18f782b73ed19af2
Author: Michael Kelley <mikelley@xxxxxxxxxxxxx>
Date:   Thu Mar 24 09:14:52 2022 -0700

    PCI: hv: Propagate coherence from VMbus device to PCI device
    
    [ Upstream commit 8d21732475c637c7efcdb91dc927a4c594e97898 ]
    
    PCI pass-thru devices in a Hyper-V VM are represented as a VMBus
    device and as a PCI device.  The coherence of the VMbus device is
    set based on the VMbus node in ACPI, but the PCI device has no
    ACPI node and defaults to not hardware coherent.  This results
    in extra software coherence management overhead on ARM64 when
    devices are hardware coherent.
    
    Fix this by setting up the PCI host bus so that normal
    PCI mechanisms will propagate the coherence of the VMbus
    device to the PCI device. There's no effect on x86/x64 where
    devices are always hardware coherent.
    
    Signed-off-by: Michael Kelley <mikelley@xxxxxxxxxxxxx>
    Acked-by: Boqun Feng <boqun.feng@xxxxxxxxx>
    Acked-by: Robin Murphy <robin.murphy@xxxxxxx>
    Link: https://lore.kernel.org/r/1648138492-2191-3-git-send-email-mikelley@xxxxxxxxxxxxx
    Signed-off-by: Wei Liu <wei.liu@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/pci/controller/pci-hyperv.c b/drivers/pci/controller/pci-hyperv.c
index ae0bc2fee4ca..88b3b56d0522 100644
--- a/drivers/pci/controller/pci-hyperv.c
+++ b/drivers/pci/controller/pci-hyperv.c
@@ -3404,6 +3404,15 @@ static int hv_pci_probe(struct hv_device *hdev,
 	hbus->bridge->domain_nr = dom;
 #ifdef CONFIG_X86
 	hbus->sysdata.domain = dom;
+#elif defined(CONFIG_ARM64)
+	/*
+	 * Set the PCI bus parent to be the corresponding VMbus
+	 * device. Then the VMbus device will be assigned as the
+	 * ACPI companion in pcibios_root_bridge_prepare() and
+	 * pci_dma_configure() will propagate device coherence
+	 * information to devices created on the bus.
+	 */
+	hbus->sysdata.parent = hdev->device.parent;
 #endif
 
 	hbus->hdev = hdev;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux