lkml.org 
[lkml]   [2012]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH v2 4/7] KVM: export kvm_kick_vcpu for pv_flush
    From
    Date

    Signed-off-by: Nikunj A. Dadhania <nikunj@linux.vnet.ibm.com>
    ---
    arch/x86/include/asm/kvm_para.h | 4 ++++
    arch/x86/kernel/kvm.c | 18 +++++++++---------
    2 files changed, 13 insertions(+), 9 deletions(-)

    diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h
    index 684a285..651a305 100644
    --- a/arch/x86/include/asm/kvm_para.h
    +++ b/arch/x86/include/asm/kvm_para.h
    @@ -206,6 +206,7 @@ void kvm_async_pf_task_wait(u32 token);
    void kvm_async_pf_task_wake(u32 token);
    u32 kvm_read_and_reset_pf_reason(void);
    extern void kvm_disable_steal_time(void);
    +void kvm_kick_cpu(int cpu);

    #ifdef CONFIG_PARAVIRT_SPINLOCKS
    void __init kvm_spinlock_init(void);
    @@ -229,6 +230,9 @@ static inline void kvm_disable_steal_time(void)
    {
    return;
    }
    +
    +#define kvm_kick_cpu(T) do {} while (0)
    +
    #endif

    #endif /* __KERNEL__ */
    diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
    index 66db54e..5943285 100644
    --- a/arch/x86/kernel/kvm.c
    +++ b/arch/x86/kernel/kvm.c
    @@ -487,6 +487,15 @@ static __init int activate_jump_labels(void)
    }
    arch_initcall(activate_jump_labels);

    +/* Kick a cpu */
    +void kvm_kick_cpu(int cpu)
    +{
    + int apicid;
    +
    + apicid = per_cpu(x86_cpu_to_apicid, cpu);
    + kvm_hypercall1(KVM_HC_KICK_CPU, apicid);
    +}
    +
    #ifdef CONFIG_PARAVIRT_SPINLOCKS

    enum kvm_contention_stat {
    @@ -695,15 +704,6 @@ out:
    }
    PV_CALLEE_SAVE_REGS_THUNK(kvm_lock_spinning);

    -/* Kick a cpu by its apicid*/
    -static inline void kvm_kick_cpu(int cpu)
    -{
    - int apicid;
    -
    - apicid = per_cpu(x86_cpu_to_apicid, cpu);
    - kvm_hypercall1(KVM_HC_KICK_CPU, apicid);
    -}
    -
    /* Kick vcpu waiting on @lock->head to reach value @ticket */
    static void kvm_unlock_kick(struct arch_spinlock *lock, __ticket_t ticket)
    {


    \
     
     \ /
      Last update: 2012-06-04 07:42    [W:3.906 / U:0.020 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site