s390/startup: adjust _sdma and _edma to page boundaries
authorVasily Gorbik <gor@linux.ibm.com>
Thu, 15 Aug 2019 12:49:02 +0000 (14:49 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Wed, 21 Aug 2019 10:58:53 +0000 (12:58 +0200)
Move .dma.text section alignment out of section description, otherwise
zeros used to align the section are included in the section itself (and
section is not really aligned by itself).
$ objdump -h arch/s390/boot/compressed/vmlinux
  5 .dma.text     00001e38  000000000001b1c8  000000000001b1c8  0001c1c8  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  6 .dma.ex_table 00000018  000000000001d000  000000000001d000  0001e000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .dma.data     00000240  000000000001d080  000000000001d080  0001e080  2**7
                  CONTENTS, ALLOC, LOAD, DATA
$ cat /sys/kernel/debug/memblock/reserved
   0: 0x0000000000000000..0x0000000000011fff
   1: 0x000000000001b1c8..0x000000000001d2bf
...

Also add alignment before _edma linker symbol definition, so that entire
.dma* region is rounded up to page boundaries.
$ objdump -h arch/s390/boot/compressed/vmlinux
  5 .dma.text     00001000  000000000001c000  000000000001c000  0001d000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  6 .dma.ex_table 00000018  000000000001d000  000000000001d000  0001e000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .dma.data     00000240  000000000001d080  000000000001d080  0001e080  2**7
                  CONTENTS, ALLOC, LOAD, DATA
$ cat /sys/kernel/debug/memblock/reserved
   0: 0x0000000000000000..0x0000000000011fff
   1: 0x000000000001c000..0x000000000001dfff
...
$ cat /sys/kernel/debug/kernel_page_tables
---[ Identity Mapping ]---
0x0000000000000000-0x000000000001c000       112K PTE RW NX
0x000000000001c000-0x000000000001d000         4K PTE RO X
0x000000000001d000-0x0000000000100000       908K PTE RW NX
...

Reviewed-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
arch/s390/boot/compressed/vmlinux.lds.S

index 635217eb3d91b2326b05edb0a4c0fc9c87d8027a..44561b2c3712452bf3dcc50736cd88fb3cc081ee 100644 (file)
@@ -37,9 +37,9 @@ SECTIONS
        * .dma section for code, data, ex_table that need to stay below 2 GB,
        * even when the kernel is relocate: above 2 GB.
        */
+       . = ALIGN(PAGE_SIZE);
        _sdma = .;
        .dma.text : {
-               . = ALIGN(PAGE_SIZE);
                _stext_dma = .;
                *(.dma.text)
                . = ALIGN(PAGE_SIZE);
@@ -52,6 +52,7 @@ SECTIONS
                _stop_dma_ex_table = .;
        }
        .dma.data : { *(.dma.data) }
+       . = ALIGN(PAGE_SIZE);
        _edma = .;
 
        BOOT_DATA