All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: Stefano Stabellini <stefanos@xilinx.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	george.dunlap@citrix.com, Julien Grall <julien.grall@arm.com>,
	ian.jackson@citrix.com,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v11 5/9] xen/x86: use DECLARE_BOUNDS as required
Date: Wed, 06 Mar 2019 08:33:26 -0700	[thread overview]
Message-ID: <5C7FE846020000780021C2BA@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <1551825512-8975-5-git-send-email-sstabellini@kernel.org>

>>> On 05.03.19 at 23:38, <sstabellini@kernel.org> wrote:
> --- a/xen/arch/x86/percpu.c
> +++ b/xen/arch/x86/percpu.c
> @@ -13,7 +13,8 @@ unsigned long __per_cpu_offset[NR_CPUS];
>   * context of PV guests.
>   */
>  #define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
> -#define PERCPU_ORDER get_order_from_bytes(__per_cpu_data_end - __per_cpu_start)
> +#define PERCPU_ORDER get_order_from_bytes(per_cpu_diff(__per_cpu_start,     \
> +                                                       __per_cpu_data_end))

Please use _bytediff() when bytes are meant (i.e. also below, and
perhaps elsewhere).

> @@ -600,7 +602,9 @@ static void noinline init_done(void)
>      unregister_init_virtual_region();
>  
>      /* Zero the .init code and data. */
> -    for ( va = __init_begin; va < _p(__init_end); va += PAGE_SIZE )
> +    for ( va = (char *)__init_begin;
> +          init_lt(va, __init_end);
> +          va += PAGE_SIZE )

Is the line wrapping really needed here?

> --- a/xen/drivers/vpci/vpci.c
> +++ b/xen/drivers/vpci/vpci.c
> @@ -31,9 +31,9 @@ struct vpci_register {
>  };
>  
>  #ifdef __XEN__
> -extern vpci_register_init_t *const __start_vpci_array[];
> -extern vpci_register_init_t *const __end_vpci_array[];
> -#define NUM_VPCI_INIT (__end_vpci_array - __start_vpci_array)
> +typedef vpci_register_init_t *const vpci_array_t;

You don't want to keep the const here - DECLARE_BOUNDS() will
suitably add it.

Also how about vcpi_init_t or vpci_reg_init_t or some such? The
defined type is not really an array after all.

> +DECLARE_BOUNDS(vpci_array, __start_vpci_array, __end_vpci_array);
> +#define NUM_VPCI_INIT (vpci_array_diff(__start_vpci_array, __end_vpci_array))

Unnecessary outermost parentheses.

Jan



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

  reply	other threads:[~2019-03-06 15:33 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-05 22:38 [PATCH v11 0/9] misc safety certification fixes Stefano Stabellini
2019-03-05 22:38 ` [PATCH v11 1/9] xen: use __UINTPTR_TYPE__ for uintptr_t Stefano Stabellini
2019-03-06  7:47   ` Jan Beulich
2019-03-06 21:16     ` Stefano Stabellini
2019-03-07  8:29       ` Jan Beulich
2019-03-07 15:43         ` Ian Jackson
2019-03-08  7:23           ` Jan Beulich
2019-03-08 14:18   ` Andrew Cooper
2019-03-08 15:19     ` Ian Jackson
2019-03-05 22:38 ` [PATCH v11 2/9] xen: introduce ptrdiff_t Stefano Stabellini
2019-03-05 22:38 ` [PATCH v11 3/9] xen: introduce DECLARE_BOUNDS Stefano Stabellini
2019-03-06 15:24   ` Jan Beulich
2019-03-06 20:55     ` Stefano Stabellini
2019-03-07  8:39       ` Jan Beulich
2019-03-07 14:16         ` Ian Jackson
2019-03-08  8:15           ` Jan Beulich
2019-03-08 15:31             ` Ian Jackson
2019-03-05 22:38 ` [PATCH v11 4/9] xen/arm: use DECLARE_BOUNDS as required Stefano Stabellini
2019-03-05 22:38 ` [PATCH v11 5/9] xen/x86: " Stefano Stabellini
2019-03-06 15:33   ` Jan Beulich [this message]
2019-03-06 21:05     ` Stefano Stabellini
2019-03-07  8:40       ` Jan Beulich
2019-03-07 14:02       ` Ian Jackson
2019-03-07 14:42         ` George Dunlap
2019-03-08  8:46         ` Jan Beulich
2019-03-08  8:55           ` Juergen Gross
2019-03-08 15:33           ` Ian Jackson
2019-03-06 15:48   ` Jan Beulich
2019-03-06 21:38     ` Stefano Stabellini
2019-03-07  8:50       ` Jan Beulich
2019-03-07 14:43         ` Ian Jackson
2019-03-08  8:22           ` Jan Beulich
2019-03-08 15:36             ` Ian Jackson
2019-03-08 15:57               ` Jan Beulich
2019-03-07 14:00       ` Ian Jackson
2019-03-08 15:43   ` Ian Jackson
2019-03-08 15:49     ` Jan Beulich
2019-03-05 22:38 ` [PATCH v11 6/9] xen/common: " Stefano Stabellini
2019-03-06 15:37   ` Jan Beulich
2019-03-06 21:08     ` Stefano Stabellini
2019-03-05 22:38 ` [PATCH v11 7/9] xen: " Stefano Stabellini
2019-03-05 22:38 ` [PATCH v11 8/9] xen: use DECLARE_BOUNDS in alternative.c Stefano Stabellini
2019-03-06 16:35   ` Jan Beulich
2019-03-06 21:38     ` Stefano Stabellini
2019-03-05 22:38 ` [PATCH v11 9/9] xen: explicit casts when DECLARE_BOUNDS cannot be used Stefano Stabellini
2019-03-07 11:40   ` Jan Beulich
2019-03-07 15:25     ` [PATCH v11 9/9] xen: explicit casts when DECLARE_BOUNDS cannot be used [and 1 more messages] Ian Jackson
2019-03-07 22:55       ` Stefano Stabellini
2019-03-08 15:39         ` [PATCH v11 9/9] xen: explicit casts when DECLARE_BOUNDS cannot be used [and 1 more messages] " Ian Jackson
2019-03-08  8:28       ` [PATCH v11 9/9] xen: explicit casts when DECLARE_BOUNDS cannot be used " Jan Beulich
2019-03-08 15:26 ` SRSL People... [PATCH v11 0/9] misc safety certification fixes Andrew Cooper
2019-03-08 15:44   ` Ian Jackson
2019-03-08 15:46   ` Jan Beulich
2019-03-08 20:14     ` Stefano Stabellini

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=5C7FE846020000780021C2BA@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=ian.jackson@citrix.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=stefanos@xilinx.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.