Received: from eggs.gnu.org ([2001:4830:134:3::10]:53098) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi35w-0001eW-JE for qemu-devel@nongnu.org; Fri, 02 Oct 2015 12:22:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zi35q-00078X-F0 for qemu-devel@nongnu.org; Fri, 02 Oct 2015 12:22:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42687) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zi35q-00078G-3B for qemu-devel@nongnu.org; Fri, 02 Oct 2015 12:21:58 -0400 Date: Fri, 2 Oct 2015 13:21:54 -0300 From: Eduardo Habkost Message-ID: <20151002162154.GG1260@thinpad.lan.raisama.net> References: <201509301533.29564.wpaul@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201509301533.29564.wpaul@windriver.com> Subject: Re: [Qemu-devel] [PATCH] Correctly re-init EFER state during INIT IPI List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Bill Paul Cc: Paolo Bonzini , qemu-devel@nongnu.org, Richard Henderson On Wed, Sep 30, 2015 at 03:33:29PM -0700, Bill Paul wrote: > When doing a re-initialization of a CPU core, the default state is to _not_ > have 64-bit long mode enabled. This means the LME (long mode enable) and LMA > (long mode active) bits in the EFER model-specific register should be cleared. > > However, the EFER state is part of the CPU environment which is > preserved by do_cpu_init(), so if EFER.LME and EFER.LMA were set at the > time an INIT IPI was received, they will remain set after the init completes. > > This is contrary to what the Intel architecture manual describes and what > happens on real hardware, and it leaves the CPU in a weird state that the > guest can't clear. > > To fix this, the 'efer' member of the CPUX86State structure has been moved > to an area outside the region preserved by do_cpu_init(), so that it can > be properly re-initialized by x86_cpu_reset(). > > Signed-off-by: Bill Paul > CC: Paolo Bonzini > CC: Richard Henderson > CC: Eduardo Habkost Applied to x86 tree. Thanks! -- Eduardo