From: Grzegorz Milos <gm281@cam.ac.uk>
To: xen-devel <xen-devel@lists.xensource.com>
Subject: [PATCH] Mini-OS update of events initialisation
Date: Wed, 15 Nov 2006 19:39:32 +0000 [thread overview]
Message-ID: <455B6CF4.80609@cam.ac.uk> (raw)
[-- Attachment #1: Type: text/plain, Size: 1003 bytes --]
This patch moves initialisation of events (masking event channels)
earlier during the boot process. Otherwise 64bit guests would sometimes
crash.
Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
Admittedly, I cannot explain the behavior I observed fully. This patch
seems to fix it well, but I'd be grateful if someone on the list could
explain it.
The problem only appears in 64 bit guest, and only if MiniOS keeps
accessing the console ring page (which it does, as all printks write to
the console, even before events are initialised. Of course without
sending notifications).
What happens is that after a while, usually in memory initialisation
stage, but at fairly random place MiniOS gets "restarted" i.e.
start_kernel is called again. This leads to a crash as soon as MiniOS
tries to remap shared info page. It looks like if Xen or xend decided
that MiniOS domain should have masked the event channels before writing
to the console page, and reboot it ...
Any ideas?
Thanks
Gregor
[-- Attachment #2: mini-os_events.patch --]
[-- Type: text/plain, Size: 2413 bytes --]
diff -r 8ed53f24279e -r 2ba83e480bd6 extras/mini-os/include/x86/os.h
--- a/extras/mini-os/include/x86/os.h Wed Nov 15 16:27:37 2006 +0000
+++ b/extras/mini-os/include/x86/os.h Wed Nov 15 19:10:33 2006 +0000
@@ -18,6 +18,8 @@
#ifndef __ASSEMBLY__
#include <types.h>
#include <hypervisor.h>
+
+#define USED __attribute__ ((used))
extern void do_exit(void);
#define BUG do_exit
diff -r 8ed53f24279e -r 2ba83e480bd6 extras/mini-os/kernel.c
--- a/extras/mini-os/kernel.c Wed Nov 15 16:27:37 2006 +0000
+++ b/extras/mini-os/kernel.c Wed Nov 15 19:10:33 2006 +0000
@@ -116,6 +116,9 @@ void start_kernel(start_info_t *si)
printk(" cmd_line: %s\n",
si->cmd_line ? (const char *)si->cmd_line : "NULL");
+ /* Set up events. */
+ init_events();
+
arch_print_info();
setup_xen_features();
@@ -123,9 +126,6 @@ void start_kernel(start_info_t *si)
/* Init memory management. */
init_mm();
- /* Set up events. */
- init_events();
-
/* Init time and timers. */
init_time();
diff -r 8ed53f24279e -r 2ba83e480bd6 extras/mini-os/mm.c
--- a/extras/mini-os/mm.c Wed Nov 15 16:27:37 2006 +0000
+++ b/extras/mini-os/mm.c Wed Nov 15 19:10:33 2006 +0000
@@ -148,7 +148,7 @@ static chunk_head_t free_tail[FREELIST_
* Prints allocation[0/1] for @nr_pages, starting at @start
* address (virtual).
*/
-static void print_allocation(void *start, int nr_pages)
+USED static void print_allocation(void *start, int nr_pages)
{
unsigned long pfn_start = virt_to_pfn(start);
int count;
@@ -163,7 +163,7 @@ static void print_allocation(void *start
* Prints chunks (making them with letters) for @nr_pages starting
* at @start (virtual).
*/
-static void print_chunks(void *start, int nr_pages)
+USED static void print_chunks(void *start, int nr_pages)
{
char chunks[1001], current='A';
int order, count;
@@ -408,7 +408,6 @@ void new_pt_frame(unsigned long *pt_pfn,
do_exit();
break;
}
-
/* Update the entry */
#if defined(__x86_64__)
tab = pte_to_virt(tab[l4_table_offset(pt_page)]);
@@ -446,7 +445,6 @@ void new_pt_frame(unsigned long *pt_pfn,
printk("ERROR: mmu_update failed\n");
do_exit();
}
-
*pt_pfn += 1;
}
@@ -581,7 +579,6 @@ void build_pagetable(unsigned long *star
}
start_address += PAGE_SIZE;
}
-
*start_pfn = pt_pfn;
}
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
next reply other threads:[~2006-11-15 19:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-15 19:39 Grzegorz Milos [this message]
2006-11-16 7:45 ` [PATCH] Mini-OS update of events initialisation Keir Fraser
-- strict thread matches above, loose matches on Subject: below --
2006-11-17 13:53 Melvin Anderson
2006-11-17 15:29 ` Grzegorz Milos
2006-11-17 17:31 ` Melvin Anderson
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=455B6CF4.80609@cam.ac.uk \
--to=gm281@cam.ac.uk \
--cc=xen-devel@lists.xensource.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 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.