All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [PATCH] x86: assert MBI is large enough in pvh-boot.c
Date: Wed, 26 Sep 2018 06:07:30 -0600	[thread overview]
Message-ID: <5BAB768202000078001EC2A8@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <20180926110000.9764-1-wei.liu2@citrix.com>

>>> On 26.09.18 at 13:00, <wei.liu2@citrix.com> wrote:
> --- a/xen/arch/x86/guest/pvh-boot.c
> +++ b/xen/arch/x86/guest/pvh-boot.c
> @@ -44,6 +44,13 @@ static void __init convert_pvh_info(void)
>  
>      ASSERT(pvh_info->magic == XEN_HVM_START_MAGIC_VALUE);
>  
> +    /*
> +     * Temporary MBI array needs to be at least one element bigger than
> +     * required. The extra element is used to aid relocation. See
> +     * arch/x86/setup.c:__start_xen().
> +     */
> +    ASSERT(ARRAY_SIZE(pvh_mbi_mods) > pvh_info->nr_modules);

Are ASSERT()s (also the other one in context) actually the right thing
here? I think we'd better panic(): That'll also cover release builds and
is imo more appropriate for data coming from the outside.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-09-26 12:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26 11:00 [PATCH] x86: assert MBI is large enough in pvh-boot.c Wei Liu
2018-09-26 11:05 ` Andrew Cooper
2018-09-27 16:06   ` Wei Liu
2018-09-26 12:07 ` Jan Beulich [this message]
2018-09-27 16:06   ` Wei Liu

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=5BAB768202000078001EC2A8@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=wei.liu2@citrix.com \
    --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.