aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2004-06-16 15:59:23 +0000
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>2004-06-16 15:59:23 +0000
commit8e0c8c0b02f5f85b0ad9476389449eb891f73e97 (patch)
tree42dbf7baea3a484e9dc333d781f45479d7a1edca
parentedccfee70b18eeee7493fbcffe55351e8fa3f3e8 (diff)
downloadxen-8e0c8c0b02f5f85b0ad9476389449eb891f73e97.tar.gz
xen-8e0c8c0b02f5f85b0ad9476389449eb891f73e97.tar.bz2
xen-8e0c8c0b02f5f85b0ad9476389449eb891f73e97.zip
bitkeeper revision 1.969 (40d06e5bLmMtClRlYKKJQZd2RPCAyw)
Allow privileged build to be used in non-priv domain without crashing.
-rw-r--r--.rootkeys1
-rw-r--r--BitKeeper/etc/ignore4
-rw-r--r--linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/main.c4
-rw-r--r--linux-2.4.26-xen-sparse/arch/xen/drivers/netif/frontend/main.c57
-rw-r--r--linux-2.4.26-xen-sparse/arch/xen/kernel/setup.c36
-rw-r--r--linux-2.4.26-xen-sparse/arch/xen/vmlinux.lds7
-rw-r--r--linux-2.4.26-xen-sparse/include/asm-xen/io.h33
-rw-r--r--linux-2.4.26-xen-sparse/include/asm-xen/module.h14
-rwxr-xr-xlinux-2.4.26-xen-sparse/mkbuildtree1
9 files changed, 110 insertions, 47 deletions
diff --git a/.rootkeys b/.rootkeys
index 1308fd3755..61bbff8259 100644
--- a/.rootkeys
+++ b/.rootkeys
@@ -117,6 +117,7 @@
3e5a4e673p7PEOyHFm3nHkYX6HQYBg linux-2.4.26-xen-sparse/include/asm-xen/irq.h
3ead095db_LRUXnxaqs0dA1DWhPoQQ linux-2.4.26-xen-sparse/include/asm-xen/keyboard.h
3e5a4e678ddsQOpbSiRdy1GRcDc9WA linux-2.4.26-xen-sparse/include/asm-xen/mmu_context.h
+40d06e5b2YWInUX1Xv9amVANwd_2Xg linux-2.4.26-xen-sparse/include/asm-xen/module.h
3f8707e7ZmZ6TxyX0ZUEfvhA2Pb_xQ linux-2.4.26-xen-sparse/include/asm-xen/msr.h
3e7270deQqtGPSnFxcW4AvJZuTUWfg linux-2.4.26-xen-sparse/include/asm-xen/multicall.h
3e5a4e67mnQfh-R8KcQCaVo2Oho6yg linux-2.4.26-xen-sparse/include/asm-xen/page.h
diff --git a/BitKeeper/etc/ignore b/BitKeeper/etc/ignore
index 7f5d7578d3..51b5f03492 100644
--- a/BitKeeper/etc/ignore
+++ b/BitKeeper/etc/ignore
@@ -3,6 +3,7 @@
*.pyc
*.so
*.so.*
+*.tar.gz
*~
BitKeeper/*/*
PENDING/*
@@ -10,8 +11,6 @@ TAGS
extras/mini-os/h/hypervisor-ifs
install
install/*
-linux-*-xen/*
-linux-*.tar.gz
linux-2.4.26-xen/*
linux-xen-sparse
tools/*/build/lib*/*.py
@@ -20,7 +19,6 @@ tools/misc/miniterm/miniterm
tools/misc/xen_cpuperf
tools/misc/xen_log
tools/misc/xen_read_console
-tools/xend-2004-06-10_1309.tgz
tools/xentrace/xentrace
xen/drivers/pci/classlist.h
xen/drivers/pci/devlist.h
diff --git a/linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/main.c b/linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/main.c
index 1ecb766ade..fa662496ec 100644
--- a/linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/main.c
+++ b/linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/main.c
@@ -799,13 +799,9 @@ module_exit(xlblk_cleanup);
void blkdev_suspend(void)
{
- /* XXX FIXME */
- BUG();
}
void blkdev_resume(void)
{
- /* XXX FIXME */
- BUG();
}
diff --git a/linux-2.4.26-xen-sparse/arch/xen/drivers/netif/frontend/main.c b/linux-2.4.26-xen-sparse/arch/xen/drivers/netif/frontend/main.c
index 3481788bf7..25bad4b576 100644
--- a/linux-2.4.26-xen-sparse/arch/xen/drivers/netif/frontend/main.c
+++ b/linux-2.4.26-xen-sparse/arch/xen/drivers/netif/frontend/main.c
@@ -100,7 +100,6 @@ static struct net_device *find_dev_by_handle(unsigned int handle)
}
#define MULTIVIF
-//#ifdef MULTIVIF
/** Network interface info. */
struct netif_ctrl {
@@ -112,10 +111,11 @@ struct netif_ctrl {
int err;
};
-static struct netif_ctrl netctrl = {};
+static struct netif_ctrl netctrl;
-static void netctrl_init(void){
- netctrl = (struct netif_ctrl){};
+static void netctrl_init(void)
+{
+ memset(&netctrl, 0, sizeof(netctrl));
netctrl.interface_n = -1;
}
@@ -164,8 +164,6 @@ static int netctrl_connected_count(void)
return connected;
}
-//#endif
-
static int network_open(struct net_device *dev)
{
struct net_private *np = dev->priv;
@@ -636,12 +634,12 @@ static void netif_status_change(netif_fe_interface_status_changed_t *status)
struct net_device *dev;
struct net_private *np;
-//#ifdef MULTIVIF
- if(netctrl.interface_n <= 0){
+ if ( netctrl.interface_n <= 0 )
+ {
printk(KERN_WARNING "Status change: no interfaces\n");
return;
}
-//#endif
+
dev = find_dev_by_handle(status->handle);
if(!dev){
printk(KERN_WARNING "Status change: invalid netif handle %u\n",
@@ -790,11 +788,12 @@ static int create_netdev(int handle, struct net_device **val){
return err;
}
-//#ifdef MULTIVIF
-/** Initialize the network control interface. Set the number of network devices
+/*
+ * Initialize the network control interface. Set the number of network devices
* and create them.
*/
-static void netif_driver_status_change(netif_fe_driver_status_changed_t *status)
+static void netif_driver_status_change(
+ netif_fe_driver_status_changed_t *status)
{
int err = 0;
int i;
@@ -810,12 +809,11 @@ static void netif_driver_status_change(netif_fe_driver_status_changed_t *status)
}
}
}
-//#endif
-
static void netif_ctrlif_rx(ctrl_msg_t *msg, unsigned long id)
{
int respond = 1;
+
switch ( msg->subtype )
{
case CMSG_NETIF_FE_INTERFACE_STATUS_CHANGED:
@@ -824,24 +822,24 @@ static void netif_ctrlif_rx(ctrl_msg_t *msg, unsigned long id)
netif_status_change((netif_fe_interface_status_changed_t *)
&msg->msg[0]);
break;
-//#ifdef MULTIVIF
+
case CMSG_NETIF_FE_DRIVER_STATUS_CHANGED:
if ( msg->length != sizeof(netif_fe_driver_status_changed_t) )
goto error;
netif_driver_status_change((netif_fe_driver_status_changed_t *)
&msg->msg[0]);
- // Message is a response, so do not respond.
+ /* Message is a response */
respond = 0;
break;
-//#endif
- error:
+
+ error:
default:
msg->length = 0;
break;
}
- if(respond){
+
+ if ( respond )
ctrl_if_send_response(msg);
- }
}
@@ -880,15 +878,11 @@ static int __init init_module(void)
#ifdef MULTIVIF
/* Wait for all interfaces to be connected. */
- for(wait_i = 0; 1; wait_i++) {
- if(wait_i < wait_n){
- err = netctrl_connected();
- } else {
- err = -ENETDOWN;
- }
- if(err < 0) goto exit;
- if(err > 0){
- err = 0;
+ for ( wait_i = 0; ; wait_i++)
+ {
+ if ( (err = (wait_i < wait_n) ? netctrl_connected() : -ENETDOWN) != 0 )
+ {
+ err = (err > 0) ? 0 : err;
break;
}
set_current_state(TASK_INTERRUPTIBLE);
@@ -896,8 +890,9 @@ static int __init init_module(void)
}
#endif
- exit:
- if(err) cleanup_module();
+ if ( err )
+ ctrl_if_unregister_receiver(CMSG_NETIF_FE, netif_ctrlif_rx);
+
return err;
}
diff --git a/linux-2.4.26-xen-sparse/arch/xen/kernel/setup.c b/linux-2.4.26-xen-sparse/arch/xen/kernel/setup.c
index a787a5c78c..ccdf3e266d 100644
--- a/linux-2.4.26-xen-sparse/arch/xen/kernel/setup.c
+++ b/linux-2.4.26-xen-sparse/arch/xen/kernel/setup.c
@@ -162,6 +162,36 @@ static void __init parse_mem_cmdline (char ** cmdline_p)
*cmdline_p = command_line;
}
+/*
+ * Every exception-fixup table is sorted (i.e., kernel main table, and every
+ * module table. Some elements may be out of order if they reference text.init,
+ * for example.
+ */
+static void sort_exception_table(struct exception_table_entry *start,
+ struct exception_table_entry *end)
+{
+ struct exception_table_entry *p, *q, tmp;
+
+ for ( p = start; p < end; p++ )
+ {
+ for ( q = p-1; q > start; q-- )
+ if ( p->insn > q->insn )
+ break;
+ if ( ++q != p )
+ {
+ tmp = *p;
+ memmove(q+1, q, (p-q)*sizeof(*p));
+ *q = tmp;
+ }
+ }
+}
+
+int xen_module_init(struct module *mod)
+{
+ sort_exception_table(mod->ex_table_start, mod->ex_table_end);
+ return 0;
+}
+
void __init setup_arch(char **cmdline_p)
{
unsigned long bootmap_size, start_pfn, max_low_pfn;
@@ -172,11 +202,17 @@ void __init setup_arch(char **cmdline_p)
extern unsigned long cpu0_pte_quicklist[];
extern unsigned long cpu0_pgd_quicklist[];
+ extern const struct exception_table_entry __start___ex_table[];
+ extern const struct exception_table_entry __stop___ex_table[];
+
/* Force a quick death if the kernel panics. */
extern int panic_timeout;
if ( panic_timeout == 0 )
panic_timeout = 1;
+ /* Ensure that the kernel exception-fixup table is sorted. */
+ sort_exception_table(__start___ex_table, __stop___ex_table);
+
#ifndef CONFIG_HIGHIO
blk_nohighio = 1;
#endif
diff --git a/linux-2.4.26-xen-sparse/arch/xen/vmlinux.lds b/linux-2.4.26-xen-sparse/arch/xen/vmlinux.lds
index 7c4c4f8e9c..6bd3ec3c04 100644
--- a/linux-2.4.26-xen-sparse/arch/xen/vmlinux.lds
+++ b/linux-2.4.26-xen-sparse/arch/xen/vmlinux.lds
@@ -64,13 +64,6 @@ SECTIONS
}
_end = . ;
- /* Sections to be discarded */
- /DISCARD/ : {
- *(.text.exit)
- *(.data.exit)
- *(.exitcall.exit)
- }
-
/* Stabs debugging sections. */
.stab 0 : { *(.stab) }
.stabstr 0 : { *(.stabstr) }
diff --git a/linux-2.4.26-xen-sparse/include/asm-xen/io.h b/linux-2.4.26-xen-sparse/include/asm-xen/io.h
index 5ab5fe9bfc..469c6ec09c 100644
--- a/linux-2.4.26-xen-sparse/include/asm-xen/io.h
+++ b/linux-2.4.26-xen-sparse/include/asm-xen/io.h
@@ -309,8 +309,15 @@ static inline void flush_write_buffers(void)
#ifdef SLOW_IO_BY_JUMPING
#define __SLOW_DOWN_IO "\njmp 1f\n1:\tjmp 1f\n1:"
-#else
+#elif defined(__UNSAFE_IO__)
#define __SLOW_DOWN_IO "\noutb %%al,$0x80"
+#else
+#define __SLOW_DOWN_IO "\n1: outb %%al,$0x80\n" \
+ "2:\n" \
+ ".section __ex_table,\"a\"\n\t" \
+ ".align 4\n\t" \
+ ".long 1b,2b\n" \
+ ".previous"
#endif
#ifdef REALLY_SLOW_IO
@@ -329,8 +336,18 @@ extern void *xquad_portio; /* Where the IO area was mapped */
#define __OUT1(s,x) \
static inline void out##s(unsigned x value, unsigned short port) {
+#ifdef __UNSAFE_IO__
#define __OUT2(s,s1,s2) \
__asm__ __volatile__ ("out" #s " %" s1 "0,%" s2 "1"
+#else
+#define __OUT2(s,s1,s2) \
+__asm__ __volatile__ ("1: out" #s " %" s1 "0,%" s2 "1\n" \
+ "2:\n" \
+ ".section __ex_table,\"a\"\n\t" \
+ ".align 4\n\t" \
+ ".long 1b,2b\n" \
+ ".previous"
+#endif
#if defined (CONFIG_MULTIQUAD) && !defined(STANDALONE)
#define __OUTQ(s,ss,x) /* Do the equivalent of the portio op on quads */ \
@@ -378,8 +395,22 @@ __OUTQ(s,s##_p,x)
#define __IN1(s) \
static inline RETURN_TYPE in##s(unsigned short port) { RETURN_TYPE _v;
+#ifdef __UNSAFE_IO__
#define __IN2(s,s1,s2) \
__asm__ __volatile__ ("in" #s " %" s2 "1,%" s1 "0"
+#else
+#define __IN2(s,s1,s2) \
+__asm__ __volatile__ ("1: in" #s " %" s2 "1,%" s1 "0\n" \
+ "2:\n" \
+ ".section .fixup,\"ax\"\n" \
+ "3: mov" #s " $~0,%" s1 "0\n\t" \
+ "jmp 2b\n" \
+ ".previous\n" \
+ ".section __ex_table,\"a\"\n\t" \
+ ".align 4\n\t" \
+ ".long 1b,3b\n" \
+ ".previous"
+#endif
#if !defined(CONFIG_MULTIQUAD) || defined(STANDALONE)
#define __IN(s,s1,i...) \
diff --git a/linux-2.4.26-xen-sparse/include/asm-xen/module.h b/linux-2.4.26-xen-sparse/include/asm-xen/module.h
new file mode 100644
index 0000000000..17cd5ff07c
--- /dev/null
+++ b/linux-2.4.26-xen-sparse/include/asm-xen/module.h
@@ -0,0 +1,14 @@
+#ifndef _ASM_I386_MODULE_H
+#define _ASM_I386_MODULE_H
+/*
+ * This file contains the i386 architecture specific module code.
+ */
+
+extern int xen_module_init(struct module *mod);
+
+#define module_map(x) vmalloc(x)
+#define module_unmap(x) vfree(x)
+#define module_arch_init(x) xen_module_init(x)
+#define arch_init_modules(x) do { } while (0)
+
+#endif /* _ASM_I386_MODULE_H */
diff --git a/linux-2.4.26-xen-sparse/mkbuildtree b/linux-2.4.26-xen-sparse/mkbuildtree
index 2e9f7b9920..8d0009da03 100755
--- a/linux-2.4.26-xen-sparse/mkbuildtree
+++ b/linux-2.4.26-xen-sparse/mkbuildtree
@@ -156,7 +156,6 @@ ln -sf ../asm-i386/mca_dma.h
ln -sf ../asm-i386/mman.h
ln -sf ../asm-i386/mmu.h
ln -sf ../asm-i386/mmx.h
-ln -sf ../asm-i386/module.h
ln -sf ../asm-i386/mpspec.h
ln -sf ../asm-i386/msgbuf.h
ln -sf ../asm-i386/mtrr.h