All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Julien Grall <julien@xen.org>
Cc: xen-devel@lists.xenproject.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>
Subject: Re: [PATCH] livepatch: apply_alternatives() is only used for livepatch
Date: Wed, 7 Jun 2023 10:56:18 +0200	[thread overview]
Message-ID: <ZIBGMniARzdndoid@Air-de-Roger> (raw)
In-Reply-To: <0fd63050-7592-c308-51d1-f8445d3fbd4b@xen.org>

On Tue, Jun 06, 2023 at 07:10:05PM +0100, Julien Grall wrote:
> Hi Roger,
> 
> On 06/06/2023 18:23, Roger Pau Monne wrote:
> > Guard it with CONFIG_LIVEPATCH.  Note alternatives are applied at boot
> > using _apply_alternatives().
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> 
> Reviewed-by: Julien Grall <jgrall@amazon.com>

Thanks!

> > ---
> >   xen/arch/arm/alternative.c             | 2 ++
> >   xen/arch/arm/include/asm/alternative.h | 2 ++
> >   xen/arch/x86/alternative.c             | 5 +++--
> >   xen/arch/x86/include/asm/alternative.h | 2 ++
> >   4 files changed, 9 insertions(+), 2 deletions(-)
> > 
> > diff --git a/xen/arch/arm/alternative.c b/xen/arch/arm/alternative.c
> > index 7366af4ea646..016e66978b6d 100644
> > --- a/xen/arch/arm/alternative.c
> > +++ b/xen/arch/arm/alternative.c
> > @@ -223,6 +223,7 @@ void __init apply_alternatives_all(void)
> >       vunmap(xenmap);
> >   }
> > +#ifdef CONFIG_LIVEPATCH
> >   int apply_alternatives(const struct alt_instr *start, const struct alt_instr *end)
> >   {
> >       const struct alt_region region = {
> > @@ -232,6 +233,7 @@ int apply_alternatives(const struct alt_instr *start, const struct alt_instr *en
> >       return __apply_alternatives(&region, 0);
> >   }
> > +#endif
> >   /*
> >    * Local variables:
> > diff --git a/xen/arch/arm/include/asm/alternative.h b/xen/arch/arm/include/asm/alternative.h
> > index d3210e82f9e5..ce82dc1ca0d2 100644
> > --- a/xen/arch/arm/include/asm/alternative.h
> > +++ b/xen/arch/arm/include/asm/alternative.h
> > @@ -29,7 +29,9 @@ typedef void (*alternative_cb_t)(const struct alt_instr *alt,
> >   				 int nr_inst);
> >   void apply_alternatives_all(void);
> > +#ifdef CONFIG_LIVEPATCH
> >   int apply_alternatives(const struct alt_instr *start, const struct alt_instr *end);
> > +#endif
> >   #define ALTINSTR_ENTRY(feature, cb)					      \
> >   	" .word 661b - .\n"				/* label           */ \
> > diff --git a/xen/arch/x86/alternative.c b/xen/arch/x86/alternative.c
> > index 99482766b51f..21af0e825822 100644
> > --- a/xen/arch/x86/alternative.c
> > +++ b/xen/arch/x86/alternative.c
> > @@ -358,11 +358,12 @@ static void init_or_livepatch _apply_alternatives(struct alt_instr *start,
> >       }
> >   }
> > -void init_or_livepatch apply_alternatives(struct alt_instr *start,
> > -                                          struct alt_instr *end)
> 
> NIT: It sounds like the init_* was a left-over after commit 67d01cdb5518
> ("x86: infrastructure to allow converting certain indirect calls to direct
> ones").

I think it doesn't warrant a fixes tag in this case.  The commit you
point out should also have added the livepatch guards in x86 at least,
since that's the only caller of apply_alternatives() after the
patch.

Thanks, Roger.


  parent reply	other threads:[~2023-06-07  8:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-06 17:23 [PATCH] livepatch: apply_alternatives() is only used for livepatch Roger Pau Monne
2023-06-06 18:10 ` Julien Grall
2023-06-07  8:13   ` Jan Beulich
2023-06-07  8:56   ` Roger Pau Monné [this message]
2023-06-06 18:16 ` Andrew Cooper
2023-06-07  8:14 ` Jan Beulich
2023-06-07  8:47   ` Roger Pau Monné

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=ZIBGMniARzdndoid@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bertrand.marquis@arm.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --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.