mbox series

[v2,0/3] modules: few of alignment fixes

Message ID 20240129192644.3359978-1-mcgrof@kernel.org (mailing list archive)
Headers show
Series modules: few of alignment fixes | expand

Message

Luis Chamberlain Jan. 29, 2024, 7:26 p.m. UTC
Helge Deller had written a series of patches to fix a few 
misalignemnt annotations in the kernel [0]. Three of these
patches were tagged as being stable candidates. Because of these
annotation I suggested proof of the imapact, however we did not
easily have a way to verify the value / impact of fixing a few
misaligment changes in the kernel for modules.

For the more hotpath alignment fix Helge had I suggested we could
easily test this by stress testing find_symbol() with a few set of
modules. This adds such tests to allow us to both allow us to test
the impact of such possible fix, and also while at it, let's us
test future improvements on the find_symbol() path.

Changes on this v2:

 - Adds new selftest for kallsyms
 - Drops patch #1 as Masahiro Yamada already applied it to linux-kbuild/fixes
 - Removes stable tags
 - Drops patch #3 as it was not needed
 - Adds a new patch with the issues noted by Helge as a fix
   to commit f3304ecd7f06 ("linux/export: use inline assembler to
   populate symbol CRCs") as noted by Masahiro Yamada
 - Adds selftest impact on x86_64 for patch #2, this really should
   be tested on parisc though as that's an example architecture
   where we could see perhaps more improvement

[0] https://lkml.kernel.org/r/20231122221814.139916-1-deller@kernel.org

Masahiro, if there no issues feel free to take this or I can take them in
too via the modules-next tree. Lemme know!

Helge Deller (2):
  modules: Ensure 64-bit alignment on __ksymtab_* sections
  modules: Add missing entry for __ex_table

Luis Chamberlain (2):
  selftests: add new kallsyms selftests
  vmlinux.lds.h: add missing alignment for symbol CRCs

 include/linux/export-internal.h               |   1 +
 lib/Kconfig.debug                             | 103 ++++++++++++++
 lib/Makefile                                  |   1 +
 lib/tests/Makefile                            |   1 +
 lib/tests/module/.gitignore                   |   4 +
 lib/tests/module/Makefile                     |  15 ++
 lib/tests/module/gen_test_kallsyms.sh         | 128 ++++++++++++++++++
 scripts/module.lds.S                          |   9 +-
 tools/testing/selftests/module/Makefile       |  12 ++
 tools/testing/selftests/module/config         |   3 +
 tools/testing/selftests/module/find_symbol.sh |  81 +++++++++++
 11 files changed, 354 insertions(+), 4 deletions(-)
 create mode 100644 lib/tests/Makefile
 create mode 100644 lib/tests/module/.gitignore
 create mode 100644 lib/tests/module/Makefile
 create mode 100755 lib/tests/module/gen_test_kallsyms.sh
 create mode 100644 tools/testing/selftests/module/Makefile
 create mode 100644 tools/testing/selftests/module/config
 create mode 100755 tools/testing/selftests/module/find_symbol.sh

Comments

Luis Chamberlain Jan. 31, 2024, 10:11 p.m. UTC | #1
On Mon, Jan 29, 2024 at 11:26:39AM -0800, Luis Chamberlain wrote:
> Masahiro, if there no issues feel free to take this or I can take them in
> too via the modules-next tree. Lemme know!

I've queued this onto modules-testing to get winder testing [0]

[0] https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/log/?h=modules-testing

  Luis
Luis Chamberlain Feb. 1, 2024, 6:05 p.m. UTC | #2
On Wed, Jan 31, 2024 at 02:11:44PM -0800, Luis Chamberlain wrote:
> On Mon, Jan 29, 2024 at 11:26:39AM -0800, Luis Chamberlain wrote:
> > Masahiro, if there no issues feel free to take this or I can take them in
> > too via the modules-next tree. Lemme know!
> 
> I've queued this onto modules-testing to get winder testing [0]

I've moved it to modules-next as I've found no issues.

  Luis
Masahiro Yamada Feb. 2, 2024, 3:20 p.m. UTC | #3
On Fri, Feb 2, 2024 at 3:05 AM Luis Chamberlain <mcgrof@kernel.org> wrote:
>
> On Wed, Jan 31, 2024 at 02:11:44PM -0800, Luis Chamberlain wrote:
> > On Mon, Jan 29, 2024 at 11:26:39AM -0800, Luis Chamberlain wrote:
> > > Masahiro, if there no issues feel free to take this or I can take them in
> > > too via the modules-next tree. Lemme know!
> >
> > I've queued this onto modules-testing to get winder testing [0]
>
> I've moved it to modules-next as I've found no issues.
>
>   Luis


I believe this patch series is wrong.



I thought we agreed that the alignment must be added to
individual asm code, not to the linker script.

I am surprised that you came back to this.







--
Best Regards
Masahiro Yamada
Luis Chamberlain Feb. 2, 2024, 6:23 p.m. UTC | #4
On Sat, Feb 03, 2024 at 12:20:38AM +0900, Masahiro Yamada wrote:
> On Fri, Feb 2, 2024 at 3:05 AM Luis Chamberlain <mcgrof@kernel.org> wrote:
> >
> > On Wed, Jan 31, 2024 at 02:11:44PM -0800, Luis Chamberlain wrote:
> > > On Mon, Jan 29, 2024 at 11:26:39AM -0800, Luis Chamberlain wrote:
> > > > Masahiro, if there no issues feel free to take this or I can take them in
> > > > too via the modules-next tree. Lemme know!
> > >
> > > I've queued this onto modules-testing to get winder testing [0]
> >
> > I've moved it to modules-next as I've found no issues.
> >
> >   Luis
> 
> 
> I believe this patch series is wrong.
> 
> I thought we agreed that the alignment must be added to
> individual asm code, not to the linker script.
>
> I am surprised that you came back to this.

I misseed the dialog on the old cover letter, sorry. I've yanked these patches
out. I'd expect a respin from Helge.

  Luis
Luis Chamberlain Oct. 21, 2024, 7:22 p.m. UTC | #5
On Fri, Feb 02, 2024 at 10:23:21AM -0800, Luis Chamberlain wrote:
> On Sat, Feb 03, 2024 at 12:20:38AM +0900, Masahiro Yamada wrote:
> > On Fri, Feb 2, 2024 at 3:05 AM Luis Chamberlain <mcgrof@kernel.org> wrote:
> > >
> > > On Wed, Jan 31, 2024 at 02:11:44PM -0800, Luis Chamberlain wrote:
> > > > On Mon, Jan 29, 2024 at 11:26:39AM -0800, Luis Chamberlain wrote:
> > > > > Masahiro, if there no issues feel free to take this or I can take them in
> > > > > too via the modules-next tree. Lemme know!
> > > >
> > > > I've queued this onto modules-testing to get winder testing [0]
> > >
> > > I've moved it to modules-next as I've found no issues.
> > >
> > >   Luis
> > 
> > 
> > I believe this patch series is wrong.
> > 
> > I thought we agreed that the alignment must be added to
> > individual asm code, not to the linker script.
> >
> > I am surprised that you came back to this.
> 
> I misseed the dialog on the old cover letter, sorry. I've yanked these patches
> out. I'd expect a respin from Helge.

Just goind down memory lane -- Helge, the work here pending was to move
this to the linker script. Were you going to follow up on this?

I'll split out my test patch as that's useful for other reasons now.

  Luis
Helge Deller Oct. 21, 2024, 8:07 p.m. UTC | #6
On 10/21/24 21:22, Luis Chamberlain wrote:
> On Fri, Feb 02, 2024 at 10:23:21AM -0800, Luis Chamberlain wrote:
>> On Sat, Feb 03, 2024 at 12:20:38AM +0900, Masahiro Yamada wrote:
>>> On Fri, Feb 2, 2024 at 3:05 AM Luis Chamberlain <mcgrof@kernel.org> wrote:
>>>>
>>>> On Wed, Jan 31, 2024 at 02:11:44PM -0800, Luis Chamberlain wrote:
>>>>> On Mon, Jan 29, 2024 at 11:26:39AM -0800, Luis Chamberlain wrote:
>>>>>> Masahiro, if there no issues feel free to take this or I can take them in
>>>>>> too via the modules-next tree. Lemme know!
>>>>>
>>>>> I've queued this onto modules-testing to get winder testing [0]
>>>>
>>>> I've moved it to modules-next as I've found no issues.
>>>>
>>>>    Luis
>>>
>>>
>>> I believe this patch series is wrong.
>>>
>>> I thought we agreed that the alignment must be added to
>>> individual asm code, not to the linker script.
>>>
>>> I am surprised that you came back to this.
>>
>> I misseed the dialog on the old cover letter, sorry. I've yanked these patches
>> out. I'd expect a respin from Helge.
>
> Just goind down memory lane -- Helge, the work here pending was to move
> this to the linker script. Were you going to follow up on this?

Masahiro mentions above, that the alignment should be added
to the individual asm code. This happened in the meantime for parisc, but
I'm not sure if all platforms get this right.
So in addition, I still believe that adding the alignment to the linker
script too is another right thing to do.

Helge
Masahiro Yamada Oct. 23, 2024, 4:55 a.m. UTC | #7
On Tue, Oct 22, 2024 at 5:07 AM Helge Deller <deller@gmx.de> wrote:
>
> On 10/21/24 21:22, Luis Chamberlain wrote:
> > On Fri, Feb 02, 2024 at 10:23:21AM -0800, Luis Chamberlain wrote:
> >> On Sat, Feb 03, 2024 at 12:20:38AM +0900, Masahiro Yamada wrote:
> >>> On Fri, Feb 2, 2024 at 3:05 AM Luis Chamberlain <mcgrof@kernel.org> wrote:
> >>>>
> >>>> On Wed, Jan 31, 2024 at 02:11:44PM -0800, Luis Chamberlain wrote:
> >>>>> On Mon, Jan 29, 2024 at 11:26:39AM -0800, Luis Chamberlain wrote:
> >>>>>> Masahiro, if there no issues feel free to take this or I can take them in
> >>>>>> too via the modules-next tree. Lemme know!
> >>>>>
> >>>>> I've queued this onto modules-testing to get winder testing [0]
> >>>>
> >>>> I've moved it to modules-next as I've found no issues.
> >>>>
> >>>>    Luis
> >>>
> >>>
> >>> I believe this patch series is wrong.
> >>>
> >>> I thought we agreed that the alignment must be added to
> >>> individual asm code, not to the linker script.
> >>>
> >>> I am surprised that you came back to this.
> >>
> >> I misseed the dialog on the old cover letter, sorry. I've yanked these patches
> >> out. I'd expect a respin from Helge.
> >
> > Just goind down memory lane -- Helge, the work here pending was to move
> > this to the linker script. Were you going to follow up on this?
>
> Masahiro mentions above, that the alignment should be added
> to the individual asm code. This happened in the meantime for parisc, but
> I'm not sure if all platforms get this right.
> So in addition, I still believe that adding the alignment to the linker
> script too is another right thing to do.
>
> Helge

Yes, I believe the proper alignment should be specified in asm code.