lkml.org 
[lkml]   [2019]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[RFC PATCH 02/15] x86/acrn: Add two APIs to add/remove driver-specific upcall ISR handler
    Date
    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@intel.com>
    Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
    Signed-off-by: Zhao Yakui <yakui.zhao@intel.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
    \
     
     \ /
      Last update: 2019-08-16 04:36    [W:3.985 / U:0.108 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site