All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Jan Beulich <jbeulich@novell.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: return value checking on multicalls
Date: Wed, 14 Mar 2007 09:45:12 -0700	[thread overview]
Message-ID: <45F82698.2050203@goop.org> (raw)
In-Reply-To: <45F828EB.76E4.0078.0@novell.com>

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.

    J

  parent reply	other threads:[~2007-03-14 16:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-14 15:55 return value checking on multicalls Jan Beulich
2007-03-14 16:00 ` Keir Fraser
2007-03-14 16:45 ` Jeremy Fitzhardinge [this message]
2007-03-14 16:58   ` Jan Beulich
2007-03-14 17:02     ` Jeremy Fitzhardinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45F82698.2050203@goop.org \
    --to=jeremy@goop.org \
    --cc=jbeulich@novell.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.