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 10:47:26 +0300 Message-ID: <4A82738E.5040900@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]:52853 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754066AbZHLHrj (ORCPT ); Wed, 12 Aug 2009 03:47:39 -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. > Applied, thanks. -- error compiling committee.c: too many arguments to function