All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Hornyack <peterhornyack@google.com>
To: kvm list <kvm@vger.kernel.org>, Gleb Natapov <gleb@kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>
Cc: Joerg Roedel <joro@8bytes.org>,
	Peter Hornyack <peterhornyack@google.com>
Subject: [RFC PATCH 3/5] KVM: x86: add msr_exits_supported to kvm_x86_ops
Date: Tue, 18 Aug 2015 11:46:53 -0700	[thread overview]
Message-ID: <1439923615-10600-4-git-send-email-peterhornyack@google.com> (raw)
In-Reply-To: <1439923615-10600-1-git-send-email-peterhornyack@google.com>

msr_exits_supported will be checked when user space attempts to enable
the KVM_CAP_UNHANDLED_MSR_EXITS capability for the vm. This is needed
because MSR exit support will be implemented for vmx but not svm later
in this patchset.

Signed-off-by: Peter Hornyack <peterhornyack@google.com>
---
 arch/x86/include/asm/kvm_host.h | 1 +
 arch/x86/kvm/svm.c              | 6 ++++++
 arch/x86/kvm/vmx.c              | 6 ++++++
 3 files changed, 13 insertions(+)

diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index c12e845f59e6..a6e145b1e271 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -854,6 +854,7 @@ struct kvm_x86_ops {
 	void (*handle_external_intr)(struct kvm_vcpu *vcpu);
 	bool (*mpx_supported)(void);
 	bool (*xsaves_supported)(void);
+	bool (*msr_exits_supported)(void);
 
 	int (*check_nested_events)(struct kvm_vcpu *vcpu, bool external_intr);
 
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 74d825716f4f..bcbb56f49b9f 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -4249,6 +4249,11 @@ static bool svm_xsaves_supported(void)
 	return false;
 }
 
+static bool svm_msr_exits_supported(void)
+{
+	return false;
+}
+
 static bool svm_has_wbinvd_exit(void)
 {
 	return true;
@@ -4540,6 +4545,7 @@ static struct kvm_x86_ops svm_x86_ops = {
 	.invpcid_supported = svm_invpcid_supported,
 	.mpx_supported = svm_mpx_supported,
 	.xsaves_supported = svm_xsaves_supported,
+	.msr_exits_supported = svm_msr_exits_supported,
 
 	.set_supported_cpuid = svm_set_supported_cpuid,
 
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index acc38e27d221..27fec385d79d 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -8161,6 +8161,11 @@ static bool vmx_xsaves_supported(void)
 		SECONDARY_EXEC_XSAVES;
 }
 
+static bool vmx_msr_exits_supported(void)
+{
+	return false;
+}
+
 static void vmx_recover_nmi_blocking(struct vcpu_vmx *vmx)
 {
 	u32 exit_intr_info;
@@ -10413,6 +10418,7 @@ static struct kvm_x86_ops vmx_x86_ops = {
 	.handle_external_intr = vmx_handle_external_intr,
 	.mpx_supported = vmx_mpx_supported,
 	.xsaves_supported = vmx_xsaves_supported,
+	.msr_exits_supported = vmx_msr_exits_supported,
 
 	.check_nested_events = vmx_check_nested_events,
 
-- 
2.5.0.276.gf5e568e


  parent reply	other threads:[~2015-08-18 18:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-18 18:46 [RFC PATCH 0/5] KVM: x86: exit to user space on unhandled MSR accesses Peter Hornyack
2015-08-18 18:46 ` [RFC PATCH 1/5] KVM: x86: refactor vmx rdmsr/wrmsr completion into new functions Peter Hornyack
2015-08-18 18:46 ` [RFC PATCH 2/5] KVM: add KVM_EXIT_MSR exit reason and capability Peter Hornyack
2015-12-18 21:25   ` Paolo Bonzini
2015-12-18 23:56     ` Peter Hornyack
2015-12-21 18:58     ` Peter Hornyack
2015-12-22  7:24       ` Pavel Fedin
2015-12-22 12:01         ` 'Roman Kagan'
2015-12-22 12:51           ` Pavel Fedin
2015-12-22 14:09             ` 'Roman Kagan'
2015-12-23  7:47               ` Pavel Fedin
2016-01-12  3:21         ` Peter Hornyack
2015-08-18 18:46 ` Peter Hornyack [this message]
2015-08-24 23:15   ` [RFC PATCH 3/5] KVM: x86: add msr_exits_supported to kvm_x86_ops Bandan Das
2015-08-18 18:46 ` [RFC PATCH 4/5] KVM: x86: enable unhandled MSR exits for vmx Peter Hornyack
2015-08-24 23:14   ` Bandan Das
2015-08-18 18:46 ` [RFC PATCH 5/5] KVM: x86: add trace events for unhandled MSR exits Peter Hornyack
2015-08-19 21:43 ` [RFC PATCH 0/5] KVM: x86: exit to user space on unhandled MSR accesses Bandan Das
2015-08-20 19:40   ` Peter Hornyack
2015-08-24 23:21     ` Bandan Das

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1439923615-10600-4-git-send-email-peterhornyack@google.com \
    --to=peterhornyack@google.com \
    --cc=gleb@kernel.org \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.