Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator

2010-07-26 Thread Avi Kivity
On 07/25/2010 07:23 PM, Kevin O'Connor wrote: On Sun, Jul 25, 2010 at 11:54:20AM +0300, Avi Kivity wrote: On 07/24/2010 06:45 PM, Kevin O'Connor wrote: On Mon, Jul 12, 2010 at 04:13:06PM +0300, Avi Kivity wrote: Does SeaBIOS use big real mode now? SeaBIOS calls option roms in big real

Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator

2010-07-26 Thread Stefan Hajnoczi
On Mon, Jul 26, 2010 at 12:47 PM, Avi Kivity a...@redhat.com wrote:  On 07/25/2010 07:23 PM, Kevin O'Connor wrote: On Sun, Jul 25, 2010 at 11:54:20AM +0300, Avi Kivity wrote:  On 07/24/2010 06:45 PM, Kevin O'Connor wrote: On Mon, Jul 12, 2010 at 04:13:06PM +0300, Avi Kivity wrote: Does

Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator

2010-07-25 Thread Avi Kivity
On 07/24/2010 06:45 PM, Kevin O'Connor wrote: On Mon, Jul 12, 2010 at 04:13:06PM +0300, Avi Kivity wrote: Does SeaBIOS use big real mode now? SeaBIOS calls option roms in big real mode. This is required by the relevant specs. Can you provide a pointer? See the transition16big function in

Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator

2010-07-25 Thread Avi Kivity
On 07/24/2010 07:16 PM, Kevin O'Connor wrote: On Sat, Jul 24, 2010 at 11:45:22AM -0400, Kevin O'Connor wrote: On Mon, Jul 12, 2010 at 04:13:06PM +0300, Avi Kivity wrote: Does SeaBIOS use big real mode now? SeaBIOS calls option roms in big real mode. This is required by the relevant specs.

Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator

2010-07-25 Thread Kevin O'Connor
On Sun, Jul 25, 2010 at 11:54:20AM +0300, Avi Kivity wrote: On 07/24/2010 06:45 PM, Kevin O'Connor wrote: On Mon, Jul 12, 2010 at 04:13:06PM +0300, Avi Kivity wrote: Does SeaBIOS use big real mode now? SeaBIOS calls option roms in big real mode. This is required by the relevant specs.

Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator

2010-07-25 Thread Kevin O'Connor
On Sun, Jul 25, 2010 at 11:55:47AM +0300, Avi Kivity wrote: On 07/24/2010 07:16 PM, Kevin O'Connor wrote: On Sat, Jul 24, 2010 at 11:45:22AM -0400, Kevin O'Connor wrote: On Mon, Jul 12, 2010 at 04:13:06PM +0300, Avi Kivity wrote: Does SeaBIOS use big real mode now? SeaBIOS calls option roms

Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator

2010-07-25 Thread Kevin O'Connor
On Sun, Jul 25, 2010 at 12:42:46PM -0400, Kevin O'Connor wrote: On Sun, Jul 25, 2010 at 11:55:47AM +0300, Avi Kivity wrote: What conditions are needed to trigger this path? This can't occur under normal operation, since it will fail badly with kvm on Intel. It's called on every boot.

Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator

2010-07-25 Thread Avi Kivity
On 07/25/2010 08:19 PM, Kevin O'Connor wrote: On Sun, Jul 25, 2010 at 12:42:46PM -0400, Kevin O'Connor wrote: On Sun, Jul 25, 2010 at 11:55:47AM +0300, Avi Kivity wrote: What conditions are needed to trigger this path? This can't occur under normal operation, since it will fail badly with

Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator

2010-07-25 Thread Kevin O'Connor
On Sun, Jul 25, 2010 at 09:34:38PM +0300, Avi Kivity wrote: On 07/25/2010 08:19 PM, Kevin O'Connor wrote: Only the ljmpw is in big real mode with a code address64K - the Disable protected mode code is technically in 16bit protected mode. I'm not sure if that helps explain why it works.

Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator

2010-07-24 Thread Kevin O'Connor
On Mon, Jul 12, 2010 at 04:13:06PM +0300, Avi Kivity wrote: Does SeaBIOS use big real mode now? SeaBIOS calls option roms in big real mode. This is required by the relevant specs. See the transition16big function in src/romlayout.S. It briefly jumps to an address at 0xffxxx during the

Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator

2010-07-24 Thread Kevin O'Connor
On Sat, Jul 24, 2010 at 11:45:22AM -0400, Kevin O'Connor wrote: On Mon, Jul 12, 2010 at 04:13:06PM +0300, Avi Kivity wrote: Does SeaBIOS use big real mode now? SeaBIOS calls option roms in big real mode. This is required by the relevant specs. See the transition16big function in

Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator

2010-07-12 Thread Avi Kivity
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

Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator

2010-07-12 Thread Mohammed Gamal
On Mon, Jul 12, 2010 at 9:26 AM, Avi Kivity a...@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

Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator

2010-07-12 Thread Avi Kivity
On 07/12/2010 03:36 PM, Mohammed Gamal wrote: On Mon, Jul 12, 2010 at 9:26 AM, Avi Kivitya...@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

Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator

2010-07-12 Thread Avi Kivity
On 07/12/2010 04:39 PM, Mohammed Gamal wrote: 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

Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator

2010-07-12 Thread Gleb Natapov
On Mon, Jul 12, 2010 at 04:51:10PM +0300, Avi Kivity wrote: On 07/12/2010 04:39 PM, Mohammed Gamal wrote: 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

Re: [RFC PATCH v3 0/3] Add segment limit checks to emulator

2010-07-12 Thread Avi Kivity
On 07/12/2010 05:41 PM, Gleb Natapov wrote: A good way to do this is to add a segment variable to 'struct operand', and doing all the base adjustment at the end (instead of up front as we do now). That means we'll have the minimum number of places to add checks to. -read_emulated(),

[RFC PATCH v3 0/3] Add segment limit checks to emulator

2010-07-11 Thread Mohammed Gamal
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 -