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


Groups > linux.kernel > #1592195

Re: [PATCH v4 1/3] x86: Introduce a new constant KERNEL_MAPPING_SIZE

From Borislav Petkov <bp@suse.de>
Newsgroups linux.kernel
Subject Re: [PATCH v4 1/3] x86: Introduce a new constant KERNEL_MAPPING_SIZE
Date 2017-03-03 19:30 +0100
Message-ID <th07M-556-25@gated-at.bofh.it> (permalink)
References (5 earlier) <tgVrs-1O7-7@gated-at.bofh.it> <tgVrs-1O7-3@gated-at.bofh.it> <tgWnw-2po-11@gated-at.bofh.it> <tgX0e-2X9-21@gated-at.bofh.it> <tgX0e-2X9-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Ok,

TBH, I still don't like adding yet another define and paying attention
to whether I should use image size or mapping size. After your patch,
KERNEL_IMAGE_SIZE is used to enforce the actual image size from
exploding:

arch/x86/include/asm/page_32_types.h:43:#define KERNEL_IMAGE_SIZE       (512 * 1024 * 1024)
arch/x86/include/asm/page_32_types.h:49:#define KERNEL_MAPPING_SIZE     KERNEL_IMAGE_SIZE
arch/x86/include/asm/page_64_types.h:56:#define KERNEL_IMAGE_SIZE       (512 * 1024 * 1024)
arch/x86/include/asm/pgtable_32.h:83: *     (KERNEL_IMAGE_SIZE/4096) / 1024 pages (worst case, non PAE)
arch/x86/include/asm/pgtable_32.h:84: *     (KERNEL_IMAGE_SIZE/4096) / 512 + 4 pages (worst case for PAE)
arch/x86/include/asm/pgtable_32.h:91: * KERNEL_IMAGE_SIZE should be greater than pa(_end)
arch/x86/kernel/vmlinux.lds.S:356:. = ASSERT((_end - LOAD_OFFSET <= KERNEL_IMAGE_SIZE),
arch/x86/kernel/vmlinux.lds.S:357:         "kernel image bigger than KERNEL_IMAGE_SIZE");
arch/x86/kernel/vmlinux.lds.S:370:. = ASSERT((_end - _text <= KERNEL_IMAGE_SIZE),
arch/x86/kernel/vmlinux.lds.S:371:         "kernel image bigger than KERNEL_IMAGE_SIZE");

So what I'd do is keep KERNEL_IMAGE_SIZE and make it default 1G and use it
everywhere.

Then, define a separate define which is used only in vmlinux.lds.S to
enforce the size check. Having MAPPING_SIZE and IMAGE_SIZE is just
needlessly confusing.

Especially if this is just some inconsistency you're addressing and not
some real issue.

BUT(!), don't take my word for it. Rather, do what the maintainers
propose. Who knows, they might have a much better idea.

-- 
Regards/Gruss,
    Boris.

SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
-- 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v4 1/3] x86: Introduce a new constant KERNEL_MAPPING_SIZE Baoquan He <bhe@redhat.com> - 2017-03-03 13:10 +0100
  Re: [PATCH v4 1/3] x86: Introduce a new constant KERNEL_MAPPING_SIZE Baoquan He <bhe@redhat.com> - 2017-03-03 14:30 +0100
    Re: [PATCH v4 1/3] x86: Introduce a new constant KERNEL_MAPPING_SIZE Borislav Petkov <bp@suse.de> - 2017-03-03 15:30 +0100
      Re: [PATCH v4 1/3] x86: Introduce a new constant KERNEL_MAPPING_SIZE Baoquan He <bhe@redhat.com> - 2017-03-03 16:10 +0100
        Re: [PATCH v4 1/3] x86: Introduce a new constant KERNEL_MAPPING_SIZE Borislav Petkov <bp@suse.de> - 2017-03-03 19:30 +0100
          Re: [PATCH v4 1/3] x86: Introduce a new constant KERNEL_MAPPING_SIZE Baoquan He <bhe@redhat.com> - 2017-03-04 11:20 +0100
            Re: [PATCH v4 1/3] x86: Introduce a new constant KERNEL_MAPPING_SIZE Borislav Petkov <bp@suse.de> - 2017-03-04 13:00 +0100
              Re: [PATCH v4 1/3] x86: Introduce a new constant KERNEL_MAPPING_SIZE Baoquan He <bhe@redhat.com> - 2017-03-04 15:00 +0100
      Re: [PATCH v4 1/3] x86: Introduce a new constant KERNEL_MAPPING_SIZE Baoquan He <bhe@redhat.com> - 2017-03-03 16:10 +0100
  Re: [PATCH v4 1/3] x86: Introduce a new constant KERNEL_MAPPING_SIZE Baoquan He <bhe@redhat.com> - 2017-03-03 16:30 +0100
  Re: [PATCH v4 1/3] x86: Introduce a new constant KERNEL_MAPPING_SIZE Borislav Petkov <bp@suse.de> - 2017-03-03 17:00 +0100

csiph-web