Linker changes to add the VMI MACH_TEXT area into the kernel text
section. This area layout is heavily influenced by magic to overlap
exactly with the 32-byte VMI ROM entry points, allowing the kernel
to copy the VMI ROM over the native section. As use of magic is
on the decline, this approach is being phased out in favor of the
more modern approach of the inline implementation. The translation
and annotation sections are used to store the annotation information
which may be used to enlighten the hypervisor about code locations
and local conditions of virtualization relevant system operations.
Bottom line - MACH_TEXT and the dependence on exact layout of the
ROM image are hideous and are going away.
Signed-off-by: Zachary Amsden <zach@vmware.com>
Index: linux-2.6.16-rc3/arch/i386/kernel/vmlinux.lds.S
==================================================================---
linux-2.6.16-rc3.orig/arch/i386/kernel/vmlinux.lds.S 2006-02-24
13:48:54.000000000 -0800
+++ linux-2.6.16-rc3/arch/i386/kernel/vmlinux.lds.S 2006-02-24
13:49:20.000000000 -0800
@@ -4,7 +4,7 @@
#define LOAD_OFFSET __PAGE_OFFSET
-#include <asm-generic/vmlinux.lds.h>
+#include <asm/vmlinux.lds.h>
#include <asm/thread_info.h>
#include <asm/page.h>
@@ -23,6 +23,7 @@ SECTIONS
SCHED_TEXT
LOCK_TEXT
KPROBES_TEXT
+ MACH_TEXT
*(.fixup)
*(.gnu.warning)
} = 0x9090
@@ -36,6 +37,21 @@ SECTIONS
RODATA
+#ifdef CONFIG_X86_VMI
+ __vmi_translation = .;
+ .vmi.translation : AT(ADDR(.vmi.translation) - LOAD_OFFSET) {
+ *(.vmi.translation)
+ }
+ __vmi_translation_end = .;
+
+ . = ALIGN(16);
+ .vmi.annotation : AT(ADDR(.vmi.annotation) - LOAD_OFFSET) {
+ __vmi_annotation = .;
+ *(.vmi.annotation)
+ __vmi_annotation_end = .;
+ }
+#endif
+
/* writeable */
.data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */
*(.data)
@@ -142,6 +158,7 @@ SECTIONS
/* Sections to be discarded */
/DISCARD/ : {
*(.exitcall.exit)
+ *(.vmi.native)
}
STABS_DEBUG
Index: linux-2.6.16-rc3/include/asm-i386/vmlinux.lds.h
==================================================================---
linux-2.6.16-rc3.orig/include/asm-i386/vmlinux.lds.h 2006-02-24
13:49:20.000000000 -0800
+++ linux-2.6.16-rc3/include/asm-i386/vmlinux.lds.h 2006-02-24
13:49:20.000000000 -0800
@@ -0,0 +1,2 @@
+#include <asm-generic/vmlinux.lds.h>
+#include <mach-vmlinux.lds.h>
Index: linux-2.6.16-rc3/include/asm-i386/mach-vmi/mach-vmlinux.lds.h
==================================================================---
linux-2.6.16-rc3.orig/include/asm-i386/mach-vmi/mach-vmlinux.lds.h 2006-02-24
13:49:20.000000000 -0800
+++ linux-2.6.16-rc3/include/asm-i386/mach-vmi/mach-vmlinux.lds.h 2006-02-24
13:49:20.000000000 -0800
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2005, VMware, Inc.
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
+ * NON INFRINGEMENT. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Send feedback to zach@vmware.com
+ *
+ */
+
+#include <vmiCalls.h>
+
+#define VDEF(name) \
+ . = __VMI_NEXT; \
+ __VMI_NEXT = . + 32; \
+ *(.text.VMI_##name);
+
+#define MACH_TEXT \
+. = ALIGN(4096); \
+__VMI_START = .; \
+__VMI_NEXT = .; \
+__VMI_END = . + 16384; \
+VMI_CALLS \
+. = __VMI_END; \
+. = ALIGN(4096);
Index: linux-2.6.16-rc3/include/asm-i386/mach-default/mach-vmlinux.lds.h
==================================================================---
linux-2.6.16-rc3.orig/include/asm-i386/mach-default/mach-vmlinux.lds.h
2006-02-24 13:49:20.000000000 -0800
+++ linux-2.6.16-rc3/include/asm-i386/mach-default/mach-vmlinux.lds.h 2006-02-24
13:49:20.000000000 -0800
@@ -0,0 +1 @@
+#define MACH_TEXT /* nothing */