Skip to content

Commit

Permalink
Drivers: hv: vmbus: Add hooks for per-CPU IRQ
Browse files Browse the repository at this point in the history
Add hooks to enable/disable a per-CPU IRQ for VMbus. These hooks
are in the architecture independent setup and shutdown paths for
Hyper-V, and are needed by Linux guests on Hyper-V on ARM64.  The
x86/x64 implementation is null because VMbus interrupts on x86/x64
don't use an IRQ.

TAG_MSFT: lcow
TAG_MSFT: wsl

Signed-off-by: Michael Kelley <mikelley@microsoft.com>
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
  • Loading branch information
kelleymh authored and Sasha Levin committed Aug 3, 2019
1 parent 5faa484 commit 1146b8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/x86/include/asm/mshyperv.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ void hyperv_vector_handler(struct pt_regs *regs);
void hv_setup_vmbus_irq(void (*handler)(void));
void hv_remove_vmbus_irq(void);

/* On x86/x64, there isn't a real IRQ to be enabled/disable */
static inline void hv_enable_vmbus_irq(void) {}
static inline void hv_disable_vmbus_irq(void) {}

void hv_setup_kexec_handler(void (*handler)(void));
void hv_remove_kexec_handler(void);
void hv_setup_crash_handler(void (*handler)(struct pt_regs *regs));
Expand Down
2 changes: 2 additions & 0 deletions drivers/hv/hv.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ int hv_synic_init(unsigned int cpu)
hv_set_siefp(siefp.as_uint64);

/* Setup the shared SINT. */
hv_enable_vmbus_irq();
hv_get_synint_state(VMBUS_MESSAGE_SINT, shared_sint.as_uint64);

shared_sint.vector = HYPERVISOR_CALLBACK_VECTOR;
Expand Down Expand Up @@ -428,6 +429,7 @@ int hv_synic_cleanup(unsigned int cpu)
hv_get_synic_state(sctrl.as_uint64);
sctrl.enable = 0;
hv_set_synic_state(sctrl.as_uint64);
hv_disable_vmbus_irq();

return 0;
}

0 comments on commit 1146b8b

Please sign in to comment.