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: Sun, 12 Nov 2006 10:20:51 +0200 [thread overview]
Message-ID: <4556D963.70409@qumranet.com> (raw)
In-Reply-To: <87r6wa9kr2.wl%simon.kagstrom-6Uc+yI3S9P8@public.gmane.org>
Simon Kagstrom wrote:
> At Fri, 10 Nov 2006 18:11:43 +0200,
> Avi Kivity wrote:
>
>> Simon Kagstrom wrote:
>>
>>> 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%.
>>
>
> OK. Just out of curiosity: What is the reason for the zeroing of the
> segment selectors? I've been looking a bit in the developers manual
> (volume 3a), and section 9.9.1 says
>
> 7. After entering protected mode, the segment registers continue to
> hold the contents they had in real-address mode. The JMP or CALL
> instruction in step 4 resets the CS register.
>
> and thereafter the segment registers should be reloaded. It seems to
> me that KVM does this directly when the PE flag is set (and
> enter_pmode is called), which causes etherboot to not work.
>
>
The problem is 22.3.1.2, "Checks on Guest Segment Registers". When
transitioning to _real_ mode, we have to hack the segment registers so
that VT will accept them. When we switch back, the hacked segments are
no longer suitable for protected mode.
The best way forward is likely to remember the segments during a
real->protected or protected->real mode switch, and on the switch back,
if a segment selector has not been changed, reload it from the saved state.
Long term, we need not to use VT for real mode at all.
>> 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).
>>
>
> I see. Grub and Linux starts with the patch, but I understand that
> it's not a real solution to the problem (but since I need etherboot,
> I'm attempted to continue using it for a while :-)).
>
Can you check Windows? I'd apply the patch if it doesn't break that.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
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
prev parent reply other threads:[~2006-11-12 8:20 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
[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 [this message]
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=4556D963.70409@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