Skip to content

Commit 6553ff3

Browse files
committed
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
2 parents 28b7518 + d9932b4 commit 6553ff3

File tree

7 files changed

+331
-67
lines changed

7 files changed

+331
-67
lines changed

arch/arm64/include/asm/hyperv-tlfs.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@
6464
#define HV_REGISTER_STIMER0_CONFIG 0x000B0000
6565
#define HV_REGISTER_STIMER0_COUNT 0x000B0001
6666

67+
union hv_msi_entry {
68+
u64 as_uint64[2];
69+
struct {
70+
u64 address;
71+
u32 data;
72+
u32 reserved;
73+
} __packed;
74+
};
75+
6776
#include <asm-generic/hyperv-tlfs.h>
6877

6978
#endif

arch/x86/include/asm/hyperv-tlfs.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,39 @@ enum hv_interrupt_type {
602602
HV_X64_INTERRUPT_TYPE_MAXIMUM = 0x000A,
603603
};
604604

605+
union hv_msi_address_register {
606+
u32 as_uint32;
607+
struct {
608+
u32 reserved1:2;
609+
u32 destination_mode:1;
610+
u32 redirection_hint:1;
611+
u32 reserved2:8;
612+
u32 destination_id:8;
613+
u32 msi_base:12;
614+
};
615+
} __packed;
616+
617+
union hv_msi_data_register {
618+
u32 as_uint32;
619+
struct {
620+
u32 vector:8;
621+
u32 delivery_mode:3;
622+
u32 reserved1:3;
623+
u32 level_assert:1;
624+
u32 trigger_mode:1;
625+
u32 reserved2:16;
626+
};
627+
} __packed;
628+
629+
/* HvRetargetDeviceInterrupt hypercall */
630+
union hv_msi_entry {
631+
u64 as_uint64;
632+
struct {
633+
union hv_msi_address_register address;
634+
union hv_msi_data_register data;
635+
} __packed;
636+
};
637+
605638
#include <asm-generic/hyperv-tlfs.h>
606639

607640
#endif

arch/x86/include/asm/mshyperv.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,6 @@ bool hv_vcpu_is_preempted(int vcpu);
169169
static inline void hv_apic_init(void) {}
170170
#endif
171171

172-
static inline void hv_set_msi_entry_from_desc(union hv_msi_entry *msi_entry,
173-
struct msi_desc *msi_desc)
174-
{
175-
msi_entry->address.as_uint32 = msi_desc->msg.address_lo;
176-
msi_entry->data.as_uint32 = msi_desc->msg.data;
177-
}
178-
179172
struct irq_domain *hv_create_pci_msi_domain(void);
180173

181174
int hv_map_ioapic_interrupt(int ioapic_id, bool level, int vcpu, int vector,

drivers/pci/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ config PCI_LABEL
184184

185185
config PCI_HYPERV
186186
tristate "Hyper-V PCI Frontend"
187-
depends on X86_64 && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && SYSFS
187+
depends on ((X86 && X86_64) || ARM64) && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && SYSFS
188188
select PCI_HYPERV_INTERFACE
189189
help
190190
The PCI device frontend driver allows the kernel to import arbitrary

drivers/pci/controller/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ config PCIE_BRCMSTB
281281

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

0 commit comments

Comments
 (0)