From: "Tom Cranbrook" <tcranbrook@australia.edu>
To: xen-devel@lists.sourceforge.net
Subject: win4lin on Xen
Date: Thu, 07 Oct 2004 17:28:59 -0400 [thread overview]
Message-ID: <41669048.39ce.0@australia.edu> (raw)
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
next reply other threads:[~2004-10-07 21:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-07 21:28 Tom Cranbrook [this message]
2004-10-07 23:09 ` win4lin on Xen Christian Limpach
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41669048.39ce.0@australia.edu \
--to=tcranbrook@australia.edu \
--cc=xen-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.