From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] KVM: x86 emulator: reject SYSENTER in compatibility mode on AMD guests Date: Wed, 01 Feb 2012 15:25:55 +0200 Message-ID: <4F293D63.1080704@redhat.com> References: <1328092020-18511-1-git-send-email-avi@redhat.com> <20120201110044.GA26183@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, =?ISO-8859-1?Q?Stephan_B=E4rwolf?= To: Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:58866 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754384Ab2BAN0B (ORCPT ); Wed, 1 Feb 2012 08:26:01 -0500 In-Reply-To: <20120201110044.GA26183@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On 02/01/2012 01:00 PM, Marcelo Tosatti wrote: > On Wed, Feb 01, 2012 at 12:27:00PM +0200, Avi Kivity wrote: > > If the guest thinks it's an AMD, it will not have prepared the SYSENTER MSRs, > > and if the guest executes SYSENTER in compatibility mode, it will fails. > > > > Detect this condition and #UD instead, like the spec says. > > Note the SYSENTER_CS & 0xfffc == 0 check protects against a fatal error (unlike > the SYSCALL bug), in case of zeroed MSRs. That's a relief. It's still possible for this to fail (say kexec from 32-bit guest to 64-bit guest) but it's incredibly unlikely. -- error compiling committee.c: too many arguments to function