When porting a new OS to xen (using 2.0.7) is it possible to use the builtin GDT for all your purposes, or do you have to create a new one if you want to work with anything but the descriptors that are already in the xen provided one. If you can use the builtin one, how do you access the GDT? Is it in the 64M reserved address space? Regards Ivan Kelly _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 23 Jan 2006, at 18:02, Ivan Kelly wrote:> When porting a new OS to xen (using 2.0.7) is it possible to use the > builtin > GDT for all your purposes, or do you have to create a new one if you > want to > work with anything but the descriptors that are already in the xen > provided > one. > If you can use the builtin one, how do you access the GDT? Is it in > the 64M > reserved address space?You can''t update the built-in GDT. Instead, create your own and pass the list of MFNs that comprise your GDT to the set_gdt() hypercall. You must ensure you have only read-only mappings of those MFNs before passing them to that hypercall! If you wish to update your GDT, use the update_descriptor() hypercall. We could emulate write accesses to the guest GDT, but that hasn''t so far been implemented. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Tue, Jan 24, 2006 at 11:35:05AM +0000, Keir Fraser wrote:> You can''t update the built-in GDT. Instead, create your own and pass > the list of MFNs that comprise your GDT to the set_gdt() hypercall. You > must ensure you have only read-only mappings of those MFNs before > passing them to that hypercall! If you wish to update your GDT, use the > update_descriptor() hypercall.I ended up taking this approach, though i''ve yet to get it to work. With update_descriptor the first argument is a machine address. Should this be the machine frame number + offset of entry? Regards Ivan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Tue, Jan 24, 2006 at 12:04:00PM +0000, Keir Fraser wrote:> Nope, it''s a u64 machine address.32bit machine here, so i guess that should be u32> > Precisely, it''s (MFN << 12) + offsetya, thats what i meant :) Thanks Ivan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 24 Jan 2006, at 11:47, Ivan Kelly wrote:> I ended up taking this approach, though i''ve yet to get it to work. > With > update_descriptor the first argument is a machine address. Should this > be the > machine frame number + offset of entry?Nope, it''s a u64 machine address. Precisely, it''s (MFN << 12) + offset -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> -----Original Message----- > From: xen-devel-bounces@lists.xensource.com > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of Ivan Kelly > Sent: 24 January 2006 12:02 > To: Keir Fraser > Cc: xen-devel@lists.xensource.com > Subject: Re: [Xen-devel] Updating built-in GDT > > On Tue, Jan 24, 2006 at 12:04:00PM +0000, Keir Fraser wrote: > > Nope, it''s a u64 machine address. > 32bit machine here, so i guess that should be u32It would still need to be > 32 bits, as 32-bit machines may have PAE enabled -> 36 bits of addressable memory. You wouldn''t want your code to break just because your GDT is above the 4G boundary, would you? -- Mats> > > > Precisely, it''s (MFN << 12) + offset > ya, thats what i meant :) > Thanks > Ivan > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 24 Jan 2006, at 12:02, Ivan Kelly wrote:>> Nope, it''s a u64 machine address. > 32bit machine here, so i guess that should be u32Always u64 (think PAE: it can support >4GB on a 32b system). -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> You can''t update the built-in GDT. Instead, create your own and pass > the list of MFNs that comprise your GDT to the set_gdt() hypercall. You > must ensure you have only read-only mappings of those MFNs before > passing them to that hypercall! If you wish to update your GDT, use the > update_descriptor() hypercall.does set_gdt add the default descriptors(at 819, 820, 821 etc) or will i have to insert these into my new gdt manually? Regards Ivan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On 24 Jan 2006, at 14:48, Ivan Kelly wrote:>> You can''t update the built-in GDT. Instead, create your own and pass >> the list of MFNs that comprise your GDT to the set_gdt() hypercall. >> You >> must ensure you have only read-only mappings of those MFNs before >> passing them to that hypercall! If you wish to update your GDT, use >> the >> update_descriptor() hypercall. > does set_gdt add the default descriptors(at 819, 820, 821 etc) or will > i have > to insert these into my new gdt manually?The default selectors are 0xe000 and above. They are always available, even if you install your own GDT. To achieve this trick, guest GDTs are limited to 14 pages (7168 entries) rather than 16 pages (8192 entries). -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel