xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: xen-devel@lists.xen.org
Subject: Re: [PATCH 3/3] xen/init: Annotate all command line parameter infrastructure as const
Date: Tue, 9 Feb 2016 14:40:01 +0000	[thread overview]
Message-ID: <56B9FA41.5020705@citrix.com> (raw)
In-Reply-To: <56BA068202000078000D018B@prv-mh.provo.novell.com>

On 09/02/16 14:32, Jan Beulich wrote:
>>>> On 09.02.16 at 14:52, <andrew.cooper3@citrix.com> wrote:
>> On 09/02/16 12:43, Jan Beulich wrote:
>>>>>> On 08.02.16 at 18:07, <andrew.cooper3@citrix.com> wrote:
>>>> --- a/xen/arch/x86/xen.lds.S
>>>> +++ b/xen/arch/x86/xen.lds.S
>>>> @@ -120,6 +120,12 @@ SECTIONS
>>>>    .init.data : {
>>>>         *(.init.rodata)
>>>>         *(.init.rodata.str*)
>>>> +
>>>> +       . = ALIGN(32);
>>> Why 32?
>>>
>>>> +       __setup_start = .;
>>>> +       *(.init.setup)
>>>> +       __setup_end = .;
>>>> +
>>>>         *(.init.data)
>>>>         *(.init.data.rel)
>>>>         *(.init.data.rel.*)
>>>> @@ -146,11 +152,6 @@ SECTIONS
>>>>         __ctors_end = .;
>>>>    } :text
>>>>    . = ALIGN(32);
>>>> -  .init.setup : {
>>>> -       __setup_start = .;
>>>> -       *(.init.setup)
>>>> -       __setup_end = .;
>>>> -  } :text
>>> If just because it was 32 here, I don't think that's a compelling
>>> reason. With it (above, not necessarily here) reduced to 8 (which
>>> of course could also be done while committing, if you agree and
>>> there are no deeper reasons),
>>> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>> It was just because of the code here.  I still can't think of any
>> specific reason why 32 is needed, so the ALIGN() can just be dropped.
> No, dropping ALIGN() altogether would make the placement of
> __setup_start dependent upon the alignment of the previous
> section (and since it's a strings section which precedes it,
> problems would be quite likely). (This is, btw., why it would be
> better if we used __startof__ and __alignof__ instead of linker
> script generated symbols. I may give that a try ...)

Actually, thinking about it,

andrewcoop@andrewcoop:/local/xen.git/xen$ pahole xen-syms -C kernel_param
struct kernel_param {
    const char  *              name;                 /*     0     8 */
    enum {
        OPT_STR = 0,
        OPT_UINT = 1,
        OPT_BOOL = 2,
        OPT_SIZE = 3,
        OPT_CUSTOM = 4,
    } type;                                          /*     8     4 */

    /* XXX 4 bytes hole, try to pack */

    void *                     var;                  /*    16     8 */
    unsigned int               len;                  /*    24     4 */

    /* size: 32, cachelines: 1, members: 4 */
    /* sum members: 24, holes: 1, sum holes: 4 */
    /* padding: 4 */
    /* last cacheline: 32 bytes */
};

This will be where the 32 byte alignment comes from, although dropping
the structure size to 24 bytes would be trivial.

~Andrew

  reply	other threads:[~2016-02-09 14:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 17:07 [PATCH 1/3] xen/x86: Drop the uses of invbool_param() Andrew Cooper
2016-02-08 17:07 ` [PATCH 2/3] xen/init: Drop invbool_param() Andrew Cooper
2016-02-09 12:47   ` Jan Beulich
2016-02-08 17:07 ` [PATCH 3/3] xen/init: Annotate all command line parameter infrastructure as const Andrew Cooper
2016-02-09 12:43   ` Jan Beulich
2016-02-09 13:52     ` Andrew Cooper
2016-02-09 14:32       ` Jan Beulich
2016-02-09 14:40         ` Andrew Cooper [this message]
2016-02-09 14:50           ` Jan Beulich
2016-02-22 16:36   ` Jan Beulich
2016-02-22 16:41     ` Andrew Cooper
2016-02-22 18:43     ` Doug Goldstein
2016-02-23  8:07       ` Jan Beulich
2016-02-09 12:46 ` [PATCH 1/3] xen/x86: Drop the uses of invbool_param() Jan Beulich
2016-02-11  9:58   ` Ian Campbell

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=56B9FA41.5020705@citrix.com \
    --to=andrew.cooper3@citrix.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).