From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] When switching to a vm8086 task, load segments as 16-bit (v2) Date: Wed, 12 Aug 2009 15:11:35 +0300 Message-ID: <4A82B177.9030607@redhat.com> References: <1250024279-6307-1-git-send-email-aliguori@us.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, Gleb Natapov To: Anthony Liguori Return-path: Received: from mx2.redhat.com ([66.187.237.31]:59821 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751523AbZHLMLr (ORCPT ); Wed, 12 Aug 2009 08:11:47 -0400 In-Reply-To: <1250024279-6307-1-git-send-email-aliguori@us.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 08/11/2009 11:57 PM, Anthony Liguori wrote: > According to 16.2.5 in the SDM, eflags.vm in the tss is consulted before loading > and new segments. If eflags.vm == 1, then the segments are treated as 16-bit > segments. The LDTR and TR are not normally available in vm86 mode so if they > happen to somehow get loaded, they need to be treated as 32-bit segments. > > This fixes an invalid vmentry failure in a custom OS that was happening after > a task switch into vm8086 mode. Since the segments were being mistakenly > treated as 32-bit, we loaded garbage state. > I'm getting a Vista x64 installer failure on reboot with this. One possibility is that ->get_rflags() is returning the mangled flags state (we add vm86 for real mode), which confuses the new code. -- error compiling committee.c: too many arguments to function