From: Alexander Graf <graf@amazon.com>
To: kvm list <kvm@vger.kernel.org>
Cc: Aaron Lewis <aaronlewis@google.com>,
Sean Christopherson <sean.j.christopherson@intel.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Jonathan Corbet <corbet@lwn.net>,
Vitaly Kuznetsov <vkuznets@redhat.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>,
"Joerg Roedel" <joro@8bytes.org>,
KarimAllah Raslan <karahmed@amazon.de>,
"Dan Carpenter" <dan.carpenter@oracle.com>,
Maxim Levitsky <mlevitsk@redhat.com>, <linux-doc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH v8 1/8] KVM: x86: Return -ENOENT on unimplemented MSRs
Date: Fri, 25 Sep 2020 16:34:15 +0200 [thread overview]
Message-ID: <20200925143422.21718-2-graf@amazon.com> (raw)
In-Reply-To: <20200925143422.21718-1-graf@amazon.com>
When we find an MSR that we can not handle, bubble up that error code as
MSR error return code. Follow up patches will use that to expose the fact
that an MSR is not handled by KVM to user space.
Suggested-by: Aaron Lewis <aaronlewis@google.com>
Signed-off-by: Alexander Graf <graf@amazon.com>
---
arch/x86/kvm/x86.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 17f4995e80a7..58d513c5e264 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -267,7 +267,7 @@ static int kvm_msr_ignored_check(struct kvm_vcpu *vcpu, u32 msr,
} else {
vcpu_debug_ratelimited(vcpu, "unhandled %s: 0x%x data 0x%llx\n",
op, msr, data);
- return 1;
+ return -ENOENT;
}
}
--
2.28.0.394.ge197136389
Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879
next prev parent reply other threads:[~2020-09-25 14:34 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-25 14:34 [PATCH v8 0/8] Allow user space to restrict and augment MSR emulation Alexander Graf
2020-09-25 14:34 ` Alexander Graf [this message]
2020-09-25 16:40 ` [PATCH v8 1/8] KVM: x86: Return -ENOENT on unimplemented MSRs Jim Mattson
2020-09-25 14:34 ` [PATCH v8 2/8] KVM: x86: Deflect unknown MSR accesses to user space Alexander Graf
2020-09-28 16:05 ` Aaron Lewis
2020-09-25 14:34 ` [PATCH v8 3/8] KVM: x86: Add infrastructure for MSR filtering Alexander Graf
2020-09-28 16:08 ` Aaron Lewis
2020-09-25 14:34 ` [PATCH v8 4/8] KVM: x86: Prepare MSR bitmaps for userspace tracked MSRs Alexander Graf
2020-09-25 14:34 ` [PATCH v8 5/8] KVM: x86: SVM: Prevent MSR passthrough when MSR access is denied Alexander Graf
2020-09-25 22:01 ` Paolo Bonzini
2020-09-25 22:22 ` Paolo Bonzini
2020-09-25 14:34 ` [PATCH v8 6/8] KVM: x86: VMX: " Alexander Graf
2020-10-02 1:11 ` Peter Xu
2020-10-05 18:43 ` Sean Christopherson
2020-09-25 14:34 ` [PATCH v8 7/8] KVM: x86: Introduce MSR filtering Alexander Graf
2020-09-28 16:09 ` Aaron Lewis
2020-09-25 14:34 ` [PATCH v8 8/8] KVM: selftests: Add test for user space MSR handling Alexander Graf
2020-09-28 16:10 ` Aaron Lewis
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=20200925143422.21718-2-graf@amazon.com \
--to=graf@amazon.com \
--cc=aaronlewis@google.com \
--cc=corbet@lwn.net \
--cc=dan.carpenter@oracle.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=karahmed@amazon.de \
--cc=kvm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mlevitsk@redhat.com \
--cc=pbonzini@redhat.com \
--cc=sean.j.christopherson@intel.com \
--cc=vkuznets@redhat.com \
--cc=wanpengli@tencent.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).