lkml.org 
[lkml]   [2015]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v7 05/17] KVM: Add interfaces to control PI outside vmx
    Date
    This patch adds pi_clear_sn and pi_set_sn to struct kvm_x86_ops,
    so we can set/clear SN outside vmx.

    Signed-off-by: Feng Wu <feng.wu@intel.com>
    ---
    arch/x86/include/asm/kvm_host.h | 3 +++
    arch/x86/kvm/vmx.c | 13 +++++++++++++
    2 files changed, 16 insertions(+)

    diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
    index d50c1d3..c4f99f1 100644
    --- a/arch/x86/include/asm/kvm_host.h
    +++ b/arch/x86/include/asm/kvm_host.h
    @@ -860,6 +860,9 @@ struct kvm_x86_ops {
    gfn_t offset, unsigned long mask);

    u64 (*get_pi_desc_addr)(struct kvm_vcpu *vcpu);
    +
    + void (*pi_clear_sn)(struct kvm_vcpu *vcpu);
    + void (*pi_set_sn)(struct kvm_vcpu *vcpu);
    /* pmu operations of sub-arch */
    const struct kvm_pmu_ops *pmu_ops;
    };
    diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
    index 81a995c..234f720 100644
    --- a/arch/x86/kvm/vmx.c
    +++ b/arch/x86/kvm/vmx.c
    @@ -615,6 +615,16 @@ struct pi_desc *vcpu_to_pi_desc(struct kvm_vcpu *vcpu)
    return &(to_vmx(vcpu)->pi_desc);
    }

    +static void vmx_pi_clear_sn(struct kvm_vcpu *vcpu)
    +{
    + pi_clear_sn(vcpu_to_pi_desc(vcpu));
    +}
    +
    +static void vmx_pi_set_sn(struct kvm_vcpu *vcpu)
    +{
    + pi_set_sn(vcpu_to_pi_desc(vcpu));
    +}
    +
    static unsigned long shadow_read_only_fields[] = {
    /*
    * We do NOT shadow fields that are modified when L0
    @@ -10471,6 +10481,9 @@ static struct kvm_x86_ops vmx_x86_ops = {

    .get_pi_desc_addr = vmx_get_pi_desc_addr,

    + .pi_clear_sn = vmx_pi_clear_sn,
    + .pi_set_sn = vmx_pi_set_sn,
    +
    .pmu_ops = &intel_pmu_ops,
    };

    --
    2.1.0


    \
     
     \ /
      Last update: 2015-08-25 11:41    [W:5.145 / U:0.280 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site