From: Jan Beulich <jbeulich@suse.com>
To: Juergen Gross <jgross@suse.com>,
Andrew Cooper <andrew.cooper3@citrix.com>
Cc: "Stefano Stabellini" <sstabellini@kernel.org>,
"Julien Grall" <julien@xen.org>, "Wei Liu" <wl@xen.org>,
"Konrad Rzeszutek Wilk" <konrad.wilk@oracle.com>,
"Ian Jackson" <ian.jackson@eu.citrix.com>,
"George Dunlap" <george.dunlap@citrix.com>,
xen-devel@lists.xenproject.org,
"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Re: [Xen-devel] [PATCH v2] xen: make sure stop_machine_run() is always called in a tasklet
Date: Fri, 28 Feb 2020 09:27:35 +0100 [thread overview]
Message-ID: <e9dd548a-9a32-3d45-3daf-30f080df0b74@suse.com> (raw)
In-Reply-To: <20200228071922.3983-1-jgross@suse.com>
On 28.02.2020 08:19, Juergen Gross wrote:
> With core scheduling active it is mandatory for stop_machine_run() to
> be called in idle context only (so either during boot or in a tasklet),
> as otherwise a scheduling deadlock would occur: stop_machine_run()
> does a cpu rendezvous by activating a tasklet on all other cpus. In
> case stop_machine_run() was not called in an idle vcpu it would block
> scheduling the idle vcpu on its siblings with core scheduling being
> active, resulting in a hang.
>
> Put a BUG_ON() into stop_machine_run() to test for being called in an
> idle vcpu only and adapt the missing call site (ucode loading) to use a
> tasklet for calling stop_machine_run().
>
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
> V2:
> - rephrase commit message (Julien Grall)
> ---
> xen/arch/x86/microcode.c | 54 +++++++++++++++++++++++++++++------------------
> xen/common/stop_machine.c | 1 +
> 2 files changed, 35 insertions(+), 20 deletions(-)
There's no mention anywhere of a connection to your RCU series,
nor to rcu_barrier(). Yet the change puts a new restriction also
on its use, and iirc this was mentioned in prior discussion. Did
I miss anything?
> @@ -700,6 +688,32 @@ int microcode_update(XEN_GUEST_HANDLE_PARAM(const_void) buf, unsigned long len)
> return ret;
> }
>
> +int microcode_update(XEN_GUEST_HANDLE_PARAM(const_void) buf, unsigned long len)
> +{
> + int ret;
> + struct ucode_buf *buffer;
> +
> + if ( len != (uint32_t)len )
> + return -E2BIG;
> +
> + if ( microcode_ops == NULL )
> + return -EINVAL;
> +
> + buffer = xmalloc_flex_struct(struct ucode_buf, buffer, len);
> + if ( !buffer )
> + return -ENOMEM;
> +
> + ret = copy_from_guest(buffer->buffer, buf, len);
> + if ( ret )
> + {
> + xfree(buffer);
> + return -EFAULT;
> + }
> + buffer->len = len;
> +
> + return continue_hypercall_on_cpu(0, microcode_update_helper, buffer);
> +}
Andrew, just to clarify - were you okay with Jürgen's response regarding
this re-introduction of continue_hypercall_on_cpu() here?
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2020-02-28 8:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-28 7:19 [Xen-devel] [PATCH v2] xen: make sure stop_machine_run() is always called in a tasklet Juergen Gross
2020-02-28 8:27 ` Jan Beulich [this message]
2020-02-28 8:58 ` Jürgen Groß
2020-02-28 9:15 ` Jan Beulich
2020-02-28 9:18 ` Jürgen Groß
2020-02-28 9:20 ` Jan Beulich
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=e9dd548a-9a32-3d45-3daf-30f080df0b74@suse.com \
--to=jbeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=george.dunlap@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jgross@suse.com \
--cc=julien@xen.org \
--cc=konrad.wilk@oracle.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=wl@xen.org \
--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.