All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Thomas Gleixner <tglx@linutronix.de>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>
Cc: x86@kernel.org, mingo@redhat.com, bp@alien8.de,
	dave.hansen@linux.intel.com, hpa@zytor.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] x86/alternative: record .altinstructions section entity size
Date: Wed, 6 Apr 2022 10:30:32 +0200	[thread overview]
Message-ID: <cf7449c2-71ef-aed1-c871-c9ae7202b3fc@rasmusvillemoes.dk> (raw)
In-Reply-To: <87o81f1gh9.ffs@tglx>

On 05/04/2022 21.24, Thomas Gleixner wrote:
> On Sun, Mar 13 2022 at 21:05, Alexey Dobriyan wrote:

> That does not matter. M merges any duplications in sections with the
> same [section] name, entity size and flags.
> 
>      .pushsection .bar "aM" @progbits, 4
>      .byte 0x01, 0x02, 0x03, 0x04
>      .popsection
> 
>      .pushsection .bar "aM" @progbits, 4
>      .byte 0x01, 0x02, 0x03, 0x04
>      .popsection
> 
> Will create a section .bar with lenght 4 and the content:
>      0x1,0x2,0x3,0x4
> 
> What saves you here is the fact that the altinstruction entries are
> guaranteed to be unique, but that wants a big fat comment.

Actually, I think what saves this is that the linker at least currently
ignores the merge flag for sections with relocations; from binutils
bfd/merge.c:

  if ((sec->flags & SEC_RELOC) != 0)
    {
      /* We aren't prepared to handle relocations in merged sections.  */
      return true;
    }

I do think it is theoretically possible for two altinstruction entries
to end up being identical after relocations have been applied (same
relative offsets to both the .text section and their replacement
instructions).

Rasmus

  reply	other threads:[~2022-04-06 11:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-11 14:43 [PATCH 1/5] x86/alternative: simplify DUMP_BYTES macro Alexey Dobriyan
2022-03-11 14:43 ` [PATCH 2/5] x86/alternative: bump MAX_PATCH_LEN Alexey Dobriyan
2022-03-11 14:43 ` [PATCH 3/5] x86/alternative: record .altinstructions section entity size Alexey Dobriyan
2022-03-12 21:17   ` Peter Zijlstra
2022-03-13 18:05     ` Alexey Dobriyan
2022-04-05 19:24       ` Thomas Gleixner
2022-04-06  8:30         ` Rasmus Villemoes [this message]
2022-03-11 14:43 ` [PATCH 4/5] x86/alternative: make .altinstr_replacement section non-executable Alexey Dobriyan
2022-03-12 15:31   ` Peter Zijlstra
2022-03-11 14:43 ` [PATCH 5/5] x86/unwind/orc: delete dead write in __orc_find() Alexey Dobriyan
2022-03-11 15:13   ` David Laight
2022-03-11 16:59     ` Alexey Dobriyan
2022-03-12 16:36 ` [PATCH 1/5] x86/alternative: simplify DUMP_BYTES macro Joe Perches
2022-03-13  0:14   ` Joe Perches
2022-03-13 18:09   ` Alexey Dobriyan
2022-03-14  3:21     ` Joe Perches
2022-04-03 22:25 ` Borislav Petkov
2022-04-05 16:36 ` Thomas Gleixner

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=cf7449c2-71ef-aed1-c871-c9ae7202b3fc@rasmusvillemoes.dk \
    --to=linux@rasmusvillemoes.dk \
    --cc=adobriyan@gmail.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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.