linux-stable/drivers/pci
Michael Kelley 2c6ba42168 PCI: hv: Enable PCI pass-thru devices in Confidential VMs
For PCI pass-thru devices in a Confidential VM, Hyper-V requires
that PCI config space be accessed via hypercalls.  In normal VMs,
config space accesses are trapped to the Hyper-V host and emulated.
But in a confidential VM, the host can't access guest memory to
decode the instruction for emulation, so an explicit hypercall must
be used.

Add functions to make the new MMIO read and MMIO write hypercalls.
Update the PCI config space access functions to use the hypercalls
when such use is indicated by Hyper-V flags.  Also, set the flag to
allow the Hyper-V PCI driver to be loaded and used in a Confidential
VM (a.k.a., "Isolation VM").  The driver has previously been hardened
against a malicious Hyper-V host[1].

[1] https://lore.kernel.org/all/20220511223207.3386-2-parri.andrea@gmail.com/

Co-developed-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Reviewed-by: Boqun Feng <boqun.feng@gmail.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Link: https://lore.kernel.org/r/1679838727-87310-13-git-send-email-mikelley@microsoft.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
2023-04-17 19:19:04 +00:00
..
controller PCI: hv: Enable PCI pass-thru devices in Confidential VMs 2023-04-17 19:19:04 +00:00
endpoint Merge branch 'pci/misc' 2023-02-22 13:47:32 -06:00
hotplug Merge branch 'pci/kbuild' 2023-02-22 13:47:25 -06:00
msi PCI/MSI: Clarify usage of pci_msix_free_irq() 2023-02-21 08:25:14 +01:00
pcie pci-v6.3-changes 2023-02-24 16:51:40 -08:00
switch PCI: switchtec: Return -EFAULT for copy_to_user() errors 2023-01-18 11:11:20 -06:00
access.c PCI: Access Link 2 registers only for devices with Links 2022-11-04 10:38:11 -05:00
ats.c PCI: Enable PASID only when ACS RR & UF enabled on upstream path 2022-11-03 15:47:47 +01:00
bus.c PCI: s390: Fix use-after-free of PCI resources with per-function hotplug 2023-03-13 09:15:11 +01:00
doe.c PCI/DOE: Fix memory leak with CONFIG_DEBUG_OBJECTS=y 2023-04-03 16:17:21 -07:00
ecam.c
host-bridge.c
iov.c PCI/IOV: Enlarge virtfn sysfs name buffer 2023-01-18 10:54:41 -06:00
irq.c PCI: Check for alloc failure in pci_request_irq() 2022-11-21 16:55:18 -06:00
Kconfig genirq: Get rid of GENERIC_MSI_IRQ_DOMAIN 2022-11-17 15:15:20 +01:00
Makefile PCI/DOE: Add DOE mailbox support functions 2022-07-19 15:38:04 -07:00
mmap.c PCI: Remove pci_mmap_page_range() wrapper 2022-07-29 12:08:44 -05:00
of.c IOMMU Updates for Linux v5.19 2022-05-31 09:56:54 -07:00
p2pdma.c PCI/P2PDMA: Annotate RCU dereference 2023-02-16 16:31:12 -06:00
pci-acpi.c PCI/ACPI: Account for _S0W of the target bridge in acpi_pci_bridge_d3() 2023-01-13 15:56:10 -06:00
pci-bridge-emul.c PCI: pci-bridge-emul: Set position of PCI capabilities to real HW value 2022-08-25 12:07:56 +02:00
pci-bridge-emul.h PCI: pci-bridge-emul: Set position of PCI capabilities to real HW value 2022-08-25 12:07:56 +02:00
pci-driver.c pci-v6.3-changes 2023-02-24 16:51:40 -08:00
pci-label.c
pci-mid.c
pci-pf-stub.c
pci-stub.c PCI: pci_stub: Set driver_managed_dma 2022-04-28 15:32:20 +02:00
pci-sysfs.c pci-v6.2-changes 2022-12-14 09:54:10 -08:00
pci.c pci-v6.3-changes 2023-02-24 16:51:40 -08:00
pci.h pci-v6.3-changes 2023-02-24 16:51:40 -08:00
probe.c cxl for v6.3 2023-02-25 09:19:23 -08:00
proc.c PCI: Remove pci_mmap_page_range() wrapper 2022-07-29 12:08:44 -05:00
quirks.c virtio,vhost,vdpa: features, fixes 2023-02-25 11:48:02 -08:00
remove.c PCI: Fix use-after-free in pci_bus_release_domain_nr() 2023-04-06 18:20:59 -05:00
rom.c
search.c
setup-bus.c PCI: Distribute available resources for root buses, too 2023-02-07 11:36:35 -06:00
setup-irq.c
setup-res.c PCI: Sanitise firmware BAR assignments behind a PCI-PCI bridge 2022-09-21 17:52:47 -05:00
slot.c PCI/sysfs: Constify struct kobj_type pci_slot_ktype 2023-02-16 12:00:25 -06:00
syscall.c
vc.c
vgaarb.c PCI/VGA: Replace full MIT license text with SPDX identifier 2022-03-09 18:31:34 -06:00
vpd.c
xen-pcifront.c xen: make remove callback of xen driver void returned 2022-12-15 16:06:10 +01:00