From: Daniel Kiper <daniel.kiper@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: andrew.cooper3@citrix.com, bhavesh.davda@oracle.com,
Eric DeVolder <eric.devolder@oracle.com>,
xen-devel@lists.xen.org
Subject: Re: [PATCH v3 1/2] kexec: use hypercall_create_continuation to protect KEXEC ops
Date: Thu, 20 Apr 2017 12:42:43 +0200 [thread overview]
Message-ID: <20170420104243.GV16658@olila.local.net-space.pl> (raw)
In-Reply-To: <58F89CBD0200007800152494@prv-mh.provo.novell.com>
On Thu, Apr 20, 2017 at 03:34:21AM -0600, Jan Beulich wrote:
> >>> On 19.04.17 at 19:16, <daniel.kiper@oracle.com> wrote:
> > On Wed, Apr 19, 2017 at 10:19:44AM -0600, Jan Beulich wrote:
> >> >>> On 19.04.17 at 17:54, <daniel.kiper@oracle.com> wrote:
> >> > On Wed, Apr 19, 2017 at 10:47:15AM -0500, Eric DeVolder wrote:
> >> >> @@ -1193,6 +1194,9 @@ static int do_kexec_op_internal(unsigned long op,
> >> >> if ( ret )
> >> >> return ret;
> >> >>
> >> >> + if ( test_and_set_bit(KEXEC_FLAG_IN_HYPERCALL, &kexec_flags) )
> >> >> + return hypercall_create_continuation(__HYPERVISOR_kexec_op, "lh", op, uarg);
> >> >> +
> >> >
> >> > I would suggest here:
> >> > ASSERT(test_bit(KEXEC_FLAG_IN_HYPERCALL, &kexec_flags));
> >>
> >> You're kidding? The flag was set just in the line above. Or do you
> >> really mean we need to consider test_and_set_bit() not doing what
> >> it is supposed to do?
> >
> > Yep, it looks ridiculous. However, ASSERT() in kexec_swap_images() looks almost
> > the same for me. So, TBH, I still do not understand need for it at all. Could
> > you enlighten me?
>
> Can't be that difficult to understand: There was a lock there before,
> and the addition of the ASSERT() could help document that the
> serialization requirements aren't being broken. I'm not saying there
Ahhh... OK, so, you treat this more as a comment than anything else.
So, why not use regular comment here then? Hmmm... Do you treat an
ASSERT() here as kind of fuse too?
> might not be other places to _also_ add ASSERT()s, but not in _that
> other_ patch.
OK, so, I would put ASSERT() at least at the beginning of kexec_load()
and kexec_unload() (I am not sure about others). However, then ASSERT()
is not needed in kexec_swap_images(). Though if you wish to leave it
I will not object any longer.
Daniel
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-04-20 10:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-19 15:47 [PATCH v3 0/2] kexec: Use hypercall_create_continuation to protect KEXEC ops Eric DeVolder
2017-04-19 15:47 ` [PATCH v3 1/2] kexec: use " Eric DeVolder
2017-04-19 15:54 ` Daniel Kiper
2017-04-19 16:19 ` Jan Beulich
2017-04-19 17:16 ` Daniel Kiper
2017-04-20 9:34 ` Jan Beulich
2017-04-20 10:42 ` Daniel Kiper [this message]
2017-04-20 10:54 ` Jan Beulich
2017-04-19 15:47 ` [PATCH v3 2/2] kexec: remove spinlock now that all KEXEC hypercall ops are protected at the top-level Eric DeVolder
2017-04-19 15:57 ` Daniel Kiper
2017-04-19 16:21 ` Jan Beulich
2017-04-19 16:33 ` Eric DeVolder
2017-04-19 16:24 ` Eric DeVolder
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=20170420104243.GV16658@olila.local.net-space.pl \
--to=daniel.kiper@oracle.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=bhavesh.davda@oracle.com \
--cc=eric.devolder@oracle.com \
--cc=xen-devel@lists.xen.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.