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

Re: [Xen-devel] [PATCH 0/7][RFC] make xenguest save & restore functions

To: Keir Fraser <Keir.Fraser@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 0/7][RFC] make xenguest save & restore functions reentrant
From: Vincent Hanquez <vincent.hanquez@xxxxxxxxxxxxx>
Date: Sun, 15 Nov 2009 10:08:36 +0000
Cc: Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Sun, 15 Nov 2009 02:11:14 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C72419E1.1A245%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: <C72419E1.1A245%keir.fraser@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20091109)
Keir Fraser wrote:
Rather than making the macros take extra arguments, can you make them refer
to ctx->foo instead (i.e., make it implciit the structure containing these
ex-globals is called ctx)? It avoids having to change every caller, and some
callers already have macros nested three deep and adding guest_width/max_mfn
all over the place does not help readability.

I agree this isn't pretty. unfortunately i tried the route of changing the macro to get from ctx-> but the macro is used also on other files xc_core_x86.c and xc_resume.c which use the macro with the guest_width and/or p2m_size on the call stack.

The only other solution I though of, would be to duplicate the value of the ex-globals on the stack like:
...
int guest_width = ctx->guest_width;
int p2m_size = ctx->p2m_size;
...

I decided against, because it might look odd since it doesn't appear used and also means I need to track all assignment to this variable.

If you prefer, I can change this patchset to do that.

There's also the solution of carrying this patchset, and prettyfying some of thoses macro calls as if there were "expensive calls" just like my patch 5/7 does.

Also send also as attachments next time. I have problems applying these
patches from inline email for some reason; some chunks don't apply.

yep ok.

--
Vincent


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