public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Mohammed Gamal <m.gamal005@gmail.com>
Cc: mtosatti@redhat.com, kvm@vger.kernel.org
Subject: Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator
Date: Mon, 12 Jul 2010 16:13:06 +0300	[thread overview]
Message-ID: <4C3B14E2.8050404@redhat.com> (raw)
In-Reply-To: <AANLkTimVp6AIktHQ7z2IUoeVLRJ4RTwnDkmB2chf44DT@mail.gmail.com>

On 07/12/2010 03:36 PM, Mohammed Gamal wrote:
> On Mon, Jul 12, 2010 at 9:26 AM, Avi Kivity<avi@redhat.com>  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>    64k
>>> - cpu issues #GP due to limit violation
>>> - kvm handle_rmode_exception() ->    emulator
>>> - 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=1.
>>> 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=1 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.
>    

Does SeaBIOS use big real mode now?

I think this can work even with e_i_g_s=0.  Simply return 
vmx->rmode.seg.limit instead of GUEST_seg_LIMIT.  In fact we need to do 
this anyway, so live migration migrates the correct limit, not the hack 
that we do for vmx.

>>> --------
>>>
>>> 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.
>    

What about expand-down segments?  and moving the limit check where the 
access is emulated (so we are sure we don't miss a check)?

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2010-07-12 13:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-11 22:56 [RFC PATCH v3 0/3] Add segment limit checks to emulator Mohammed Gamal
2010-07-11 22:56 ` [RFC PATCH v3 1/3] Add helper methods to get segment limits Mohammed Gamal
2010-07-11 22:56 ` [RFC PATCH v3 2/3] x86 emulator: Add segment limit checking helpers Mohammed Gamal
2010-07-11 22:56 ` [RFC PATCH v3 3/3] x86 emulator: Add segment limit checks to emulator functions Mohammed Gamal
2010-07-12  6:26 ` [RFC PATCH v3 0/3] Add segment limit checks to emulator Avi Kivity
2010-07-12 12:36   ` Mohammed Gamal
2010-07-12 13:13     ` Avi Kivity [this message]
     [not found]       ` <AANLkTimHvpE05chocuoQnY0ydOMchMcIInu9QX5F_pV4@mail.gmail.com>
2010-07-12 13:51         ` Avi Kivity
2010-07-12 14:41           ` Gleb Natapov
2010-07-12 14:49             ` Avi Kivity
2010-07-24 15:45       ` Kevin O'Connor
2010-07-24 16:16         ` Kevin O'Connor
2010-07-25  8:55           ` Avi Kivity
2010-07-25 16:42             ` Kevin O'Connor
2010-07-25 17:19               ` Kevin O'Connor
2010-07-25 18:34                 ` Avi Kivity
2010-07-25 18:55                   ` Kevin O'Connor
2010-07-25  8:54         ` Avi Kivity
2010-07-25 16:23           ` Kevin O'Connor
2010-07-26 11:47             ` Avi Kivity
2010-07-26 17:47               ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C3B14E2.8050404@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=m.gamal005@gmail.com \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox