From: Chris Wright <chrisw@sous-sol.org>
To: linux-kernel@vger.kernel.org
Cc: virtualization@lists.osdl.org, xen-devel@lists.xensource.com,
Jeremy Fitzhardinge <jeremy@goop.org>, Andi Kleen <ak@suse.de>,
Andrew Morton <akpm@osdl.org>,
Rusty Russell <rusty@rustcorp.com.au>,
Zachary Amsden <zach@vmware.com>,
Ian Pratt <ian.pratt@xensource.com>,
Christian Limpach <Christian.Limpach@cl.cam.ac.uk>,
Jeremy Fitzhardinge <jeremy@xensource.com>
Subject: [RFC PATCH 09/33] Add start-of-day setup hooks to subarch
Date: Tue, 18 Jul 2006 00:00:09 -0700 [thread overview]
Message-ID: <20060718091950.750213000@sous-sol.org> (raw)
In-Reply-To: 20060718091807.467468000@sous-sol.org
[-- Attachment #1: i386-setup --]
[-- Type: text/plain, Size: 10291 bytes --]
Implement the start-of-day subarchitecture setup hooks for booting on
Xen. Add subarch macros for determining loader type and initrd
location.
Signed-off-by: Ian Pratt <ian.pratt@xensource.com>
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
---
arch/i386/kernel/setup.c | 2 +
arch/i386/mach-default/Makefile | 2 -
arch/i386/mach-default/setup-memory.c | 43 ++++++++++++++++++++++
arch/i386/mach-default/setup.c | 43 ----------------------
arch/i386/mach-xen/Makefile | 2 -
arch/i386/mach-xen/setup-xen.c | 54 ++++++++++++++++++++++++++++
include/asm-i386/hypervisor.h | 4 ++
include/asm-i386/mach-default/mach_setup.h | 12 ++++++
include/asm-i386/mach-xen/mach_setup.h | 15 +++++++
include/asm-i386/mach-xen/setup_arch.h | 9 ++++
include/asm-i386/setup.h | 20 ++++++----
11 files changed, 153 insertions(+), 53 deletions(-)
diff -r a5848bce3730 arch/i386/kernel/setup.c
--- a/arch/i386/kernel/setup.c Thu Jun 22 16:02:54 2006 -0400
+++ b/arch/i386/kernel/setup.c Thu Jun 22 20:20:31 2006 -0400
@@ -458,6 +458,7 @@ static void __init print_memory_map(char
}
}
+#ifndef HAVE_ARCH_E820_SANITIZE
/*
* Sanitize the BIOS e820 map.
*
@@ -677,6 +678,7 @@ int __init copy_e820_map(struct e820entr
} while (biosmap++,--nr_map);
return 0;
}
+#endif
#if defined(CONFIG_EDD) || defined(CONFIG_EDD_MODULE)
struct edd edd;
diff -r a5848bce3730 arch/i386/mach-default/Makefile
--- a/arch/i386/mach-default/Makefile Thu Jun 22 16:02:54 2006 -0400
+++ b/arch/i386/mach-default/Makefile Thu Jun 22 20:20:31 2006 -0400
@@ -2,4 +2,4 @@
# Makefile for the linux kernel.
#
-obj-y := setup.o
+obj-y := setup.o setup-memory.o
diff -r a5848bce3730 arch/i386/mach-default/setup.c
--- a/arch/i386/mach-default/setup.c Thu Jun 22 16:02:54 2006 -0400
+++ b/arch/i386/mach-default/setup.c Thu Jun 22 20:20:31 2006 -0400
@@ -8,8 +8,6 @@
#include <linux/interrupt.h>
#include <asm/acpi.h>
#include <asm/arch_hooks.h>
-#include <asm/e820.h>
-#include <asm/setup.h>
#ifdef CONFIG_HOTPLUG_CPU
#define DEFAULT_SEND_IPI (1)
@@ -132,44 +130,3 @@ static int __init print_ipi_mode(void)
}
late_initcall(print_ipi_mode);
-
-/**
- * machine_specific_memory_setup - Hook for machine specific memory setup.
- *
- * Description:
- * This is included late in kernel/setup.c so that it can make
- * use of all of the static functions.
- **/
-
-char * __init machine_specific_memory_setup(void)
-{
- char *who;
-
-
- who = "BIOS-e820";
-
- /*
- * Try to copy the BIOS-supplied E820-map.
- *
- * Otherwise fake a memory map; one section from 0k->640k,
- * the next section from 1mb->appropriate_mem_k
- */
- sanitize_e820_map(E820_MAP, &E820_MAP_NR);
- if (copy_e820_map(E820_MAP, E820_MAP_NR) < 0) {
- unsigned long mem_size;
-
- /* compare results from other methods and take the greater */
- if (ALT_MEM_K < EXT_MEM_K) {
- mem_size = EXT_MEM_K;
- who = "BIOS-88";
- } else {
- mem_size = ALT_MEM_K;
- who = "BIOS-e801";
- }
-
- e820.nr_map = 0;
- add_memory_region(0, LOWMEMSIZE(), E820_RAM);
- add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM);
- }
- return who;
-}
diff -r a5848bce3730 arch/i386/mach-xen/Makefile
--- a/arch/i386/mach-xen/Makefile Thu Jun 22 16:02:54 2006 -0400
+++ b/arch/i386/mach-xen/Makefile Thu Jun 22 20:20:31 2006 -0400
@@ -2,6 +2,6 @@
# Makefile for the linux kernel.
#
-obj-y := setup.o
+obj-y := setup.o setup-xen.o
setup-y := ../mach-default/setup.o
diff -r a5848bce3730 include/asm-i386/hypervisor.h
--- a/include/asm-i386/hypervisor.h Thu Jun 22 16:02:54 2006 -0400
+++ b/include/asm-i386/hypervisor.h Thu Jun 22 20:20:31 2006 -0400
@@ -55,6 +55,10 @@ extern struct shared_info *HYPERVISOR_sh
extern struct shared_info *HYPERVISOR_shared_info;
extern struct start_info *xen_start_info;
+/* arch/i386/mach-xen/entry.S */
+extern void hypervisor_callback(void);
+extern void failsafe_callback(void);
+
/* arch/i386/mach-xen/evtchn.c */
/* Force a proper event-channel callback from Xen. */
extern void force_evtchn_callback(void);
diff -r a5848bce3730 include/asm-i386/setup.h
--- a/include/asm-i386/setup.h Thu Jun 22 16:02:54 2006 -0400
+++ b/include/asm-i386/setup.h Thu Jun 22 20:20:31 2006 -0400
@@ -49,10 +49,10 @@ extern unsigned char boot_params[PARAM_S
#define VIDEO_MODE (*(unsigned short *) (PARAM+0x1FA))
#define ORIG_ROOT_DEV (*(unsigned short *) (PARAM+0x1FC))
#define AUX_DEVICE_INFO (*(unsigned char *) (PARAM+0x1FF))
-#define LOADER_TYPE (*(unsigned char *) (PARAM+0x210))
+#define LOADER_TYPE MACH_LOADER_TYPE
#define KERNEL_START (*(unsigned long *) (PARAM+0x214))
-#define INITRD_START (*(unsigned long *) (PARAM+0x218))
-#define INITRD_SIZE (*(unsigned long *) (PARAM+0x21c))
+#define INITRD_START MACH_INITRD_START
+#define INITRD_SIZE MACH_INITRD_SIZE
#define EDID_INFO (*(struct edid_info *) (PARAM+0x140))
#define EDD_NR (*(unsigned char *) (PARAM+EDDNR))
#define EDD_MBR_SIG_NR (*(unsigned char *) (PARAM+EDD_MBR_SIG_NR_BUF))
@@ -65,15 +65,19 @@ extern unsigned char boot_params[PARAM_S
*/
#define LOWMEMSIZE() (0x9f000)
+extern unsigned long init_pg_tables_end;
+
struct e820entry;
-char * __init machine_specific_memory_setup(void);
+char * machine_specific_memory_setup(void);
-int __init copy_e820_map(struct e820entry * biosmap, int nr_map);
-int __init sanitize_e820_map(struct e820entry * biosmap, char * pnr_map);
-void __init add_memory_region(unsigned long long start,
- unsigned long long size, int type);
+int copy_e820_map(struct e820entry * biosmap, int nr_map);
+int sanitize_e820_map(struct e820entry * biosmap, char * pnr_map);
+void add_memory_region(unsigned long long start,
+ unsigned long long size, int type);
#endif /* __ASSEMBLY__ */
+#include <mach_setup.h>
+
#endif /* _i386_SETUP_H */
diff -r a5848bce3730 arch/i386/mach-default/setup-memory.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/arch/i386/mach-default/setup-memory.c Thu Jun 22 20:20:31 2006 -0400
@@ -0,0 +1,44 @@
+#include <linux/init.h>
+#include <asm/e820.h>
+#include <asm/setup.h>
+
+/**
+ * machine_specific_memory_setup - Hook for machine specific memory setup.
+ *
+ * Description:
+ * This is included late in kernel/setup.c so that it can make
+ * use of all of the static functions.
+ **/
+
+char * __init machine_specific_memory_setup(void)
+{
+ char *who;
+
+
+ who = "BIOS-e820";
+
+ /*
+ * Try to copy the BIOS-supplied E820-map.
+ *
+ * Otherwise fake a memory map; one section from 0k->640k,
+ * the next section from 1mb->appropriate_mem_k
+ */
+ sanitize_e820_map(E820_MAP, &E820_MAP_NR);
+ if (copy_e820_map(E820_MAP, E820_MAP_NR) < 0) {
+ unsigned long mem_size;
+
+ /* compare results from other methods and take the greater */
+ if (ALT_MEM_K < EXT_MEM_K) {
+ mem_size = EXT_MEM_K;
+ who = "BIOS-88";
+ } else {
+ mem_size = ALT_MEM_K;
+ who = "BIOS-e801";
+ }
+
+ e820.nr_map = 0;
+ add_memory_region(0, LOWMEMSIZE(), E820_RAM);
+ add_memory_region(HIGH_MEMORY, mem_size << 10, E820_RAM);
+ }
+ return who;
+}
diff -r a5848bce3730 arch/i386/mach-xen/setup-xen.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/arch/i386/mach-xen/setup-xen.c Thu Jun 22 20:20:31 2006 -0400
@@ -0,0 +1,54 @@
+/*
+ * Machine specific setup for xen
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/mm.h>
+
+#include <asm/e820.h>
+#include <asm/setup.h>
+#include <asm/hypervisor.h>
+#include <asm/hypercall.h>
+
+#include <xen/interface/physdev.h>
+
+
+struct start_info *xen_start_info;
+EXPORT_SYMBOL(xen_start_info);
+
+/*
+ * Point at the empty zero page to start with. We map the real shared_info
+ * page as soon as fixmap is up and running.
+ */
+struct shared_info *HYPERVISOR_shared_info = (struct shared_info *)empty_zero_page;
+EXPORT_SYMBOL(HYPERVISOR_shared_info);
+
+/**
+ * machine_specific_memory_setup - Hook for machine specific memory setup.
+ **/
+
+char * __init machine_specific_memory_setup(void)
+{
+ unsigned long max_pfn = xen_start_info->nr_pages;
+
+ e820.nr_map = 0;
+ add_memory_region(0, PFN_PHYS(max_pfn), E820_RAM);
+
+ return "Xen";
+}
+
+void __init machine_specific_arch_setup(void)
+{
+#ifdef CONFIG_ACPI
+ if (!(xen_start_info->flags & SIF_INITDOMAIN)) {
+ printk(KERN_INFO "ACPI in unprivileged domain disabled\n");
+ acpi_disabled = 1;
+ acpi_ht = 0;
+ }
+#endif
+
+ memcpy(saved_command_line, xen_start_info->cmd_line,
+ MAX_GUEST_CMDLINE > COMMAND_LINE_SIZE ?
+ COMMAND_LINE_SIZE : MAX_GUEST_CMDLINE);
+}
diff -r a5848bce3730 include/asm-i386/mach-default/mach_setup.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/asm-i386/mach-default/mach_setup.h Thu Jun 22 20:20:31 2006 -0400
@@ -0,0 +1,12 @@
+#ifndef __ASM_MACH_SETUP_H
+#define __ASM_MACH_SETUP_H
+
+#ifndef __ASSEMBLY__
+
+#define MACH_LOADER_TYPE (*(unsigned char *) (PARAM+0x210))
+#define MACH_INITRD_START (*(unsigned long *) (PARAM+0x218))
+#define MACH_INITRD_SIZE (*(unsigned long *) (PARAM+0x21c))
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* __ASM_MACH_SETUP_H */
diff -r a5848bce3730 include/asm-i386/mach-xen/mach_setup.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/asm-i386/mach-xen/mach_setup.h Thu Jun 22 20:20:31 2006 -0400
@@ -0,0 +1,15 @@
+#ifndef __ASM_MACH_SETUP_H
+#define __ASM_MACH_SETUP_H
+
+#ifndef __ASSEMBLY__
+
+#include <xen/interface/xen.h>
+
+#define MACH_LOADER_TYPE 0x6e6558 /* "Xen" */
+#define MACH_INITRD_START \
+ (xen_start_info->mod_start ? __pa(xen_start_info->mod_start) : 0)
+#define MACH_INITRD_SIZE (xen_start_info->mod_len)
+
+#endif /* __ASSEMBLY__ */
+
+#endif /* __ASM_MACH_SETUP_H */
diff -r a5848bce3730 include/asm-i386/mach-xen/setup_arch.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/include/asm-i386/mach-xen/setup_arch.h Thu Jun 22 20:20:31 2006 -0400
@@ -0,0 +1,9 @@
+
+#define ARCH_SETUP machine_specific_arch_setup();
+
+extern struct start_info *xen_start_info;
+extern struct shared_info *HYPERVISOR_shared_info;
+
+void __init machine_specific_arch_setup(void);
+
+#define HAVE_ARCH_E820_SANITIZE
--
next prev parent reply other threads:[~2006-07-18 9:28 UTC|newest]
Thread overview: 102+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-07-18 9:18 [RFC PATCH 00/33] Xen i386 paravirtualization support Chris Wright
2006-07-18 7:00 ` [RFC PATCH 01/33] Add apply_to_page_range() function Chris Wright
2006-07-18 10:38 ` Adrian Bunk
2006-07-18 19:29 ` Chris Wright
2006-07-20 6:17 ` Adrian Bunk
2006-07-18 7:00 ` [RFC PATCH 02/33] Add sync bitops Chris Wright
2006-07-18 9:56 ` Arjan van de Ven
2006-07-18 10:18 ` Keir Fraser
2006-07-19 12:54 ` Andi Kleen
2006-07-18 10:34 ` Adrian Bunk
2006-07-18 7:00 ` [RFC PATCH 03/33] Add nosegneg capability to the vsyscall page notes Chris Wright
2006-07-18 7:00 ` [RFC PATCH 04/33] Add XEN config options and disable unsupported config options Chris Wright
2006-07-18 9:59 ` Arjan van de Ven
2006-07-18 10:21 ` Keir Fraser
2006-07-18 7:00 ` [RFC PATCH 05/33] Makefile support to build Xen subarch Chris Wright
2006-07-18 10:00 ` Arjan van de Ven
2006-07-18 11:40 ` Andrew Morton
2006-07-18 20:41 ` Jeremy Fitzhardinge
2006-07-18 20:15 ` Jeremy Fitzhardinge
2006-07-18 7:00 ` [RFC PATCH 06/33] Add Xen interface header files Chris Wright
2006-07-18 7:00 ` [RFC PATCH 07/33] Hypervisor " Chris Wright
2006-07-18 7:00 ` [RFC PATCH 08/33] Add vmlinuz build target Chris Wright
2006-07-18 7:00 ` Chris Wright [this message]
2006-07-18 10:03 ` [RFC PATCH 09/33] Add start-of-day setup hooks to subarch Arjan van de Ven
2006-07-18 20:49 ` Jeremy Fitzhardinge
2006-07-20 6:07 ` Adrian Bunk
2006-07-20 12:10 ` Keir Fraser
2006-07-20 13:27 ` Jeremy Fitzhardinge
2006-07-18 7:00 ` [RFC PATCH 10/33] add support for Xen feature queries Chris Wright
2006-07-18 7:00 ` [RFC PATCH 11/33] Add Xen-specific memory management definitions Chris Wright
2006-07-18 7:00 ` [RFC PATCH 12/33] Change __FIXADDR_TOP to leave room for the hypervisor Chris Wright
2006-07-18 7:00 ` [RFC PATCH 13/33] Add a new head.S start-of-day file for booting on Xen Chris Wright
2006-07-18 10:06 ` Arjan van de Ven
2006-07-18 20:13 ` Jeremy Fitzhardinge
2006-07-18 7:00 ` [RFC PATCH 14/33] subarch support for controlling interrupt delivery Chris Wright
2006-07-18 7:00 ` [RFC PATCH 15/33] move segment checks to subarch Chris Wright
2006-07-18 10:09 ` Arjan van de Ven
2006-07-18 11:28 ` Zachary Amsden
2006-07-18 19:06 ` Rusty Russell
2006-07-18 19:25 ` Chris Wright
2006-07-18 20:00 ` [Xen-devel] " Rusty Russell
2006-07-18 7:00 ` [RFC PATCH 16/33] Add support for Xen to entry.S Chris Wright
2006-07-18 10:11 ` Arjan van de Ven
2006-07-18 20:04 ` Jeremy Fitzhardinge
2006-07-18 19:17 ` Rusty Russell
2006-07-18 20:43 ` Chris Wright
2006-07-18 23:03 ` Jeremy Fitzhardinge
2006-07-19 5:30 ` Chris Wright
2006-07-18 7:00 ` [RFC PATCH 17/33] Support loading an initrd when running on Xen Chris Wright
2006-07-18 7:00 ` [RFC PATCH 18/33] Subarch support for CPUID instruction Chris Wright
2006-07-18 10:14 ` Arjan van de Ven
2006-07-18 10:26 ` Keir Fraser
2006-07-18 10:38 ` Arjan van de Ven
2006-07-18 11:33 ` Zachary Amsden
2006-07-18 20:46 ` David Miller
2006-07-18 21:00 ` Chris Wright
2006-07-18 7:00 ` [RFC PATCH 19/33] Support gdt/idt/ldt handling on Xen Chris Wright
2006-07-18 7:00 ` [RFC PATCH 20/33] subarch support for interrupt and exception gates Chris Wright
2006-07-18 7:00 ` [RFC PATCH 21/33] subarch support for control register accesses Chris Wright
2006-07-18 7:00 ` [RFC PATCH 22/33] subarch stack pointer update Chris Wright
2006-07-18 7:00 ` [RFC PATCH 23/33] subarch TLB support Chris Wright
2006-07-18 20:39 ` David Miller
2006-07-18 21:00 ` Chris Wright
2006-07-18 7:00 ` [RFC PATCH 24/33] Add support for Xen event channels Chris Wright
2006-07-18 7:00 ` [RFC PATCH 25/33] Implement timekeeping for Xen Chris Wright
2006-07-25 2:49 ` john stultz
2006-07-25 20:05 ` Jeremy Fitzhardinge
2006-07-18 7:00 ` [RFC PATCH 26/33] subarch suport for idle loop (NO_IDLE_HZ for Xen) Chris Wright
2006-07-18 7:00 ` [RFC PATCH 27/33] Add the Xen virtual console driver Chris Wright
2006-07-18 10:24 ` Arjan van de Ven
2006-07-18 10:31 ` Keir Fraser
2006-07-27 15:05 ` Hollis Blanchard
2006-07-18 7:00 ` [RFC PATCH 28/33] Add Xen grant table support Chris Wright
2006-07-19 10:04 ` [Xen-devel] " Harry Butterworth
2006-07-25 18:30 ` Hollis Blanchard
2006-07-25 18:45 ` Keir Fraser
2006-07-25 19:06 ` Segher Boessenkool
2006-07-18 7:00 ` [RFC PATCH 29/33] Add Xen driver utility functions Chris Wright
2006-07-18 7:00 ` [RFC PATCH 30/33] Add the Xenbus sysfs and virtual device hotplug driver Chris Wright
2006-07-18 7:00 ` [RFC PATCH 31/33] Add Xen subarch reboot support Chris Wright
2006-07-20 6:16 ` Adrian Bunk
2006-07-18 7:00 ` [RFC PATCH 32/33] Add the Xen virtual network device driver Chris Wright
2006-07-18 10:27 ` Arjan van de Ven
2006-07-18 10:35 ` Keir Fraser
2006-07-18 10:42 ` Arjan van de Ven
2006-07-18 12:18 ` Dave Boutcher
2006-07-18 12:39 ` jamal
2006-07-18 13:08 ` Herbert Xu
2006-07-18 13:25 ` John Haller
2006-07-18 15:22 ` Herbert Xu
2006-07-18 15:44 ` Stephen Hemminger
2006-07-19 3:55 ` Herbert Xu
2006-07-18 20:42 ` David Miller
2006-07-18 21:09 ` Chris Wright
2006-07-18 7:00 ` [RFC PATCH 33/33] Add Xen virtual block " Chris Wright
2006-07-18 10:34 ` Arjan van de Ven
2006-07-18 20:57 ` Jeremy Fitzhardinge
2006-07-18 13:01 ` Dave Boutcher
2006-07-18 16:25 ` Jeff Garzik
2006-07-18 19:28 ` Chris Wright
2006-07-18 21:22 ` Jeremy Fitzhardinge
-- strict thread matches above, loose matches on Subject: below --
2006-07-18 13:07 [RFC PATCH 09/33] Add start-of-day setup hooks to subarch Randy Dunlap
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=20060718091950.750213000@sous-sol.org \
--to=chrisw@sous-sol.org \
--cc=Christian.Limpach@cl.cam.ac.uk \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=ian.pratt@xensource.com \
--cc=jeremy@goop.org \
--cc=jeremy@xensource.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=virtualization@lists.osdl.org \
--cc=xen-devel@lists.xensource.com \
--cc=zach@vmware.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox