Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753082AbbGMKDv (ORCPT ); Mon, 13 Jul 2015 06:03:51 -0400 Received: from mga03.intel.com ([134.134.136.65]:34120 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752304AbbGMJ6n (ORCPT ); Mon, 13 Jul 2015 05:58:43 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,462,1432623600"; d="scan'208";a="761364806" From: Feng Wu To: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: pbonzini@redhat.com, alex.williamson@redhat.com, joro@8bytes.org, eric.auger@linaro.org, feng.wu@intel.com Subject: [v5 05/19] KVM: Add interfaces to control PI outside vmx Date: Mon, 13 Jul 2015 17:47:21 +0800 Message-Id: <1436780855-3617-6-git-send-email-feng.wu@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1436780855-3617-1-git-send-email-feng.wu@intel.com> References: <1436780855-3617-1-git-send-email-feng.wu@intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1818 Lines: 62 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 --- 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 9df0724..739fd14 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -838,6 +838,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 1b33e33..35ef4c6 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -614,6 +614,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/