WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] pv-grub: fix boot crash when no fb is ava

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] pv-grub: fix boot crash when no fb is available
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 05 Apr 2010 23:20:44 -0700
Delivery-date: Mon, 05 Apr 2010 23:23:07 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1270534381 -3600
# Node ID a3f7352d83eb6332aa89874ca58863807e8efacd
# Parent  4822f82acec6d36e651f6c205ddf8a8109262423
pv-grub: fix boot crash when no fb is available

When no fb is available, init_fbfront will return, so the local
semaphore for synchronization with the kbd thread would get dropped.
Using a global static semaphore instead fixes this.

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>
---
 stubdom/grub/mini-os.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff -r 4822f82acec6 -r a3f7352d83eb stubdom/grub/mini-os.c
--- a/stubdom/grub/mini-os.c    Tue Apr 06 07:12:39 2010 +0100
+++ b/stubdom/grub/mini-os.c    Tue Apr 06 07:13:01 2010 +0100
@@ -651,12 +651,11 @@ int console_getkey (void)
     return 0;
 }
 
+static DECLARE_MUTEX_LOCKED(kbd_sem);
 static void kbd_thread(void *p)
 {
-    struct semaphore *sem = p;
-
     kbd_dev = init_kbdfront(NULL, 1);
-    up(sem);
+    up(&kbd_sem);
 }
 
 struct fbfront_dev *fb_open(void *fb, int width, int height, int depth)
@@ -665,10 +664,9 @@ struct fbfront_dev *fb_open(void *fb, in
     int linesize = width * (depth / 8);
     int memsize = linesize * height;
     int numpages = (memsize + PAGE_SIZE - 1) / PAGE_SIZE;
-    DECLARE_MUTEX_LOCKED(sem);
     int i;
 
-    create_thread("kbdfront", kbd_thread, &sem);
+    create_thread("kbdfront", kbd_thread, &kbd_sem);
 
     mfns = malloc(numpages * sizeof(*mfns));
     for (i = 0; i < numpages; i++) {
@@ -681,7 +679,7 @@ struct fbfront_dev *fb_open(void *fb, in
     if (!fb_dev)
         return NULL;
 
-    down(&sem);
+    down(&kbd_sem);
     if (!kbd_dev)
         return NULL;
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] pv-grub: fix boot crash when no fb is available, Xen patchbot-unstable <=