[Hyper-V] PCI Passthrough prerequisites

Bug #1541120 reported by Joshua R. Poulson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
Undecided
Tim Gardner
Xenial
Fix Released
Undecided
Tim Gardner

Bug Description

Jake Oshins (Microsoft) has submitted upstream the PCI Passthrough feature, and while it is not yet accepted upstream (because of the effect on multiple trees and affects PCI), Microsoft would like Canonical to consider its inclusion in Ubuntu 16.04 and beyond. The rounds of feedback on the patches are winding down, so it is a good time to consider them.

All of the submitted files are in the attached thread, but not all are committed to Linus's tree as of 4.5-rc1.

This feature is needed for supporting SR-IOV and GPU passthrough on Hyper-V.

The 10th iteration of the upstream submission is available on lkml:

https://lkml.org/lkml/2015/12/10/553

From jakeo@microsof ...
Subject [PATCH v10 0/7] PCI: hv: New paravirtual PCI front-end for Hyper-V VMs
Date Thu, 10 Dec 2015 17:52:56 +0000
From: Jake Oshins <email address hidden>

This version of the patch series removes warning when compiling x86
32-bit while still making it build cleanly for x64.

First, export functions that allow correlating Hyper-V virtual processors
and Linux cpus, along with the means for invoking a hypercall that targets
interrupts at chosen vectors on specific cpus.

Second, mark various parts of IRQ domain related code as exported, so that
this PCI front-end can implement an IRQ domain as part of a module. (The
alternative would be to pull all tyhis into the kernel, which would pull
in a lot of other Hyper-V related code, as this IRQ domain depends on
vmbus.ko.)

Third, modify PCI so that new root PCI buses can be marked with an associated
fwnode_handle, and so that root PCI buses can look up their associated IRQ
domain by that handle.

Fourth, introduce a new driver, hv_pcifront, which exposes root PCI buses in
a Hyper-V VM. These root PCI buses expose real PCIe device, or PCI Virtual
Functions.

Jake Oshins (7):
  drivers:hv: Export a function that maps Linux CPU num onto Hyper-V
    proc num
  drivers:hv: Export hv_do_hypercall()
  PCI: Make it possible to implement a PCI MSI IRQ Domain in a module.
  PCI: Add fwnode_handle to pci_sysdata
  PCI: irqdomain: Look up IRQ domain by fwnode_handle
  drivers:hv: Define the channel type of Hyper-V PCI Express
    pass-through
  PCI: hv: New paravirtual PCI front-end for Hyper-V VMs

 MAINTAINERS | 1 +
 arch/x86/include/asm/msi.h | 6 +
 arch/x86/include/asm/pci.h | 15 +
 arch/x86/kernel/apic/msi.c | 8 +-
 arch/x86/kernel/apic/vector.c | 2 +
 drivers/hv/hv.c | 20 +-
 drivers/hv/hyperv_vmbus.h | 2 +-
 drivers/hv/vmbus_drv.c | 17 +
 drivers/pci/Kconfig | 7 +
 drivers/pci/host/Makefile | 1 +
 drivers/pci/host/hv_pcifront.c | 2249 ++++++++++++++++++++++++++++++++++++++++
 drivers/pci/msi.c | 4 +
 drivers/pci/probe.c | 15 +
 include/linux/hyperv.h | 14 +
 include/linux/pci.h | 4 +
 kernel/irq/chip.c | 1 +
 kernel/irq/irqdomain.c | 4 +
 17 files changed, 2356 insertions(+), 14 deletions(-)
 create mode 100644 drivers/pci/host/hv_pcifront.c

Accepted commits so far in 4.5-rc1:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=a108393dbf764efb2405f21ca759806c65b8bc16 drivers:hv: Export the API to invoke a hypercall on Hyper-V
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=619848bd074343ff2bdeeafca0be39748f6da372 drivers:hv: Export a function that maps Linux CPU num onto Hyper-V proc num
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=3053c762444a83ec6a8777f9476668b23b8ab180 drivers:hv: Define the channel type for Hyper-V PCI Express pass-through
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=40f26f3168bf7a4da490db308dc0bd9f9923f41f drivers:hv: Allow for MMIO claims that span ACPI _CRS records
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=a4289dc2ec3a5821076a78ee9678909b4eff297e genirq/msi: Export functions to allow MSI domains in modules
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=c8f3e518d3444ee9200a4987421fcee60f768f11 x86/irq: Export functions to allow MSI domains in modules

Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. From a terminal window please run:

apport-collect 1541120

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Joshua R. Poulson (jrp) wrote : Re: [Hyper-V] PCI Passthrough

This is a request to pull a feature from the upstream Linux kernel. No logs required, but we'll talk about how to test the feature when the time comes.

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Revision history for this message
Tim Gardner (timg-tpi) wrote :

Drivers: hv: vmbus: fix build warning
Drivers: hv: util: Increase the timeout for util services
Drivers: hv: utils: run polling callback always in interrupt context
tools: hv: report ENOSPC errors in hv_fcopy_daemon
tools: hv: remove repeated HV_FCOPY string
Drivers: hv: util: catch allocation errors
Drivers: hv: utils: use memdup_user in hvt_op_write
drivers/hv: cleanup synic msrs if vmbus connect failed
drivers:hv: Export a function that maps Linux CPU num onto Hyper-V proc num
drivers:hv: Export the API to invoke a hypercall on Hyper-V
drivers:hv: Define the channel type for Hyper-V PCI Express pass-through
Drivers: hv: vss: run only on supported host versions
Drivers: hv: vmbus: Use uuid_le type consistently
Drivers: hv: vmbus: Use uuid_le_cmp() for comparing GUIDs
Drivers: hv: vmbus: Get rid of the unused macro
Drivers: hv: vmbus: Get rid of the unused irq variable
Drivers: hv: vmbus: serialize process_chn_event() and vmbus_close_internal()
Drivers: hv: vmbus: do sanity check of channel state in vmbus_close_internal()
Drivers: hv: vmbus: fix rescind-offer handling for device without a driver
Drivers: hv: vmbus: release relid on error in vmbus_process_offer()
Drivers: hv: vmbus: channge vmbus_connection.channel_lock to mutex
drivers:hv: Allow for MMIO claims that span ACPI _CRS records
Drivers: hv: vmbus: Fix a Host signaling bug
drivers/hv: correct tsc page sequence invalid value
Drivers: hv: vmbus: Force all channel messages to be delivered on CPU 0
Drivers: hv: utils: Invoke the poll function after handshake
tools: hv: vss: fix the write()'s argument: error -> vss_msg
Drivers: hv: utils: fix memory leak on on_msg() failure
Drivers: hv: utils: rename outmsg_lock
Drivers: hv: utils: introduce HVUTIL_TRANSPORT_DESTROY mode
Drivers: hv: utils: fix crash when device is removed from host side
Drivers: hv: ring_buffer.c: fix comment style
Drivers: hv: ring_buffer: remove stray smp_read_barrier_depends()
Drivers: hv: ring_buffer: remove code duplication from hv_ringbuffer_peek/read()
Drivers: hv: remove code duplication between vmbus_recvpacket()/vmbus_recvpacket_raw()
Drivers: hv: ring_buffer: eliminate hv_ringbuffer_peek()
drivers/hv: replace enum hv_message_type by u32
drivers/hv: Move HV_SYNIC_STIMER_COUNT into Hyper-V UAPI x86 header
drivers/hv: Move struct hv_message into UAPI Hyper-V x86 header
drivers/hv: Move struct hv_timer_message_payload into UAPI Hyper-V x86 header
Drivers: hv: vmbus: fix the building warning with hyperv-keyboard
Drivers: hv: utils: fix hvt_op_poll() return value on transport destroy
Drivers: hv: vmbus: Treat Fibre Channel devices as performance critical
genirq/msi: Export functions to allow MSI domains in modules
x86/irq: Export functions to allow MSI domains in modules

Changed in linux (Ubuntu Xenial):
assignee: nobody → Tim Gardner (timg-tpi)
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (4.0 KiB)

This bug was fixed in the package linux - 4.4.0-4.19

---------------
linux (4.4.0-4.19) xenial; urgency=low

  * update ZFS and SPL to 0.6.5.4 (LP: #1542296)
    - [Config] update spl/zfs version
    - SAUCE: (noup) Update spl to 0.6.5.4-0ubuntu2, zfs to 0.6.5.4-0ubuntu1
    - [Config] reconstruct -- drop links for zfs userspace components
    - [Config] reconstruct -- drop links for zfs userspace components -- restore spec links

  * recvmsg() fails SCM_CREDENTIALS request with EOPNOTSUPP. (LP: #1540731)
    - Revert "af_unix: Revert 'lock_interruptible' in stream receive code"

  * lxc: ADT exercise test failing with linux-4.4.0-3.17 (LP: #1542049)
    - Revert "UBUNTU: SAUCE: apparmor: fix sleep from invalid context"

  * WARNING: at /build/linux-lts-wily-W0lTWH/linux-lts-wily-4.2.0/net/core/skbuff.c:4174 (Travis IB) (LP: #1541326)
    - SAUCE: IB/IPoIB: Do not set skb truesize since using one linearskb

  * backport Microsoft Precision Touchpad palm rejection patch (LP: #1541671)
    - HID: multitouch: enable palm rejection if device implements confidence usage

  * [Ubuntu 16.04] Update qla2xxx driver for POWER (QLogic) (LP: #1541456)
    - qla2xxx: Remove unavailable firmware files
    - qla2xxx: Enable Extended Logins support
    - qla2xxx: Enable Exchange offload support.
    - qla2xxx: Enable Target counters in DebugFS.
    - qla2xxx: Add FW resource count in DebugFS.
    - qla2xxx: Added interface to send explicit LOGO.
    - qla2xxx: Delete session if initiator is gone from FW
    - qla2xxx: Wait for all conflicts before ack'ing PLOGI
    - qla2xxx: Replace QLA_TGT_STATE_ABORTED with a bit.
    - qla2xxx: Remove dependency on hardware_lock to reduce lock contention.
    - qla2xxx: Add irq affinity notification
    - qla2xxx: Add selective command queuing
    - qla2xxx: Move atioq to a different lock to reduce lock contention
    - qla2xxx: Disable ZIO at start time.
    - qla2xxx: Set all queues to 4k
    - qla2xxx: Check for online flag instead of active reset when transmitting responses
    - scsi: qla2xxxx: avoid type mismatch in comparison

  * [Hyper-V] PCI Passthrough (LP: #1541120)
    - x86/irq: Export functions to allow MSI domains in modules
    - genirq/msi: Export functions to allow MSI domains in modules

  * Update lpfc driver to 11.0.0.10 (LP: #1541592)
    - lpfc: Fix FCF Infinite loop in lpfc_sli4_fcf_rr_next_index_get.
    - lpfc: Fix the FLOGI discovery logic to comply with T11 standards
    - lpfc: Fix RegLogin failed error seen on Lancer FC during port bounce
    - lpfc: Fix driver crash when module parameter lpfc_fcp_io_channel set to 16
    - lpfc: Fix crash in fcp command completion path.
    - lpfc: Modularize and cleanup FDMI code in driver
    - lpfc: Fix RDP Speed reporting.
    - lpfc: Fix RDP ACC being too long.
    - lpfc: Make write check error processing more resilient
    - lpfc: Use new FDMI speed definitions for 10G, 25G and 40G FCoE.
    - lpfc: Fix mbox reuse in PLOGI completion
    - lpfc: Fix external loopback failure.
    - lpfc: Add logging for misconfigured optics.
    - lpfc: Delete unnecessary checks before the function call "mempool_destroy"
    - lpfc: Use kzalloc instead of kmalloc
...

Read more...

Changed in linux (Ubuntu Xenial):
status: Fix Committed → Fix Released
Joshua R. Poulson (jrp)
summary: - [Hyper-V] PCI Passthrough
+ [Hyper-V] PCI Passthrough prerequisites
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.