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] return value checking on multicalls

To: "Jeremy Fitzhardinge" <jeremy@xxxxxxxx>
Subject: Re: [Xen-devel] return value checking on multicalls
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Wed, 14 Mar 2007 16:58:02 +0000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 14 Mar 2007 09:56:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <45F82698.2050203@xxxxxxxx>
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/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <45F828EB.76E4.0078.0@xxxxxxxxxx> <45F82698.2050203@xxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>>> Jeremy Fitzhardinge <jeremy@xxxxxxxx> 14.03.07 17:45 >>>
>Jan Beulich wrote:
>> Many places currently don't even check HYPERVISOR_multicall()'s return
>> value, not to speak of checking the individual status codes. Would it be
>> acceptable to add an argument to this function to request to either fold
>> all status values into a global success code, or to force BUG_ON() each
>> individual status. Or should I rather add a new function with described
>> behavior? Or are there other suggestions?
>
>In the xen-pvops tree I made a general-purpose hypercall batching
>mechanism, so that there's only one place which needs to check the
>multicall return.  Its interface is:
>
>/* Multicalls */
>struct multicall_space
>{
>       struct multicall_entry *mc;
>       void *args;
>};
>
>/* Allocate room for a multicall and its args */
>struct multicall_space xen_mc_entry(size_t args);
>
>/* Flush all pending multicalls */
>void xen_mc_flush(void);
>
>/* Issue a multicall if we're not in lazy mode */
>static inline void xen_mc_issue(void)
>{
>       if (xen_get_lazy_mode() == PARAVIRT_LAZY_NONE)
>               xen_mc_flush();
>}
>
>
>xen_mc_flush() just BUGs if either the multicall hypercall itself fails,
>or any of the constituent hypercalls.

Hmm, that doesn't seem to fit all cases. There are hypercalls that
return non-errno-like values, and you shouldn't make any
assumptions about these.

Jan

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

<Prev in Thread] Current Thread [Next in Thread>