From: Andy Lutomirski Date: Wed, 8 Oct 2014 16:02:13 +0000 (-0700) Subject: x86,kvm,vmx: Preserve CR4 across VM entry X-Git-Tag: fixes-against-v3.18-rc2~60 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d974baa398f34393db76be45f7d4d04fbdbb4a0a;p=pandora-kernel.git x86,kvm,vmx: Preserve CR4 across VM entry CR4 isn't constant; at least the TSD and PCE bits can vary. TBH, treating CR0 and CR3 as constant scares me a bit, too, but it looks like it's correct. This adds a branch and a read from cr4 to each vm entry. Because it is extremely likely that consecutive entries into the same vcpu will have the same host cr4 value, this fixes up the vmcs instead of restoring cr4 after the fact. A subsequent patch will add a kernel-wide cr4 shadow, reducing the overhead in the common case to just two memory reads and a branch. Signed-off-by: Andy Lutomirski Acked-by: Paolo Bonzini Cc: stable@vger.kernel.org Cc: Petr Matousek Cc: Gleb Natapov Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed