From: Paolo Bonzini <pbonzini@redhat.com>
To: Nadav Amit <namit@cs.technion.ac.il>
Cc: kvm@vger.kernel.org
Subject: Re: [PATCH] KVM: x86: Fix MSR_IA32_BNDCFGS in msrs_to_save
Date: Mon, 13 Apr 2015 12:08:22 +0200 [thread overview]
Message-ID: <552B9596.10608@redhat.com> (raw)
In-Reply-To: <1428864435-4732-1-git-send-email-namit@cs.technion.ac.il>
On 12/04/2015 20:47, Nadav Amit wrote:
> kvm_init_msr_list is currently called before hardware_setup. As a result,
> vmx_mpx_supported always returns false when kvm_init_msr_list checks whether to
> save MSR_IA32_BNDCFGS.
>
> Move kvm_init_msr_list after vmx_hardware_setup is called to fix this issue.
>
> Signed-off-by: Nadav Amit <namit@cs.technion.ac.il>
>
> ---
>
> Note that this patch was not tested on a system that supports MPX.
> ---
> arch/x86/kvm/x86.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index b8cb1d0..b7e3b05 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -5800,7 +5800,6 @@ int kvm_arch_init(void *opaque)
> kvm_set_mmio_spte_mask();
>
> kvm_x86_ops = ops;
> - kvm_init_msr_list();
>
> kvm_mmu_set_mask_ptes(PT_USER_MASK, PT_ACCESSED_MASK,
> PT_DIRTY_MASK, PT64_NX_MASK, 0);
> @@ -7254,7 +7253,14 @@ void kvm_arch_hardware_disable(void)
>
> int kvm_arch_hardware_setup(void)
> {
> - return kvm_x86_ops->hardware_setup();
> + int r;
> +
> + r = kvm_x86_ops->hardware_setup();
> + if (r != 0)
> + return r;
> +
> + kvm_init_msr_list();
> + return 0;
> }
>
> void kvm_arch_hardware_unsetup(void)
>
Applied (locally) for 4.1 with Cc stable.
Paolo
prev parent reply other threads:[~2015-04-13 10:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-12 18:47 [PATCH] KVM: x86: Fix MSR_IA32_BNDCFGS in msrs_to_save Nadav Amit
2015-04-13 10:08 ` Paolo Bonzini [this message]
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=552B9596.10608@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=namit@cs.technion.ac.il \
/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