[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Re: [PATCH] v2 (Re: cs:21768 causes guest spend more time on boot up)



At 14:20 +0100 on 22 Jul (1279808457), Keir Fraser wrote:
> I suggest to try zapping the entire shared-info page when hvmloader
> finishes. There is nothing in there that is useful to keep across hvmloader
> and guest OS; zapping will ensure that other flags with rising-edge
> semantics such as per-vcpu evtchn selector words get reset; and doing
> anything more than zeroing is pointless since e.g., the evtchn_mask array
> offset and size is dependent on whether the guest OS is 32-bit or 64-bit. If
> hvmloader were to set the mask to all 1s and then boot a 64-bit guest, the
> rearranged shared_info would actually mean that hvmloader has set 1s in part
> of the 64-bit extended evtchn_pending array!

Good point.  That seems to do the trick.

hvmloader: clear the whole shared-info page when shutting down xenbus
since the contents might be in the wrong word-size for later users. 

Signed-off-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>

diff -r e8dbc1262f52 tools/firmware/hvmloader/xenbus.c
--- a/tools/firmware/hvmloader/xenbus.c Wed Jul 21 09:02:10 2010 +0100
+++ b/tools/firmware/hvmloader/xenbus.c Thu Jul 22 14:39:28 2010 +0100
@@ -63,9 +63,8 @@ void xenbus_shutdown(void)
      * having used the rings. */
     memset(rings, 0, sizeof *rings);
 
-    /* Clear the xenbus event-channel too */
-    get_shared_info()->evtchn_pending[event / sizeof (unsigned long)]
-        &= ~(1UL << ((event % sizeof (unsigned long))));    
+    /* Clear the event-channel state too. */
+    memset(get_shared_info(), 0, PAGE_SIZE);
 
     rings = NULL;
 }

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.