[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] question about xen virtual base address


  • To: "Agarwal, Lomesh" <lomesh.agarwal@xxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
  • Date: Sun, 09 Mar 2008 15:31:03 +0000
  • Delivery-date: Sun, 09 Mar 2008 08:32:24 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AciBcSJYH774l4FPSG+NLhaEkXN2zwAiXMnC
  • Thread-topic: [Xen-devel] question about xen virtual base address

Answer to both questions is that we want to keep out of the way of
paravirtual guest OS addressing. Guests want to use virtual addresses from
0x0, so Xen has to be raised up out of the way. Similarly, guests may expect
to use GDT entries starting from entry 0 upwards, and hence Xen gets pushed
up to the last two pages of a full-size GDT. Both of these shifts are
required because Xen shares its own virtual-memory structures (GDT, page
tables) with the guest, for efficient switching between guest context and
hypervisor context.

 -- Keir

On 8/3/08 23:07, "Agarwal, Lomesh" <lomesh.agarwal@xxxxxxxxx> wrote:

> I have two questions regarding x86_64 xen boot code -
> 1. It looks like Xen base virtual address is 0xFFFF830000000000. That's
> why Page table needs to have mirror mapping for lower and higher virtual
> address. If the base virtual address would have been 0 (__PAGE_OFFSET),
> code in file x86_64.S would have been much easy to understand and
> maintain. So, is there a specific reason to choose this high virtual
> address?
> 2. Why do we need to subtract FIRST_RESERVED_GDT_BYTE (14 pages) from
> address of gdt_table when calculating the base address for GDT table?
> How does this subtraction give the right address for GDT table?
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.