From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: Completing big real mode emulation Date: Wed, 24 Mar 2010 18:05:26 +0800 Message-ID: <201003241805.26913.sheng@linux.intel.com> References: <52d4a3891003190829o6964dd0bv8d2c86c61da247b2@mail.gmail.com> <52d4a3891003200702h1e267e4ft56570d02028fcb6d@mail.gmail.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: Alexander Graf , Mohammed Gamal , Avi Kivity , "qemu-devel@nongnu.org" To: kvm@vger.kernel.org Return-path: Received: from mga09.intel.com ([134.134.136.24]:19743 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754677Ab0CXKFa (ORCPT ); Wed, 24 Mar 2010 06:05:30 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Saturday 20 March 2010 23:00:49 Alexander Graf wrote: > Am 20.03.2010 um 15:02 schrieb Mohammed Gamal : > > On Sat, Mar 20, 2010 at 3:18 PM, Avi Kivity wrote: > >> On 03/20/2010 10:55 AM, Alexander Graf wrote: > >>>>> I'd say that a GSoC project would rather focus on making a guest > >>>>> OS work > >>>>> than working on generic big real mode. Having Windows 98 support > >>>>> is way more > >>>>> visible to the users. And hopefully more fun to implement too, > >>>>> as it's a > >>>>> visible goal :-). > >>>> > >>>> Big real mode allows you to boot various OSes, such as that old > >>>> Ubuntu/SuSE boot loader which triggered the whole thing. > >>> > >>> I thought legacy Windows uses it too? > >> > >> IIRC even current Windows (last I checked was XP, but it's probably > >> true for > >> newer) invokes big real mode inadvertently. All it takes is not to > >> clear fs > >> and gs while switching to real mode. It works because the real > >> mode code > >> never uses gs and fs (i.e. while we are technically in big real > >> mode, the > >> guest never relies on this), and because there are enough hacks in > >> vmx.c to > >> make it work (restoring fs and gs after the switch back). IIRC > >> there are > >> other cases of invalid guest state that we hack into place during > >> mode > >> switches. > >> > >>> Either way - then we should make the goal of the project to > >>> support those > >>> old boot loaders. IMHO it should contain visibility. Doing > >>> theoretical stuff > >>> is just less fun for all parties. Or does that stuff work already? > >> > >> Mostly those old guests aged beyond usefulness. They are still > >> broken, but > >> nobody installs new images. Old images installed via workarounds > >> work. > >> > >> Goals for this task could include: > >> > >> - get those older guests working > >> - get emulate_invalid_guest_state=1 to work on all supported guests > >> - switch to emulate_invalid_guest_state=1 as the default > >> - drop the code supporting emulate_invalid_guest_state=0 eventually > > > > To this end I guess the next logical step is to compile a list of > > guests that are currently not working/work with hacks only, and get > > them working. Here are some suggestions: > > - MINIX 3.1.6 (developers have been recently filing bug reports > > because of boot failures) > > - Win XP with emulation enabled > > - FreeDOS with memory extenders > > > > Any other guests you'd like to see on this list? > > I remember old openSUSE iso bootloaders had issues. I think it was > around 10.3, but might have been earlier. > At least 10u2 installer has trouble. I had spent some time on it, finally found it's due to ISOLINUX. The basic issue is it assume that SS selector/base is unchanged when enter/exit protect mode. At that time, I've cooked a hack workaround for it, but didn't think it's proper to upstream. -- regards Yang, Sheng From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NuNT3-0004LL-LU for qemu-devel@nongnu.org; Wed, 24 Mar 2010 06:05:41 -0400 Received: from [140.186.70.92] (port=54012 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NuNT0-0004Ko-2b for qemu-devel@nongnu.org; Wed, 24 Mar 2010 06:05:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NuNSu-0005Xt-7m for qemu-devel@nongnu.org; Wed, 24 Mar 2010 06:05:34 -0400 Received: from mga09.intel.com ([134.134.136.24]:15789) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NuNSu-0005Xf-32 for qemu-devel@nongnu.org; Wed, 24 Mar 2010 06:05:32 -0400 From: Sheng Yang Date: Wed, 24 Mar 2010 18:05:26 +0800 References: <52d4a3891003190829o6964dd0bv8d2c86c61da247b2@mail.gmail.com> <52d4a3891003200702h1e267e4ft56570d02028fcb6d@mail.gmail.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201003241805.26913.sheng@linux.intel.com> Subject: [Qemu-devel] Re: Completing big real mode emulation List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kvm@vger.kernel.org Cc: "qemu-devel@nongnu.org" , Mohammed Gamal , Alexander Graf , Avi Kivity On Saturday 20 March 2010 23:00:49 Alexander Graf wrote: > Am 20.03.2010 um 15:02 schrieb Mohammed Gamal : > > On Sat, Mar 20, 2010 at 3:18 PM, Avi Kivity wrote: > >> On 03/20/2010 10:55 AM, Alexander Graf wrote: > >>>>> I'd say that a GSoC project would rather focus on making a guest > >>>>> OS work > >>>>> than working on generic big real mode. Having Windows 98 support > >>>>> is way more > >>>>> visible to the users. And hopefully more fun to implement too, > >>>>> as it's a > >>>>> visible goal :-). > >>>> > >>>> Big real mode allows you to boot various OSes, such as that old > >>>> Ubuntu/SuSE boot loader which triggered the whole thing. > >>> > >>> I thought legacy Windows uses it too? > >> > >> IIRC even current Windows (last I checked was XP, but it's probably > >> true for > >> newer) invokes big real mode inadvertently. All it takes is not to > >> clear fs > >> and gs while switching to real mode. It works because the real > >> mode code > >> never uses gs and fs (i.e. while we are technically in big real > >> mode, the > >> guest never relies on this), and because there are enough hacks in > >> vmx.c to > >> make it work (restoring fs and gs after the switch back). IIRC > >> there are > >> other cases of invalid guest state that we hack into place during > >> mode > >> switches. > >> > >>> Either way - then we should make the goal of the project to > >>> support those > >>> old boot loaders. IMHO it should contain visibility. Doing > >>> theoretical stuff > >>> is just less fun for all parties. Or does that stuff work already? > >> > >> Mostly those old guests aged beyond usefulness. They are still > >> broken, but > >> nobody installs new images. Old images installed via workarounds > >> work. > >> > >> Goals for this task could include: > >> > >> - get those older guests working > >> - get emulate_invalid_guest_state=1 to work on all supported guests > >> - switch to emulate_invalid_guest_state=1 as the default > >> - drop the code supporting emulate_invalid_guest_state=0 eventually > > > > To this end I guess the next logical step is to compile a list of > > guests that are currently not working/work with hacks only, and get > > them working. Here are some suggestions: > > - MINIX 3.1.6 (developers have been recently filing bug reports > > because of boot failures) > > - Win XP with emulation enabled > > - FreeDOS with memory extenders > > > > Any other guests you'd like to see on this list? > > I remember old openSUSE iso bootloaders had issues. I think it was > around 10.3, but might have been earlier. > At least 10u2 installer has trouble. I had spent some time on it, finally found it's due to ISOLINUX. The basic issue is it assume that SS selector/base is unchanged when enter/exit protect mode. At that time, I've cooked a hack workaround for it, but didn't think it's proper to upstream. -- regards Yang, Sheng