WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] switch out of 32e mode issue

To: "Zhai, Edwin" <edwin.zhai@xxxxxxxxx>
Subject: Re: [Xen-devel] switch out of 32e mode issue
From: Ian Campbell <Ian.Campbell@xxxxxxxxxxxxx>
Date: Tue, 03 Jul 2007 10:09:17 +0100
Cc: Ian Pratt <m+Ian.Pratt@xxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 03 Jul 2007 02:07:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070703065148.GD20797@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20070703065148.GD20797@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Tue, 2007-07-03 at 14:51 +0800, Zhai, Edwin wrote:
> Ian,
> 
> I have read the your changeset 13830

That was me rather than Ian P.

> "[XEN] kexec: add compatability shim for kexec in 32on64 mode", which seems 
> to 
> be used for kexec a 32b kernel on 32e xen.
> 
> I borrow some of the code from xen/arch/x86/x86_64/compat_kexec.S for similar 
> purpose(switch out of 32e mode in xen) by similar way:
> 1. setup identity map in idle_pg_table then switch to it.
> 2. ljmp to a identity map code in another code segment of compatibility mode
> 3. turn of paging by clear CR0.PG
> 4. load a new cr3 with legacy page table
> 5. clear EFER.LME
> 6. turn on paging by set CR0.PG
> 7. a branch instruction
> 
> But I always have a GP fault in step 3 when mov cr0:(
> (XEN) ****************************************
> (XEN) Panic on CPU 0:
> (XEN) GENERAL PROTECTION FAULT
> (XEN) [error_code=0000]
> (XEN) ****************************************
> 
> Do you have successful run for the above code? Your code missed step 7, does 
> it 
> matter?
> 
> Do you have any comments for the GP fault?

I was simply following the procedure described in vol3 of the software
developers manual "Switching out of ia-32e mode operation" (section
9.8.5.4 in my slightly old copy).

I presume you are seeing the GP when you try and write to CR0 with PG
cleared. Without seeing the code I'd guess the GP is most likely because
you aren't actually in compatibility mode. Did Xen print any debug info
before the panic, such as current register state?

Another possibility is that EIP isn't really an identity mapped page.
Depending on the version of Xen you are using you would have to deal
with the physical relocation which is performed at boot time, for
example. I'm not sure that wouldn't cause an invalid op rather than GPF
though.

Ian.



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel