Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1313004 > unrolled thread

[PATCH 3/4] s390: enable text relative kallsyms for 64-bit targets

Started byArd Biesheuvel <ard.biesheuvel@linaro.org>
First post2016-01-20 10:10 +0100
Last post2016-01-20 11:20 +0100
Articles 5 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/4] s390: enable text relative kallsyms for 64-bit targets Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-01-20 10:10 +0100
    Re: [PATCH 3/4] s390: enable text relative kallsyms for 64-bit  targets Heiko Carstens <heiko.carstens@de.ibm.com> - 2016-01-20 10:50 +0100
      Re: [PATCH 3/4] s390: enable text relative kallsyms for 64-bit targets Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-01-20 11:10 +0100
        Re: [PATCH 3/4] s390: enable text relative kallsyms for 64-bit  targets Heiko Carstens <heiko.carstens@de.ibm.com> - 2016-01-20 11:20 +0100
          Re: [PATCH 3/4] s390: enable text relative kallsyms for 64-bit targets Ard Biesheuvel <ard.biesheuvel@linaro.org> - 2016-01-20 11:20 +0100

#1313004 — [PATCH 3/4] s390: enable text relative kallsyms for 64-bit targets

FromArd Biesheuvel <ard.biesheuvel@linaro.org>
Date2016-01-20 10:10 +0100
Subject[PATCH 3/4] s390: enable text relative kallsyms for 64-bit targets
Message-ID<qSWW6-4hT-1@gated-at.bofh.it>
This enables the newly introduced text-relative kallsyms support when
building 64-bit targets. This cuts the size of the kallsyms address
table in half, reducing the memory footprint of the kernel .rodata
section by about 250 KB for a defconfig build.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---

BEFORE:
=======
$ size vmlinux
   text	   data	    bss	    dec	    hex	filename
12329586	3107008	14727792	30164386	1cc45a2	vmlinux

$ readelf -S .tmp_kallsyms2.o
There are 9 section headers, starting at offset 0x125b50:

Section Headers:
  [Nr] Name              Type             Address           Offset
       Size              EntSize          Flags  Link  Info  Align
  ...
  [ 4] .rodata           PROGBITS         0000000000000000  00000040
       0000000000125ad0  0000000000000000   A       0     0     8
  [ 5] .rela.rodata      RELA             0000000000000000  00125f28
       000000000015ead8  0000000000000018           7     4     8
  [ 6] .shstrtab         STRTAB           0000000000000000  00125b10
       0000000000000039  0000000000000000           0     0     1
  ...

$ ls -l arch/s390/boot/bzImage
-rwxrwxr-x 1 ard ard 5234224 Jan 20 08:22 arch/s390/boot/bzImage

AFTER:
======
$ size vmlinux
   text	   data	    bss	    dec	    hex	filename
12088114	3102912	14727792	29918818	1c88662	vmlinux

$ readelf -S .tmp_kallsyms2.o
There are 8 section headers, starting at offset 0xeb428:

Section Headers:
  [Nr] Name              Type             Address           Offset
  ...
  [ 4] .rodata           PROGBITS         0000000000000000  00000040
       00000000000eb3b0  0000000000000000   A       0     0     8
  [ 5] .shstrtab         STRTAB           0000000000000000  000eb3f0
       0000000000000034  0000000000000000           0     0     1
  ...

$ ls -l arch/s390/boot/bzImage
-rwxrwxr-x 1 ard ard 5224256 Jan 20 08:23 arch/s390/boot/bzImage
---
 arch/s390/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index dbeeb3a049f2..588160fd1db0 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -149,6 +149,7 @@ config S390
 	select HAVE_REGS_AND_STACK_ACCESS_API
 	select HAVE_SYSCALL_TRACEPOINTS
 	select HAVE_VIRT_CPU_ACCOUNTING
+	select KALLSYMS_TEXT_RELATIVE if 64BIT
 	select MODULES_USE_ELF_RELA
 	select NO_BOOTMEM
 	select OLD_SIGACTION
-- 
2.5.0

[toc] | [next] | [standalone]


#1313043 — Re: [PATCH 3/4] s390: enable text relative kallsyms for 64-bit targets

FromHeiko Carstens <heiko.carstens@de.ibm.com>
Date2016-01-20 10:50 +0100
SubjectRe: [PATCH 3/4] s390: enable text relative kallsyms for 64-bit targets
Message-ID<qSXyP-4y5-17@gated-at.bofh.it>
In reply to#1313004
On Wed, Jan 20, 2016 at 10:05:37AM +0100, Ard Biesheuvel wrote:
> This enables the newly introduced text-relative kallsyms support when
> building 64-bit targets. This cuts the size of the kallsyms address
> table in half, reducing the memory footprint of the kernel .rodata
> section by about 250 KB for a defconfig build.
> 
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> 
> diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
> index dbeeb3a049f2..588160fd1db0 100644
> --- a/arch/s390/Kconfig
> +++ b/arch/s390/Kconfig
> @@ -149,6 +149,7 @@ config S390
>  	select HAVE_REGS_AND_STACK_ACCESS_API
>  	select HAVE_SYSCALL_TRACEPOINTS
>  	select HAVE_VIRT_CPU_ACCOUNTING
> +	select KALLSYMS_TEXT_RELATIVE if 64BIT

Please remove the "if 64BIT" since s390 is always 64BIT in the meantime.
Tested on s390 and everything seems still to work ;)

Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>

[toc] | [prev] | [next] | [standalone]


#1313052

FromArd Biesheuvel <ard.biesheuvel@linaro.org>
Date2016-01-20 11:10 +0100
Message-ID<qSXSa-4UA-9@gated-at.bofh.it>
In reply to#1313043
On 20 January 2016 at 10:43, Heiko Carstens <heiko.carstens@de.ibm.com> wrote:
> On Wed, Jan 20, 2016 at 10:05:37AM +0100, Ard Biesheuvel wrote:
>> This enables the newly introduced text-relative kallsyms support when
>> building 64-bit targets. This cuts the size of the kallsyms address
>> table in half, reducing the memory footprint of the kernel .rodata
>> section by about 250 KB for a defconfig build.
>>
>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> ---
>>
>> diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
>> index dbeeb3a049f2..588160fd1db0 100644
>> --- a/arch/s390/Kconfig
>> +++ b/arch/s390/Kconfig
>> @@ -149,6 +149,7 @@ config S390
>>       select HAVE_REGS_AND_STACK_ACCESS_API
>>       select HAVE_SYSCALL_TRACEPOINTS
>>       select HAVE_VIRT_CPU_ACCOUNTING
>> +     select KALLSYMS_TEXT_RELATIVE if 64BIT
>
> Please remove the "if 64BIT" since s390 is always 64BIT in the meantime.
> Tested on s390 and everything seems still to work ;)
>
> Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
>

Thanks! Did you take a look at /proc/kallsyms, by any chance? It
should look identical with and without these patches

[toc] | [prev] | [next] | [standalone]


#1313055 — Re: [PATCH 3/4] s390: enable text relative kallsyms for 64-bit targets

FromHeiko Carstens <heiko.carstens@de.ibm.com>
Date2016-01-20 11:20 +0100
SubjectRe: [PATCH 3/4] s390: enable text relative kallsyms for 64-bit targets
Message-ID<qSY1Q-4Y7-9@gated-at.bofh.it>
In reply to#1313052
On Wed, Jan 20, 2016 at 11:04:24AM +0100, Ard Biesheuvel wrote:
> On 20 January 2016 at 10:43, Heiko Carstens <heiko.carstens@de.ibm.com> wrote:
> > On Wed, Jan 20, 2016 at 10:05:37AM +0100, Ard Biesheuvel wrote:
> >> This enables the newly introduced text-relative kallsyms support when
> >> building 64-bit targets. This cuts the size of the kallsyms address
> >> table in half, reducing the memory footprint of the kernel .rodata
> >> section by about 250 KB for a defconfig build.
> >>
> >> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> >> ---
> >>
> >> diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
> >> index dbeeb3a049f2..588160fd1db0 100644
> >> --- a/arch/s390/Kconfig
> >> +++ b/arch/s390/Kconfig
> >> @@ -149,6 +149,7 @@ config S390
> >>       select HAVE_REGS_AND_STACK_ACCESS_API
> >>       select HAVE_SYSCALL_TRACEPOINTS
> >>       select HAVE_VIRT_CPU_ACCOUNTING
> >> +     select KALLSYMS_TEXT_RELATIVE if 64BIT
> >
> > Please remove the "if 64BIT" since s390 is always 64BIT in the meantime.
> > Tested on s390 and everything seems still to work ;)
> >
> > Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
> >
> 
> Thanks! Did you take a look at /proc/kallsyms, by any chance? It
> should look identical with and without these patches

Close to identical, since the generated code and offsets change a bit with
your new config option enabled and disabled. But only those parts that are
linked behind kernel/kallsyms.c.

However I did run a couple of ftrace, kprobes tests and enforced call
backtraces. Everything still works.

So it looks all good.

[toc] | [prev] | [next] | [standalone]


#1313058

FromArd Biesheuvel <ard.biesheuvel@linaro.org>
Date2016-01-20 11:20 +0100
Message-ID<qSY1Q-4Y7-19@gated-at.bofh.it>
In reply to#1313055
On 20 January 2016 at 11:17, Heiko Carstens <heiko.carstens@de.ibm.com> wrote:
> On Wed, Jan 20, 2016 at 11:04:24AM +0100, Ard Biesheuvel wrote:
>> On 20 January 2016 at 10:43, Heiko Carstens <heiko.carstens@de.ibm.com> wrote:
>> > On Wed, Jan 20, 2016 at 10:05:37AM +0100, Ard Biesheuvel wrote:
>> >> This enables the newly introduced text-relative kallsyms support when
>> >> building 64-bit targets. This cuts the size of the kallsyms address
>> >> table in half, reducing the memory footprint of the kernel .rodata
>> >> section by about 250 KB for a defconfig build.
>> >>
>> >> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>> >> ---
>> >>
>> >> diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
>> >> index dbeeb3a049f2..588160fd1db0 100644
>> >> --- a/arch/s390/Kconfig
>> >> +++ b/arch/s390/Kconfig
>> >> @@ -149,6 +149,7 @@ config S390
>> >>       select HAVE_REGS_AND_STACK_ACCESS_API
>> >>       select HAVE_SYSCALL_TRACEPOINTS
>> >>       select HAVE_VIRT_CPU_ACCOUNTING
>> >> +     select KALLSYMS_TEXT_RELATIVE if 64BIT
>> >
>> > Please remove the "if 64BIT" since s390 is always 64BIT in the meantime.
>> > Tested on s390 and everything seems still to work ;)
>> >
>> > Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>
>> >
>>
>> Thanks! Did you take a look at /proc/kallsyms, by any chance? It
>> should look identical with and without these patches
>
> Close to identical, since the generated code and offsets change a bit with
> your new config option enabled and disabled. But only those parts that are
> linked behind kernel/kallsyms.c.
>
> However I did run a couple of ftrace, kprobes tests and enforced call
> backtraces. Everything still works.
>
> So it looks all good.
>

Thanks a lot!

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web