FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 08-09-2012, 09:48 AM
Stefan Bader
 
Default Fix nexted load of kvm-intel

Since adding the RDPMC feature in kernels after 3.3, a guest
running a v3.3+ kernel on a host running 3.2 cannot load the
kvm-intel module (Intel CPU obviously). The reason is a check
made on module load time for that feature being present in the
MSRs passed to the guest.
Upstreams reasoning is that no real CPU ever had this flag so
they do not want to change the check in newer kernels (while
kvm-amd is not so tight).

So from the patch that added support for RDPMC based exiting,
only the bit that adds the feature to the nested MSR is taken.

I tested this and could load the module, bring up a nested guest
and also ran "perf test" which on newer versions does a RDPMC
test that fails gracefully enough to seem ok (syscall returns
error).

This was proposed for stable and I just saw the emails being
sent but since it has some impact on Quantal testing I want
to make sure this gets in as soon as possible.

-Stefan
 
Old 08-09-2012, 11:07 AM
Andy Whitcroft
 
Default Fix nexted load of kvm-intel

On Thu, Aug 09, 2012 at 11:48:54AM +0200, Stefan Bader wrote:
> Since adding the RDPMC feature in kernels after 3.3, a guest
> running a v3.3+ kernel on a host running 3.2 cannot load the
> kvm-intel module (Intel CPU obviously). The reason is a check
> made on module load time for that feature being present in the
> MSRs passed to the guest.
> Upstreams reasoning is that no real CPU ever had this flag so
> they do not want to change the check in newer kernels (while
> kvm-amd is not so tight).

I thought it was that no real CPU didn't have this feature, so they
could rely on its existance. But anyhow...

> So from the patch that added support for RDPMC based exiting,
> only the bit that adds the feature to the nested MSR is taken.
>
> I tested this and could load the module, bring up a nested guest
> and also ran "perf test" which on newer versions does a RDPMC
> test that fails gracefully enough to seem ok (syscall returns
> error).
>
> This was proposed for stable and I just saw the emails being
> sent but since it has some impact on Quantal testing I want
> to make sure this gets in as soon as possible.
>
> -Stefan
>
> From b79a5f03b4d9a1a56949d6ef38fd4879ff1b8aee Mon Sep 17 00:00:00 2001
> From: Stefan Bader <stefan.bader@canonical.com>
> Date: Thu, 10 Nov 2011 14:57:25 +0200
> Subject: [PATCH] UBUNTU: (pre-stable) KVM: VMX: Set CPU_BASED_RDPMC_EXITING for nested
>
> Based on commit fee84b079d5ddee2247b5c1f53162c330c622902 upstream.
>
> Intercept RDPMC and forward it to the PMU emulation code.
>
> Newer vmx support will only allow to load the kvm_intel module
> if RDPMC_EXITING is supported. Even without the actual support
> this part of the change is required on 3.2 hosts.
>
> BugLink: http://bugs.launchpad.net/bugs/1031090
> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
> ---
> arch/x86/kvm/vmx.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 114fe29..94e6749 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -1957,6 +1957,7 @@ static __init void nested_vmx_setup_ctls_msrs(void)
> #endif
> CPU_BASED_MOV_DR_EXITING | CPU_BASED_UNCOND_IO_EXITING |
> CPU_BASED_USE_IO_BITMAPS | CPU_BASED_MONITOR_EXITING |
> + CPU_BASED_RDPMC_EXITING |
> CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
> /*
> * We can allow some features even when not supported by the

Having followed the development of this patch I believe this is the
minimum needed to get nested VMs startable on Intel. The testing I have
seen looks good.

Acked-by: Andy Whitcroft <apw@canonical.com>

-apw

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 08-09-2012, 12:15 PM
Stefan Bader
 
Default Fix nexted load of kvm-intel

On 09.08.2012 11:48, Stefan Bader wrote:
> Since adding the RDPMC feature in kernels after 3.3, a guest
> running a v3.3+ kernel on a host running 3.2 cannot load the
> kvm-intel module (Intel CPU obviously). The reason is a check
> made on module load time for that feature being present in the
> MSRs passed to the guest.
> Upstreams reasoning is that no real CPU ever had this flag so
> they do not want to change the check in newer kernels (while
> kvm-amd is not so tight).

Of course the reason was that every real CPU *has* the feature (at least the one
doing virt). Lost in negations. Doh!
>
> So from the patch that added support for RDPMC based exiting,
> only the bit that adds the feature to the nested MSR is taken.
>
> I tested this and could load the module, bring up a nested guest
> and also ran "perf test" which on newer versions does a RDPMC
> test that fails gracefully enough to seem ok (syscall returns
> error).
>
> This was proposed for stable and I just saw the emails being
> sent but since it has some impact on Quantal testing I want
> to make sure this gets in as soon as possible.
>
> -Stefan
>
> From b79a5f03b4d9a1a56949d6ef38fd4879ff1b8aee Mon Sep 17 00:00:00 2001
> From: Stefan Bader <stefan.bader@canonical.com>
> Date: Thu, 10 Nov 2011 14:57:25 +0200
> Subject: [PATCH] UBUNTU: (pre-stable) KVM: VMX: Set CPU_BASED_RDPMC_EXITING for nested
>
> Based on commit fee84b079d5ddee2247b5c1f53162c330c622902 upstream.
>
> Intercept RDPMC and forward it to the PMU emulation code.
>
> Newer vmx support will only allow to load the kvm_intel module
> if RDPMC_EXITING is supported. Even without the actual support
> this part of the change is required on 3.2 hosts.
>
> BugLink: http://bugs.launchpad.net/bugs/1031090
> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
> ---
> arch/x86/kvm/vmx.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 114fe29..94e6749 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -1957,6 +1957,7 @@ static __init void nested_vmx_setup_ctls_msrs(void)
> #endif
> CPU_BASED_MOV_DR_EXITING | CPU_BASED_UNCOND_IO_EXITING |
> CPU_BASED_USE_IO_BITMAPS | CPU_BASED_MONITOR_EXITING |
> + CPU_BASED_RDPMC_EXITING |
> CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
> /*
> * We can allow some features even when not supported by the
>


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 
Old 08-13-2012, 01:47 PM
Herton Ronaldo Krzesinski
 
Default Fix nexted load of kvm-intel

--
[]'s
Herton

--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 12:56 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org