From: Paolo Bonzini <pbonzini@redhat.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>,
"'kvm@vger.kernel.org'" <kvm@vger.kernel.org>,
"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
"'qemu-devel@nongnu.org'" <qemu-devel@nongnu.org>
Cc: "'gleb@redhat.com'" <gleb@redhat.com>, "'hpa@zytor.com'" <hpa@zytor.com>
Subject: Re: [PATCH v5 3/3] KVM: x86: Enable Intel MPX for guest
Date: Mon, 24 Feb 2014 12:13:13 +0100 [thread overview]
Message-ID: <530B2949.4030000@redhat.com> (raw)
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923350150E43C@SHSMSX101.ccr.corp.intel.com>
Il 24/02/2014 11:58, Liu, Jinsong ha scritto:
> @@ -599,6 +599,9 @@ int __kvm_set_xcr(struct kvm_vcpu *vcpu, u32 index, u64 xcr)
> u64 old_xcr0 = vcpu->arch.xcr0;
> u64 valid_bits;
>
> + if (!kvm_x86_ops->mpx_supported || !kvm_x86_ops->mpx_supported())
> + xcr0 &= ~(XSTATE_BNDREGS | XSTATE_BNDCSR);
> +
> /* Only support XCR_XFEATURE_ENABLED_MASK(xcr0) now */
> if (index != XCR_XFEATURE_ENABLED_MASK)
> return 1;
This hunk is incorrect, and I can simply drop it when applying. If MPX
is not supported, it should not be in the 0Dh CPUID leaf and thus in
vcpu->arch.guest_supported_xcr0.
This however relies on userspace passing a "sensible" value of CPUID.
I'll send a patch to strengthen the computation of guest_supported_xcr0.
Thanks!
Paolo
WARNING: multiple messages have this Message-ID (diff)
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Liu, Jinsong" <jinsong.liu@intel.com>,
"'kvm@vger.kernel.org'" <kvm@vger.kernel.org>,
"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>,
"'qemu-devel@nongnu.org'" <qemu-devel@nongnu.org>
Cc: "'gleb@redhat.com'" <gleb@redhat.com>, "'hpa@zytor.com'" <hpa@zytor.com>
Subject: Re: [Qemu-devel] [PATCH v5 3/3] KVM: x86: Enable Intel MPX for guest
Date: Mon, 24 Feb 2014 12:13:13 +0100 [thread overview]
Message-ID: <530B2949.4030000@redhat.com> (raw)
In-Reply-To: <DE8DF0795D48FD4CA783C40EC82923350150E43C@SHSMSX101.ccr.corp.intel.com>
Il 24/02/2014 11:58, Liu, Jinsong ha scritto:
> @@ -599,6 +599,9 @@ int __kvm_set_xcr(struct kvm_vcpu *vcpu, u32 index, u64 xcr)
> u64 old_xcr0 = vcpu->arch.xcr0;
> u64 valid_bits;
>
> + if (!kvm_x86_ops->mpx_supported || !kvm_x86_ops->mpx_supported())
> + xcr0 &= ~(XSTATE_BNDREGS | XSTATE_BNDCSR);
> +
> /* Only support XCR_XFEATURE_ENABLED_MASK(xcr0) now */
> if (index != XCR_XFEATURE_ENABLED_MASK)
> return 1;
This hunk is incorrect, and I can simply drop it when applying. If MPX
is not supported, it should not be in the 0Dh CPUID leaf and thus in
vcpu->arch.guest_supported_xcr0.
This however relies on userspace passing a "sensible" value of CPUID.
I'll send a patch to strengthen the computation of guest_supported_xcr0.
Thanks!
Paolo
next prev parent reply other threads:[~2014-02-24 11:13 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-24 10:58 [PATCH v5 3/3] KVM: x86: Enable Intel MPX for guest Liu, Jinsong
2014-02-24 10:58 ` [Qemu-devel] " Liu, Jinsong
2014-02-24 11:13 ` Paolo Bonzini [this message]
2014-02-24 11:13 ` Paolo Bonzini
2014-02-24 15:37 ` Liu, Jinsong
2014-02-24 15:37 ` [Qemu-devel] " Liu, Jinsong
2014-02-24 16:40 ` Paolo Bonzini
2014-02-24 16:40 ` [Qemu-devel] " Paolo Bonzini
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=530B2949.4030000@redhat.com \
--to=pbonzini@redhat.com \
--cc=gleb@redhat.com \
--cc=hpa@zytor.com \
--cc=jinsong.liu@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=qemu-devel@nongnu.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 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.