I think I''v tracked pretty much every thing down and that I can merge these patches. Will take some hand work, but .. so what. I do have a questions about one thing in the include/asm--i386/segment.h file. This changes the layout of the per-CPU GDT rather substantually. Is this likely to poison Xen? below in the relevant patch: diff -auP linux-2.6.8.1/include/asm-i386/segment.h linux-2.6.8.1-win4lin/include/asm-i386/segment.h --- linux-2.6.8.1/include/asm-i386/segment.h 2004-08-14 06:55:09.000000000 -0400 +++ linux-2.6.8.1-win4lin/include/asm-i386/segment.h 2004-08-22 21:09:21.000000000 -0400 @@ -1,6 +1,93 @@ #ifndef _ASM_SEGMENT_H #define _ASM_SEGMENT_H +#ifdef CONFIG_MKI + +/* + * The layout of the per-CPU GDT under Linux with CONFIG_MKI: + * + * 0 - 0x000 - null + * 1 - 0x008 - reserved + * 2 - 0x010 - reserved + * 3 - 0x018 - reserved + * + * 4 - 0x020 - unused <==== new cacheline + * 5 - 0x028 - unused + * + * ------- start of TLS (Thread-Local Storage) segments: + * + * 6 - 0x030 - TLS segment #1 [ glibc''s TLS segment ] + * 7 - 0x038 - TLS segment #2 [ Wine''s %fs Win32 segment ] + * 8 - 0x040 - TLS segment #3 + * 9 - 0x048 - reserved + * 10 - 0x050 - reserved + * 11 - 0x058 - reserved + * + * 12 - 0x060 + * | - reserved for MKI use + * V + * 479 - 0xef8 + * + * ------- start of kernel segments: + * 484 - 0xf20 - kernel code segment <==== new cacheline + * 485 - 0xf28 - kernel data segment + * 486 - 0xf30 - default user CS + * 487 - 0xf38 - default user DS + * 488 - 0xf40 - TSS + * 489 - 0xf48 - LDT + * 490 - 0xf50 - PNPBIOS support (16->32 gate) + * 491 - 0xf58 - PNPBIOS support + * 492 - 0xf60 - PNPBIOS support + * 493 - 0xf68 - PNPBIOS support + * 494 - 0xf78 - PNPBIOS support + * 495 - 0xf78 - APM BIOS support + * 496 - 0xf80 - APM BIOS support + * 497 - 0xf88 - APM BIOS support + * 498 - 0xf90 - unused + * 497 - 0xf98 - unused + * 498 - 0xfa0 - unused + * 499 - 0xfa8 - unused + * 500 - 0xfb0 - unused + * 501 - 0xfb8 - TSS for double fault handler + * 502 - 0xfc0 - unused + * | - unused + * V - unused + * 511 - 0xff8 - unused + */ +#define GDT_ENTRY_TLS_ENTRIES 3 +#define GDT_ENTRY_TLS_MIN 6 +#define GDT_ENTRY_TLS_MAX (GDT_ENTRY_TLS_MIN + GDT_ENTRY_TLS_ENTRIES - 1) + +#define TLS_SIZE (GDT_ENTRY_TLS_ENTRIES * 8) + +#define GDT_ENTRY_DEFAULT_USER_CS 486 +#define __USER_CS (GDT_ENTRY_DEFAULT_USER_CS * 8 + 3) + +#define GDT_ENTRY_DEFAULT_USER_DS 487 +#define __USER_DS (GDT_ENTRY_DEFAULT_USER_DS * 8 + 3) + +#define GDT_ENTRY_KERNEL_BASE 484 + +#define GDT_ENTRY_KERNEL_CS (GDT_ENTRY_KERNEL_BASE + 0) +#define __KERNEL_CS (GDT_ENTRY_KERNEL_CS * 8) + +#define GDT_ENTRY_KERNEL_DS (GDT_ENTRY_KERNEL_BASE + 1) +#define __KERNEL_DS (GDT_ENTRY_KERNEL_DS * 8) + +#define GDT_ENTRY_TSS (GDT_ENTRY_KERNEL_BASE + 4) +#define GDT_ENTRY_LDT (GDT_ENTRY_KERNEL_BASE + 5) + +#define GDT_ENTRY_PNPBIOS_BASE (GDT_ENTRY_KERNEL_BASE + 6) +#define GDT_ENTRY_APMBIOS_BASE (GDT_ENTRY_KERNEL_BASE + 11) + +#define GDT_ENTRY_DOUBLEFAULT_TSS 501 + +/* + * The GDT has 512 entries + */ +#define GDT_ENTRIES 512 + +#else /* !CONFIG_MKI */ /* * The layout of the per-CPU GDT under Linux: * ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel
On Thu, Oct 07, 2004 at 05:28:59PM -0400, Tom Cranbrook wrote:> I think I''v tracked pretty much every thing down and that I can merge these > patches. Will take some hand work, but .. so what. > > I do have a questions about one thing in the include/asm--i386/segment.h > file. This changes the layout of the per-CPU GDT rather substantually. Is > this likely to poison Xen?Xen reserves entries 256 - 296 (FIRST_RESERVED_GDT_ENTRY - LAST_RESERVED_GDT_ENTRY). You might be able to change MKI? to not use those entries, unless it really needs all the entries it reserves... Also note that updating GDT entries in a Xen guest isn''t straightforward but needs to be done using HYPERVISOR_update_descriptor. See updating of the 3 TLS entries for examples.... christian ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Xen-devel mailing list Xen-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xen-devel