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-devel

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

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH] v2 (Re: cs:21768 causes guest spend more time on boot up)
From: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Date: Thu, 22 Jul 2010 14:41:03 +0100
Cc: "Zhang, Yang Z" <yang.z.zhang@xxxxxxxxx>, "Zhang, Jianwu" <jianwu.zhang@xxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Xu, Jiajun" <jiajun.xu@xxxxxxxxx>
Delivery-date: Thu, 22 Jul 2010 06:53:06 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C86E0449.1B520%keir.fraser@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <5D8008F58939784290FAB48F549751981D10D5893E@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <C86E0449.1B520%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
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