From: Mohammed Gamal Subject: Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator Date: Mon, 12 Jul 2010 15:36:47 +0300 Message-ID: References: <1278888970-2936-1-git-send-email-m.gamal005@gmail.com> <4C3AB59B.60705@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: mtosatti@redhat.com, kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mail-fx0-f46.google.com ([209.85.161.46]:64917 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752626Ab0GLMgw convert rfc822-to-8bit (ORCPT ); Mon, 12 Jul 2010 08:36:52 -0400 Received: by fxm14 with SMTP id 14so2251251fxm.19 for ; Mon, 12 Jul 2010 05:36:50 -0700 (PDT) In-Reply-To: <4C3AB59B.60705@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Mon, Jul 12, 2010 at 9:26 AM, Avi Kivity wrote: > On 07/12/2010 01:56 AM, Mohammed Gamal wrote: >> >> fter some conversation with Avi concerning why unreal mode has been = seen >> to work >> with KVM on Intel. It clears out the scenario is caused as follows: >> >> - guest enters big real mode >> - kvm squashes limit to 64k-1 >> - guest executes instructions with offset> =A064k >> - cpu issues #GP due to limit violation >> - kvm handle_rmode_exception() -> =A0emulator >> - emulator ignores limit, emulates instruction >> >> With these applied I am getting vmentry failures with SeaBIOS and >> gPXE. I could still get SeaBIOS to work with >> emulate_invalid_guest_state=3D1. >> So it's needless to say that these patches are not meant for merging= ! >> > > Well, eventually you need to fix this. What happens is that guests are switched to big real mode so either gPXE and SeaBIOS need to be modified to work with the way KVM handles segment limits when switching to real mode, but that'd be only a temporary solution. The other - and better IMO - option is to get e_i_g_s=3D1 completely functional, which is something we want to do anyway. So we can address all the comments you have on these patches and eventually merge them along with the rest of e_i_g_s patches. > >> -------- >> >> Changes from v2: >> - Addeded generic segment limit check helpers >> - Removed individual segment register segment helpers as they're no = longer >> needed >> >> > > What about the rest of my comments? I did change the limit calculations to avoid overflows, and re-arranged patches as per your suggestion. Sorry for not pointing this out in the change log. Check the patches I sent out for details. > > -- > I have a truly marvellous patch that fixes the bug which this > signature is too narrow to contain. > >