From mboxrd@z Thu Jan 1 00:00:00 1970 From: yakui.zhao@intel.com (Zhao Yakui) Date: Fri, 16 Aug 2019 10:25:43 +0800 Subject: [RFC PATCH 02/15] x86/acrn: Add two APIs to add/remove driver-specific upcall ISR handler In-Reply-To: <1565922356-4488-1-git-send-email-yakui.zhao@intel.com> References: <1565922356-4488-1-git-send-email-yakui.zhao@intel.com> Message-ID: <1565922356-4488-3-git-send-email-yakui.zhao@intel.com> List-Id: Linux Driver Project Developer List After the ACRN hypervisor sends the upcall notify interrupt, the upcall ISR handler will be served. Now almost nothing is handled in upcall ISR handler except acking EOI. The driver-specific ISR handler is registered by the driver, which helps to handle the real notification from ACRN hypervisor. This is similar to that in XEN/HyperV. Co-developed-by: Jason Chen CJ Signed-off-by: Jason Chen CJ Signed-off-by: Zhao Yakui --- arch/x86/include/asm/acrn.h | 3 +++ arch/x86/kernel/cpu/acrn.c | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/arch/x86/include/asm/acrn.h b/arch/x86/include/asm/acrn.h index 4adb13f..857e6244 100644 --- a/arch/x86/include/asm/acrn.h +++ b/arch/x86/include/asm/acrn.h @@ -8,4 +8,7 @@ extern void acrn_hv_callback_vector(void); #endif extern void acrn_hv_vector_handler(struct pt_regs *regs); + +extern void acrn_setup_intr_irq(void (*handler)(void)); +extern void acrn_remove_intr_irq(void); #endif /* _ASM_X86_ACRN_H */ diff --git a/arch/x86/kernel/cpu/acrn.c b/arch/x86/kernel/cpu/acrn.c index 95db5c4..a1ce52a 100644 --- a/arch/x86/kernel/cpu/acrn.c +++ b/arch/x86/kernel/cpu/acrn.c @@ -56,6 +56,18 @@ __visible void __irq_entry acrn_hv_vector_handler(struct pt_regs *regs) set_irq_regs(old_regs); } +void acrn_setup_intr_irq(void (*handler)(void)) +{ + acrn_intr_handler = handler; +} +EXPORT_SYMBOL_GPL(acrn_setup_intr_irq); + +void acrn_remove_intr_irq(void) +{ + acrn_intr_handler = NULL; +} +EXPORT_SYMBOL_GPL(acrn_remove_intr_irq); + const __initconst struct hypervisor_x86 x86_hyper_acrn = { .name = "ACRN", .detect = acrn_detect, -- 2.7.4