From: Alexander Graf <agraf@suse.de>
To: Avi Kivity <avi@qumranet.com>
Cc: kvm@vger.kernel.org, joerg.roedel@amd.com
Subject: Re: [PATCH] Ignore DEBUGCTL MSRs
Date: Wed, 09 Jul 2008 14:48:55 +0200 [thread overview]
Message-ID: <4874B3B7.7060003@suse.de> (raw)
In-Reply-To: <486F6904.2040907@qumranet.com>
[-- Attachment #1: Type: text/plain, Size: 693 bytes --]
Avi Kivity wrote:
> Alexander Graf wrote:
>> Netware writes and reads to the DEBUGCTL and LAST*IP MSRs without
>> further checks and is really confused to receive a #GP during that.
>> To make it happy we should just make them stubs, which is exactly
>> what SVM already does.
>>
>> To support VMX too, I put these in the generic code. Maybe the SVM
>> code could be cleaned up to use generic code too.
>>
>
> Please add a pr_unimpl() when bits that cause a real processor to do
> something are set.
Like this? I also removed the set handlers for the *IP MSRs, as these
are read only and made it only handle debug bits, no perfmon bits.
Signed-off-by: Alexander Graf <agraf@suse.de>
[-- Attachment #2: kvm-netware.patch --]
[-- Type: text/x-patch, Size: 1045 bytes --]
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index fc0721e..10f5e95 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -609,6 +609,15 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 data)
pr_unimpl(vcpu, "%s: MSR_IA32_MCG_CTL 0x%llx, nop\n",
__func__, data);
break;
+ case MSR_IA32_DEBUGCTLMSR:
+ if (data > (DEBUGCTLMSR_LBR | DEBUGCTLMSR_BTF)) {
+ /* Values other than LBR and BTF are vendor-specific,
+ thus reserved and should throw a #GP */
+ return 1;
+ }
+ pr_unimpl(vcpu, "%s: MSR_IA32_DEBUGCTLMSR 0x%llx, nop\n",
+ __func__, data);
+ break;
case MSR_IA32_UCODE_REV:
case MSR_IA32_UCODE_WRITE:
break;
@@ -705,6 +714,11 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, u32 msr, u64 *pdata)
case MSR_IA32_MC0_MISC+16:
case MSR_IA32_UCODE_REV:
case MSR_IA32_EBL_CR_POWERON:
+ case MSR_IA32_DEBUGCTLMSR:
+ case MSR_IA32_LASTBRANCHFROMIP:
+ case MSR_IA32_LASTBRANCHTOIP:
+ case MSR_IA32_LASTINTFROMIP:
+ case MSR_IA32_LASTINTTOIP:
data = 0;
break;
case MSR_MTRRcap:
next prev parent reply other threads:[~2008-07-09 13:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-24 5:04 [PATCH] Ignore DEBUGCTL MSRs Alexander Graf
2008-06-24 13:40 ` Joerg Roedel
2008-06-25 7:41 ` Alexander Graf
2008-07-05 12:27 ` Avi Kivity
2008-07-05 12:28 ` Avi Kivity
2008-07-09 12:48 ` Alexander Graf [this message]
2008-07-10 14:01 ` Avi Kivity
2008-07-16 9:26 ` Alexander Graf
2008-07-21 9:05 ` Avi Kivity
2008-07-22 6:00 ` Alexander Graf
2008-07-22 7:19 ` Avi Kivity
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=4874B3B7.7060003@suse.de \
--to=agraf@suse.de \
--cc=avi@qumranet.com \
--cc=joerg.roedel@amd.com \
--cc=kvm@vger.kernel.org \
/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