From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: Simon Kagstrom <simon.kagstrom-6Uc+yI3S9P8@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: Etherboot problems
Date: Fri, 10 Nov 2006 18:11:43 +0200 [thread overview]
Message-ID: <4554A4BF.5020409@qumranet.com> (raw)
In-Reply-To: <87odrfgvqf.wl%simon.kagstrom-6Uc+yI3S9P8@public.gmane.org>
Simon Kagstrom wrote:
> At Thu, 09 Nov 2006 19:49:05 +0200,
> Avi Kivity wrote:
>
>> Very likely this is due to VT's inability to virtualize real mode
>> correctly. Is anyone in the mood to extend x86_emulate.c to support
>> real mode?
>>
>
> I found what caused the problems for the etherboot startup and it now
> works fine (well, I've not tested downloading anything over the
> network, but at least it gets that far). I've started grub as well,
> and that works as before even with this fix.
>
> However, I'm not sure what the correct solution to the problem is.
>
> The crash occurs after etherboot has switched to protected mode and
> does a long jump to the new code segment:
>
> /* Load GDT */
> 1: DATA32 lgdt %ds:(r2p_gdt-1b)(%bx) /* Load GDT */
>
> /* Switch to protected mode */
> 2: movl %cr0, %eax
> 3: orb $CR0_PE, %al
> 4: movl %eax, %cr0
>
> /* flush prefetch queue, and reload %cs:%eip */
> 5: DATA32 ljmp %ds:*(r2p_paddr-1b)(%bx)
> .code32
>
> The problem is that KVM zeroes all segment registers directly on a
> switch to protected mode (i.e., on instruction 4 above) - and %ds
> being zero causes a crash on the ljmp above.
>
> What I've done is to remove the zeroing of all segment registers
> except %ss, which is shown in the trivial patch below. I don't
> remember enough of transfer-to-protected-mode assembly to know the
> correct solution to this (the %ss zeroing needs to be kept for
> example, not sure why).
>
VT does a lot of checks when entering guest mode. These checks are
stricter than what the processor can handle, and stricter than what some
software expects. The upshot is that virtualizing real mode and the
transition between modes can't be made to work 100%.
The long term solution is to emulate rather than virtualize while in
these states. Short term, I'll see if there's some workaround we can
apply here (your patch probably makes other guests fail; I'll check this
though).
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
next prev parent reply other threads:[~2006-11-10 16:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-09 16:05 Etherboot problems Simon Kagstrom
[not found] ` <874pt8ip14.wl%simon.kagstrom-6Uc+yI3S9P8@public.gmane.org>
2006-11-09 16:17 ` Avi Kivity
[not found] ` <455354AB.8000908-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-09 17:49 ` Avi Kivity
[not found] ` <45536A11.6050808-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-09 18:11 ` Simon Kagstrom
[not found] ` <873b8sij7k.wl%simon.kagstrom-6Uc+yI3S9P8@public.gmane.org>
2006-11-10 2:32 ` Anthony Liguori
2006-11-10 15:35 ` Simon Kagstrom
[not found] ` <87odrfgvqf.wl%simon.kagstrom-6Uc+yI3S9P8@public.gmane.org>
2006-11-10 16:11 ` Avi Kivity [this message]
[not found] ` <4554A4BF.5020409-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2006-11-11 13:27 ` Simon Kagstrom
[not found] ` <87r6wa9kr2.wl%simon.kagstrom-6Uc+yI3S9P8@public.gmane.org>
2006-11-12 8:20 ` Avi Kivity
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=4554A4BF.5020409@qumranet.com \
--to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=simon.kagstrom-6Uc+yI3S9P8@public.gmane.org \
/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