[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1565922356-4488-3-git-send-email-yakui.zhao@intel.com>
Date: Fri, 16 Aug 2019 10:25:43 +0800
From: Zhao Yakui <yakui.zhao@...el.com>
To: x86@...nel.org, linux-kernel@...r.kernel.org,
devel@...verdev.osuosl.org
Cc: Zhao Yakui <yakui.zhao@...el.com>,
Jason Chen CJ <jason.cj.chen@...el.com>
Subject: [RFC PATCH 02/15] x86/acrn: Add two APIs to add/remove driver-specific upcall ISR handler
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 <jason.cj.chen@...el.com>
Signed-off-by: Jason Chen CJ <jason.cj.chen@...el.com>
Signed-off-by: Zhao Yakui <yakui.zhao@...el.com>
---
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
Powered by blists - more mailing lists