Commit 6553ff3d authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

Merge branch 'pci/host/hv'

- Add hv-internal interfaces to encapsulate arch IRQ dependencies (Sunil
  Muthuswamy)

- Add arm64 Hyper-V vPCI support (Sunil Muthuswamy)

* pci/host/hv:
  PCI: hv: Add arm64 Hyper-V vPCI support
  PCI: hv: Make the code arch neutral by adding arch specific interfaces
parents 28b75189 d9932b46
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -64,6 +64,15 @@
#define HV_REGISTER_STIMER0_CONFIG	0x000B0000
#define HV_REGISTER_STIMER0_COUNT	0x000B0001

union hv_msi_entry {
	u64 as_uint64[2];
	struct {
		u64 address;
		u32 data;
		u32 reserved;
	} __packed;
};

#include <asm-generic/hyperv-tlfs.h>

#endif
+33 −0
Original line number Diff line number Diff line
@@ -602,6 +602,39 @@ enum hv_interrupt_type {
	HV_X64_INTERRUPT_TYPE_MAXIMUM           = 0x000A,
};

union hv_msi_address_register {
	u32 as_uint32;
	struct {
		u32 reserved1:2;
		u32 destination_mode:1;
		u32 redirection_hint:1;
		u32 reserved2:8;
		u32 destination_id:8;
		u32 msi_base:12;
	};
} __packed;

union hv_msi_data_register {
	u32 as_uint32;
	struct {
		u32 vector:8;
		u32 delivery_mode:3;
		u32 reserved1:3;
		u32 level_assert:1;
		u32 trigger_mode:1;
		u32 reserved2:16;
	};
} __packed;

/* HvRetargetDeviceInterrupt hypercall */
union hv_msi_entry {
	u64 as_uint64;
	struct {
		union hv_msi_address_register address;
		union hv_msi_data_register data;
	} __packed;
};

#include <asm-generic/hyperv-tlfs.h>

#endif
+0 −7
Original line number Diff line number Diff line
@@ -169,13 +169,6 @@ bool hv_vcpu_is_preempted(int vcpu);
static inline void hv_apic_init(void) {}
#endif

static inline void hv_set_msi_entry_from_desc(union hv_msi_entry *msi_entry,
					      struct msi_desc *msi_desc)
{
	msi_entry->address.as_uint32 = msi_desc->msg.address_lo;
	msi_entry->data.as_uint32 = msi_desc->msg.data;
}

struct irq_domain *hv_create_pci_msi_domain(void);

int hv_map_ioapic_interrupt(int ioapic_id, bool level, int vcpu, int vector,
+1 −1
Original line number Diff line number Diff line
@@ -184,7 +184,7 @@ config PCI_LABEL

config PCI_HYPERV
	tristate "Hyper-V PCI Frontend"
	depends on X86_64 && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && SYSFS
	depends on ((X86 && X86_64) || ARM64) && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && SYSFS
	select PCI_HYPERV_INTERFACE
	help
	  The PCI device frontend driver allows the kernel to import arbitrary
+1 −1
Original line number Diff line number Diff line
@@ -281,7 +281,7 @@ config PCIE_BRCMSTB

config PCI_HYPERV_INTERFACE
	tristate "Hyper-V PCI Interface"
	depends on X86 && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && X86_64
	depends on ((X86 && X86_64) || ARM64) && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN
	help
	  The Hyper-V PCI Interface is a helper driver allows other drivers to
	  have a common interface with the Hyper-V PCI frontend driver.
Loading