From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH][RESEND] x86_emulator: Emulate cld and std instruction Date: Thu, 31 Jul 2008 13:50:52 +0300 Message-ID: <4891990C.7000202@qumranet.com> References: <20080730212727.GA7708@mohd-laptop> <48918C6C.1000408@qumranet.com> <52d4a3890807310325r208b7943h89df5490e2af0131@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, riel@surriel.com To: Mohammed Gamal Return-path: Received: from il.qumranet.com ([212.179.150.194]:39492 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750851AbYGaKux (ORCPT ); Thu, 31 Jul 2008 06:50:53 -0400 In-Reply-To: <52d4a3890807310325r208b7943h89df5490e2af0131@mail.gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: Mohammed Gamal wrote: > On Thu, Jul 31, 2008 at 12:57 PM, Avi Kivity wrote: > >> Mohammed Gamal wrote: >> >>> This patch adds 'cld' and 'std' instructions to the emulator >>> >>> >>> >> I presume for big real mode? Which guest wants it? >> > > Actually I was experimenting with checking guest state and emulating > on mode switches. When I was doing so, it used to happen with all > guests, so I guess it maybe something related to the BIOS not a > specific guest. > There is indeed a cld in rombios.c (after rombios32_05), but it appears to be after all segments have been initialized. > BTW, the other way we can do is still handle vmentry failures. I > discovered that the problem that caused occasional exits with > Guillaume's patches is very likely to be that not enough checks on the > guest state. > > The only check was if CS RPL equals SS RPL, so what happens is that > when a vmexit and then a vmentry occurs CS and SS RPL maybe equal, but > other checks might cause a vmentry failure. I've written a function to > check that guest state is VMX valid - although not all checks are > implemented yet, and I no more get the occasional vmexits. > I'm still worried about undoing the interrupt injection setup. -- error compiling committee.c: too many arguments to function