From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Etherboot problems Date: Sun, 12 Nov 2006 10:20:51 +0200 Message-ID: <4556D963.70409@qumranet.com> References: <874pt8ip14.wl%simon.kagstrom@bth.se> <455354AB.8000908@qumranet.com> <45536A11.6050808@qumranet.com> <87odrfgvqf.wl%simon.kagstrom@bth.se> <4554A4BF.5020409@qumranet.com> <87r6wa9kr2.wl%simon.kagstrom@bth.se> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Return-path: To: Simon Kagstrom In-Reply-To: <87r6wa9kr2.wl%simon.kagstrom-6Uc+yI3S9P8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.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