[Precise SRU] Fix nexted load of kvm-intel
Stefan Bader
stefan.bader at canonical.com
Thu Aug 9 12:15:41 UTC 2012
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 at 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 at 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
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20120809/02eab7cb/attachment.sig>
More information about the kernel-team
mailing list