All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: "Luis R. Rodriguez" <mcgrof@suse.com>
Cc: Juergen Gross <jgross@suse.com>, Michal Marek <mmarek@suse.cz>,
	Jason Douglas <jdouglas@suse.com>,
	stefano.stabellini@eu.citrix.com, Takashi Iwai <tiwai@suse.de>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Henrique de Moraes Holschuh <hmh@debian.org>,
	david.vrabel@citrix.com, Jan Beulich <JBeulich@suse.com>,
	xen-devel@lists.xenproject.org,
	"Luis R. Rodriguez" <mcgrof@do-not-panic.com>,
	Borislav Petkov <bp@suse.de>, Olaf Hering <ohering@suse.de>
Subject: Re: [RFC v2] misc/xenmicrocode: Upload /lib/firmware/<some blob> to the hypervisor
Date: Fri, 30 Jan 2015 16:14:02 -0500	[thread overview]
Message-ID: <54CBF41A.3070505@oracle.com> (raw)
In-Reply-To: <20150130200549.GM19988@wotan.suse.de>

On 01/30/2015 03:05 PM, Luis R. Rodriguez wrote:
> On Fri, Jan 30, 2015 at 09:44:56AM -0500, Boris Ostrovsky wrote:
>> On 01/29/2015 08:14 PM, Luis R. Rodriguez wrote:
>>> From: "Luis R. Rodriguez" <mcgrof@suse.com>
>>> +/*
>>> + * Do not pause already paused domains, and allow us to
>>> + * unpause only quiesced domains.
>>> + */
>>> +static int quiesce_all_domains(xc_interface *xch,
>>> +		               struct xc_quiesce_request *quiesce_request)
>>> +{
>>> +    xc_domaininfo_t info[1024];
>>> +    int i, nb_domain;
>>> +
>>> +    nb_domain = xc_domain_getinfolist(xch, 0, 1024, info);
>>> +    if ( nb_domain < 0 )
>>> +    {
>>> +	return -1;
>>> +    }
>>> +
>>> +    for ( i = 0; i < nb_domain; i++ )
>>> +    {
>>> +        if ( info[i].domain == 0 )
>>> +		continue;
>>> +	if ( info[i].flags & XEN_DOMINF_paused )
>>> +		continue;
>>> +
>>> +        xc_domain_pause(xch, info[i].domain);
>>
>> You are not handling errors returned by xc_domain_pause().
> Thanks for the review, shall we just bail if that cannot happen?

I think so (after unpausing the already-paused domains, obviously).

But then I thought that Andrew is advocating having the hypervisor doing 
the pause.

>
>> So then you will
>> try to unpause a domain that may not have been paused and (I think more
>> importantly) may proceed with microcode update while not all domains are
>> paused.
> Yeah this would be bad. Perhaps bail and tell the user the domain that
> we could not pause / quiesce (depending on what we decide to do).
>
>>> +
>>> +	quiesce_request->domids[quiesce_request->num_quiesced] = info[i].domain;
>>> +	quiesce_request->num_quiesced++;
>>> +    }
>>> +
>>> +    return 0;
>>> +}
>>> +
>>> +static void unquiesce_all_domains(xc_interface *xch,
>>> +                                  struct xc_quiesce_request *quiesce_request)
>>> +{
>>> +    int i;
>>> +
>>> +    for ( i = 0; i < quiesce_request->num_quiesced; i++ )
>>> +    {
>>> +	xc_domain_unpause(xch, quiesce_request->domids[i]);
>>
>> Same here --- you may fail unpausing a domain and noone will know about it.
> True, that seems like a rather informational thing we can spit out, do we want
> to return an error for that though too?

I'd print the error and continue unpausing.


-boris

  reply	other threads:[~2015-01-30 21:14 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-30  1:14 [RFC v2] misc/xenmicrocode: Upload /lib/firmware/<some blob> to the hypervisor Luis R. Rodriguez
2015-01-30 14:23 ` Andrew Cooper
2015-01-30 19:51   ` Luis R. Rodriguez
2015-01-30 20:37     ` Andrew Cooper
2015-01-30 21:24       ` Boris Ostrovsky
2015-01-30 21:55         ` Andrew Cooper
2015-01-30 21:57       ` Luis R. Rodriguez
2015-06-12  2:30         ` Luis R. Rodriguez
2015-06-12  8:48           ` Andrew Cooper
2015-01-30 14:44 ` Boris Ostrovsky
2015-01-30 20:05   ` Luis R. Rodriguez
2015-01-30 21:14     ` Boris Ostrovsky [this message]
2015-01-30 21:28       ` Luis R. Rodriguez

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=54CBF41A.3070505@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bp@suse.de \
    --cc=david.vrabel@citrix.com \
    --cc=hmh@debian.org \
    --cc=jdouglas@suse.com \
    --cc=jgross@suse.com \
    --cc=mcgrof@do-not-panic.com \
    --cc=mcgrof@suse.com \
    --cc=mmarek@suse.cz \
    --cc=ohering@suse.de \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tiwai@suse.de \
    --cc=xen-devel@lists.xenproject.org \
    /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.