From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [RFC] Patch - Big real mode emulation Date: Wed, 21 May 2008 14:19:56 -0300 Message-ID: <20080521171956.GB9298@dmt> References: <20080521113410.43ec182f@frecb000711.frec.bull.fr> <48342AD2.40406@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Guillaume Thouvenin , kvm@vger.kernel.org, Anthony Liguori , Mohammed Gamal , "Kamble, Nitin A" , Alexander Graf To: Avi Kivity Return-path: Received: from mx1.redhat.com ([66.187.233.31]:49860 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936266AbYEURT0 (ORCPT ); Wed, 21 May 2008 13:19:26 -0400 Content-Disposition: inline In-Reply-To: <48342AD2.40406@qumranet.com> Sender: kvm-owner@vger.kernel.org List-ID: On Wed, May 21, 2008 at 04:59:46PM +0300, Avi Kivity wrote: > >Hello, > > > > Here is a patch that allows to boot OpenSuse-10.3. The problem with > >Opensuse 10.3 is it uses a version of gfxboot that reads SS after > >switching from real to protected mode, where SS contains an invalid > >value, which VMX does not allow. > > Good to see progress on this issue. > > >So this patch > > > > 1) removes the code that writes sane value in SS in order to detect VM > >entry failure due to CS.RPL != SS.RPL > > 2) adds an handler to catch the VMentry failure > > > > The handler calls instruction's emulator and to boot opensuse we need > >to emulate the following instructions: > > > > ljmp $0x18,$0x6e18 > > mov $0x20,%ax > > mov %eax,%ds > > mov %ss,%eax > > and $0xffff,%esp > > shl $0x4,%eax > > add %eax,%esp > > mov $0x8,%ax > > mov %eax,%ss > > -> At this point CS.RPL == SS.RPL > > > > There is an issue with the patch. When removing the SS patching we see > >other problems. So to be able to still boot distribution that was > >already able to boot we added a hack that allows to modify SS_SELECTOR > >(as it was done previously) when emulation failed. The future solution > >will be to emulate instruction that need to be emulated. > > > > Which instructions are still problematic? FreeDOS HIMEM uses ltr, ldt, loop, nop, does a task switch via jmp. But that can come in later.