asm-generic/hyperv: import data structures for mapping device interrupts
authorWei Liu <wei.liu@kernel.org>
Wed, 3 Feb 2021 15:04:33 +0000 (15:04 +0000)
committerWei Liu <wei.liu@kernel.org>
Thu, 11 Feb 2021 08:47:06 +0000 (08:47 +0000)
Signed-off-by: Sunil Muthuswamy <sunilmut@microsoft.com>
Co-Developed-by: Sunil Muthuswamy <sunilmut@microsoft.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20210203150435.27941-15-wei.liu@kernel.org
arch/x86/include/asm/hyperv-tlfs.h
include/asm-generic/hyperv-tlfs.h

index e3a6a723d661da20797fc4d4c8ea20555d4a1684..e6cd3fee562bff1704b2c4fcfeec9a8f156e509e 100644 (file)
@@ -548,6 +548,19 @@ struct hv_partition_assist_pg {
        u32 tlb_lock_count;
 };
 
+enum hv_interrupt_type {
+       HV_X64_INTERRUPT_TYPE_FIXED             = 0x0000,
+       HV_X64_INTERRUPT_TYPE_LOWESTPRIORITY    = 0x0001,
+       HV_X64_INTERRUPT_TYPE_SMI               = 0x0002,
+       HV_X64_INTERRUPT_TYPE_REMOTEREAD        = 0x0003,
+       HV_X64_INTERRUPT_TYPE_NMI               = 0x0004,
+       HV_X64_INTERRUPT_TYPE_INIT              = 0x0005,
+       HV_X64_INTERRUPT_TYPE_SIPI              = 0x0006,
+       HV_X64_INTERRUPT_TYPE_EXTINT            = 0x0007,
+       HV_X64_INTERRUPT_TYPE_LOCALINT0         = 0x0008,
+       HV_X64_INTERRUPT_TYPE_LOCALINT1         = 0x0009,
+       HV_X64_INTERRUPT_TYPE_MAXIMUM           = 0x000A,
+};
 
 #include <asm-generic/hyperv-tlfs.h>
 
index 20457a85c0460254c7e2b611f82eabfa22b310b1..83448e837dedb82fac90f8d52d26620605d01ff1 100644 (file)
@@ -153,6 +153,8 @@ struct ms_hyperv_tsc_page {
 #define HVCALL_RETRIEVE_DEBUG_DATA             0x006a
 #define HVCALL_RESET_DEBUG_SESSION             0x006b
 #define HVCALL_ADD_LOGICAL_PROCESSOR           0x0076
+#define HVCALL_MAP_DEVICE_INTERRUPT            0x007c
+#define HVCALL_UNMAP_DEVICE_INTERRUPT          0x007d
 #define HVCALL_RETARGET_INTERRUPT              0x007e
 #define HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_SPACE 0x00af
 #define HVCALL_FLUSH_GUEST_PHYSICAL_ADDRESS_LIST 0x00b0
@@ -703,4 +705,38 @@ union hv_device_id {
        } acpi;
 } __packed;
 
+enum hv_interrupt_trigger_mode {
+       HV_INTERRUPT_TRIGGER_MODE_EDGE = 0,
+       HV_INTERRUPT_TRIGGER_MODE_LEVEL = 1,
+};
+
+struct hv_device_interrupt_descriptor {
+       u32 interrupt_type;
+       u32 trigger_mode;
+       u32 vector_count;
+       u32 reserved;
+       struct hv_device_interrupt_target target;
+} __packed;
+
+struct hv_input_map_device_interrupt {
+       u64 partition_id;
+       u64 device_id;
+       u64 flags;
+       struct hv_interrupt_entry logical_interrupt_entry;
+       struct hv_device_interrupt_descriptor interrupt_descriptor;
+} __packed;
+
+struct hv_output_map_device_interrupt {
+       struct hv_interrupt_entry interrupt_entry;
+} __packed;
+
+struct hv_input_unmap_device_interrupt {
+       u64 partition_id;
+       u64 device_id;
+       struct hv_interrupt_entry interrupt_entry;
+} __packed;
+
+#define HV_SOURCE_SHADOW_NONE               0x0
+#define HV_SOURCE_SHADOW_BRIDGE_BUS_RANGE   0x1
+
 #endif