From: Keir Fraser Subject: Re: Early test for 32- vs 64-bit hvm domain? Date: Wed, 30 Jan 2008 19:28:24 +0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Andi Kleen Cc: "dan.magenheimer@oracle.com" , "xen-devel@lists.xensource.com" , Samuel Thibault List-Id: xen-devel@lists.xenproject.org On 30/1/08 18:44, "Andi Kleen" wrote: >> As sson as you see LME bit get set in the EFER MSR then you know you have a >> 64-bit guest. Writes to EFER are emulated in long_mode_do_msr_write() in >> vmx.c and svm.c. Those are the places to patch in Xen 3.1 branch. > > You could do it slightly earlier by intercepting bios int 0x15 eax=0xec00 > ebx=2 The kernel issues that to tell the BIOS it is 64bit. > > That will only work if the boot loader does not skip the real mode code > (a few do) Oh, I hadn't read about that. We should probably make that call during Xen boot then. For this particular issue I expect that trapping EFER.LME is equally good, and it depends on whether the trap is more conveniently triggered in the hypervisor itself or in the virtual bios. -- Keir