From: David Vrabel <david.vrabel@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
Daniel Kiper <daniel.kiper@oracle.com>,
Keir Fraser <keir@xen.org>
Subject: Re: [PATCH] kexec: don't disable interrupts when acquiring load/unload lock
Date: Wed, 6 Nov 2013 13:20:42 +0000 [thread overview]
Message-ID: <527A422A.6040309@citrix.com> (raw)
In-Reply-To: <527A428E0200007800100156@nat28.tlf.novell.com>
On 06/11/13 12:22, Jan Beulich wrote:
> This doesn't appear to have served any purpose other than causing
> map_pages_to_xen() to be (incorrectly) invoked with interrupts
> disabled. In particular, serialization against actual kexec-ing is done
> without this lock being involved. Clarify the scope of the lock at once
> by making it local to do_kexec_op_internal().
>
> Once at it, also drop a pointless initializer.
I've already dropped the irqsave from this lock in my kexec series and
can fold the other part in as well (which would now be in
kexec_swap_images()).
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/common/kexec.c
> +++ b/xen/common/kexec.c
> @@ -55,8 +55,6 @@ static xen_kexec_image_t kexec_image[KEX
>
> static unsigned long kexec_flags = 0; /* the lowest bits are for KEXEC_IMAGE... */
>
> -static spinlock_t kexec_lock = SPIN_LOCK_UNLOCKED;
> -
> static unsigned char vmcoreinfo_data[VMCOREINFO_BYTES];
> static size_t vmcoreinfo_size = 0;
>
> @@ -851,10 +849,9 @@ static int do_kexec_op_internal(unsigned
> XEN_GUEST_HANDLE_PARAM(void) uarg,
> bool_t compat)
> {
> - unsigned long flags;
> - int ret = -EINVAL;
> + static DEFINE_SPINLOCK(kexec_lock);
> + int ret = xsm_kexec(XSM_PRIV);
>
> - ret = xsm_kexec(XSM_PRIV);
> if ( ret )
> return ret;
I find the resulting spacing of this a bit unconventional.
int ret;
ret = xsm_kexec(XSM_PRIV)
if ( ret )
return ret;
is more standard I think. Not too bothered though.
I'm about to post v10 of the kexec series and it would be less hassle
for me if you took the fix via that series instead since this area
undergoes significant refactoring. But if you prefer to commit this fix
now:
Acked-by: David Vrabel <david.vrabel@citrix.com>
David
next prev parent reply other threads:[~2013-11-06 13:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-06 12:22 [PATCH] kexec: don't disable interrupts when acquiring load/unload lock Jan Beulich
2013-11-06 13:12 ` Andrew Cooper
2013-11-06 13:20 ` David Vrabel [this message]
2013-11-06 14:17 ` Jan Beulich
2013-11-06 15:09 ` David Vrabel
2013-11-06 15:16 ` Jan Beulich
2013-11-06 14:53 ` Daniel Kiper
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=527A422A.6040309@citrix.com \
--to=david.vrabel@citrix.com \
--cc=JBeulich@suse.com \
--cc=daniel.kiper@oracle.com \
--cc=keir@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.