All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: xen-devel@lists.xenproject.org, Jan Beulich <jbeulich@suse.com>,
	Wei Liu <wl@xen.org>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Ross Lagerwall <ross.lagerwall@citrix.com>
Subject: Re: [PATCH v2 1/5] x86/livepatch: set function alignment to ensure minimal function size
Date: Tue, 5 Dec 2023 16:01:22 +0100	[thread overview]
Message-ID: <ZW87Qq3Hw4ql-ZFw@macbook> (raw)
In-Reply-To: <ddbf1fad-e0c1-4b7c-9734-71d4997b5aa0@citrix.com>

On Tue, Dec 05, 2023 at 01:42:42PM +0000, Andrew Cooper wrote:
> On 28/11/2023 10:03 am, Roger Pau Monne wrote:
> > diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
> > index f3abdf9cd111..f629157086d0 100644
> > --- a/xen/arch/x86/Makefile
> > +++ b/xen/arch/x86/Makefile
> > @@ -82,6 +82,8 @@ obj-$(CONFIG_COMPAT) += x86_64/platform_hypercall.o
> >  obj-y += sysctl.o
> >  endif
> >  
> > +CFLAGS-$(CONFIG_LIVEPATCH) += -falign-functions=$(CONFIG_CC_FUNCTION_ALIGNMENT)
> 
> I'd really prefer not to express it like this.  For one, a major reason
> for using an alignment of 16b or more is simply performance.
> 
> Also, it isn't "CC" when we get the asm macros working.
> 
> Copy Linux more closely.  Then, you have LIVEPATCH select
> FUNCTION_ALIGNMENT_{8,16}B as appropriate.  And PERFORMANCE selects
> FUNCTION_ALIGNMENT_16B or perhaps 32B depending on uarch.

So just use CONFIG_FUNCTION_ALIGNMENT and drop the CC part of it?
That would indeed be fine.  We will also need to adjust
CC_SPLIT_SECTIONS to drop the CC_ prefix when we start using it in
assembly code.

> If we ever get around to having KCFI, then we need 16B irrespective of
> anything else.
> 
> 
> 
> As for the subject, it's not really about size; the function size is
> still going to be small irrespective of the alignment.

What about wording it like:

x86/livepatch: set function alignment to ensure minimal space between functions

Thanks, Roger.


  reply	other threads:[~2023-12-05 15:01 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-28 10:03 [PATCH v2 0/5] xen/x86: add testing for self modifying code and livepatch Roger Pau Monne
2023-11-28 10:03 ` [PATCH v2 1/5] x86/livepatch: set function alignment to ensure minimal function size Roger Pau Monne
2023-11-30 16:55   ` Jan Beulich
2023-11-30 17:37     ` Roger Pau Monné
2023-12-01  6:53       ` Jan Beulich
2023-12-01  8:50         ` Roger Pau Monné
2023-12-01  9:41           ` Jan Beulich
2023-12-01 10:21             ` Roger Pau Monné
2023-12-01 10:59               ` Jan Beulich
2023-12-01 11:31                 ` Roger Pau Monné
2023-12-01 12:59                   ` Jan Beulich
2023-12-05 13:42   ` Andrew Cooper
2023-12-05 15:01     ` Roger Pau Monné [this message]
2023-12-05 15:14       ` Jan Beulich
2023-12-05 15:36         ` Roger Pau Monné
2023-12-05 15:45           ` Jan Beulich
2023-11-28 10:03 ` [PATCH v2 2/5] automation/alpine: add elfutils-dev Roger Pau Monne
2023-11-30  2:56   ` Stefano Stabellini
2023-11-28 10:03 ` [PATCH v2 3/5] xen/x86: introduce self modifying code test Roger Pau Monne
2023-11-30  2:58   ` Stefano Stabellini
2023-12-01 11:52     ` Roger Pau Monné
2023-11-30 17:02   ` Jan Beulich
2023-12-01 12:08     ` Roger Pau Monné
2023-12-02  2:36       ` Stefano Stabellini
2023-11-28 10:03 ` [PATCH v2 4/5] x86/livepatch: introduce a basic live patch test to gitlab CI Roger Pau Monne
2023-12-05 11:49   ` Jan Beulich
2023-12-05 13:08     ` Roger Pau Monné
2023-12-05 13:23       ` Jan Beulich
2023-11-28 10:03 ` [PATCH v2 5/5] automation: add x86-64 livepatching test Roger Pau Monne
2023-11-30  3:03   ` Stefano Stabellini
2023-12-13 10:55     ` Roger Pau Monné
2023-12-14  2:08       ` 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=ZW87Qq3Hw4ql-ZFw@macbook \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=konrad.wilk@oracle.com \
    --cc=ross.lagerwall@citrix.com \
    --cc=wl@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.