Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1163146

[v4 05/16] KVM: Add interfaces to control PI outside vmx

From Feng Wu <feng.wu@intel.com>
Newsgroups linux.kernel
Subject [v4 05/16] KVM: Add interfaces to control PI outside vmx
Date 2015-06-11 13:10 +0200
Message-ID <pA8wW-3OV-41@gated-at.bofh.it> (permalink)
References <pA8wV-3OV-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 c7a09fb..69bc770 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -835,6 +835,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);
 };
 
 struct kvm_arch_async_pf {
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index ccc9ce4..dd3c63a 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
@@ -10307,6 +10317,9 @@ static struct kvm_x86_ops vmx_x86_ops = {
 	.enable_log_dirty_pt_masked = vmx_enable_log_dirty_pt_masked,
 
 	.get_pi_desc_addr = vmx_get_pi_desc_addr,
+
+	.pi_clear_sn = vmx_pi_clear_sn,
+	.pi_set_sn = vmx_pi_set_sn,
 };
 
 static int __init vmx_init(void)
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[v4 00/16] Add VT-d Posted-Interrupts support Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 12/16] KVM: kvm-vfio: implement the VFIO skeleton for VT-d Posted-Interrupts Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
    RE: [v4 12/16] KVM: kvm-vfio: implement the VFIO skeleton for VT-d  Posted-Interrupts "Wu, Feng" <feng.wu@intel.com> - 2015-06-12 07:00 +0200
  [v4 13/16] KVM: x86: kvm-vfio: VT-d posted-interrupts setup Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
    RE: [v4 13/16] KVM: x86: kvm-vfio: VT-d posted-interrupts setup "Wu, Feng" <feng.wu@intel.com> - 2015-06-12 07:00 +0200
  [v4 15/16] KVM: Update Posted-Interrupts Descriptor when vCPU is blocked Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 07/16] KVM: make kvm_set_msi_irq() public Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 10/16] KVM: kvm-vfio: wrappers to VFIO external API device helpers Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 11/16] KVM: kvm-vfio: User API for VT-d Posted-Interrupts Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 05/16] KVM: Add interfaces to control PI outside vmx Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 14/16] KVM: Update Posted-Interrupts Descriptor when vCPU is preempted Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 02/16] KVM: Add some helper functions for Posted-Interrupts Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 16/16] KVM: Warn if 'SN' is set during posting interrupts by software Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 04/16] KVM: Get Posted-Interrupts descriptor address from struct kvm_vcpu Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 01/16] KVM: Extend struct pi_desc for VT-d Posted-Interrupts Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200
  [v4 09/16] VFIO: external user API for interaction Feng Wu <feng.wu@intel.com> - 2015-06-11 13:10 +0200

csiph-web