<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/include/asm/boot.h, branch linux-4.8.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.8.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.8.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2016-05-07T05:38:39Z</updated>
<entry>
<title>x86/KASLR: Build identity mappings on demand</title>
<updated>2016-05-07T05:38:39Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2016-05-06T22:01:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3a94707d7a7bb1eb82acae5fbc035247dd1ba8a5'/>
<id>urn:sha1:3a94707d7a7bb1eb82acae5fbc035247dd1ba8a5</id>
<content type='text'>
Currently KASLR only supports relocation in a small physical range (from
16M to 1G), due to using the initial kernel page table identity mapping.
To support ranges above this, we need to have an identity mapping for the
desired memory range before we can decompress (and later run) the kernel.

32-bit kernels already have the needed identity mapping. This patch adds
identity mappings for the needed memory ranges on 64-bit kernels. This
happens in two possible boot paths:

If loaded via startup_32(), we need to set up the needed identity map.

If loaded from a 64-bit bootloader, the bootloader will have already
set up an identity mapping, and we'll start via the compressed kernel's
startup_64(). In this case, the bootloader's page tables need to be
avoided while selecting the new uncompressed kernel location. If not,
the decompressor could overwrite them during decompression.

To accomplish this, we could walk the pagetable and find every page
that is used, and add them to mem_avoid, but this needs extra code and
will require increasing the size of the mem_avoid array.

Instead, we can create a new set of page tables for our own identity
mapping instead. The pages for the new page table will come from the
_pagetable section of the compressed kernel, which means they are
already contained by in mem_avoid array. To do this, we reuse the code
from the uncompressed kernel's identity mapping routines.

The _pgtable will be shared by both the 32-bit and 64-bit paths to reduce
init_size, as now the compressed kernel's _rodata to _end will contribute
to init_size.

To handle the possible mappings, we need to increase the existing page
table buffer size:

When booting via startup_64(), we need to cover the old VO, params,
cmdline and uncompressed kernel. In an extreme case we could have them
all beyond the 512G boundary, which needs (2+2)*4 pages with 2M mappings.
And we'll need 2 for first 2M for VGA RAM. One more is needed for level4.
This gets us to 19 pages total.

When booting via startup_32(), KASLR could move the uncompressed kernel
above 4G, so we need to create extra identity mappings, which should only
need (2+2) pages at most when it is beyond the 512G boundary. So 19
pages is sufficient for this case as well.

The resulting BOOT_*PGT_SIZE defines use the "_SIZE" suffix on their
names to maintain logical consistency with the existing BOOT_HEAP_SIZE
and BOOT_STACK_SIZE defines.

This patch is based on earlier patches from Yinghai Lu and Baoquan He.

Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Baoquan He &lt;bhe@redhat.com&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Dave Young &lt;dyoung@redhat.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Jiri Kosina &lt;jkosina@suse.cz&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Cc: Yinghai Lu &lt;yinghai@kernel.org&gt;
Cc: kernel-hardening@lists.openwall.com
Cc: lasse.collin@tukaani.org
Link: http://lkml.kernel.org/r/1462572095-11754-4-git-send-email-keescook@chromium.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>x86/boot: Clean up indenting for asm/boot.h</title>
<updated>2016-05-07T05:38:39Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2016-05-06T22:01:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8665e6ff2107204f981ba8f9ee37085a003fc9e9'/>
<id>urn:sha1:8665e6ff2107204f981ba8f9ee37085a003fc9e9</id>
<content type='text'>
Before adding more defines to asm/boot.h, this cleans up the existing
indenting for readability.

Suggested-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Andy Lutomirski &lt;luto@kernel.org&gt;
Cc: Baoquan He &lt;bhe@redhat.com&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Borislav Petkov &lt;bp@suse.de&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Dave Young &lt;dyoung@redhat.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Cc: Yinghai Lu &lt;yinghai@kernel.org&gt;
Cc: kernel-hardening@lists.openwall.com
Cc: lasse.collin@tukaani.org
Link: http://lkml.kernel.org/r/1462572095-11754-2-git-send-email-keescook@chromium.org
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>x86/boot: Double BOOT_HEAP_SIZE to 64KB</title>
<updated>2016-01-11T11:30:50Z</updated>
<author>
<name>H.J. Lu</name>
</author>
<published>2016-01-04T18:17:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8c31902cffc4d716450be549c66a67a8a3dd479c'/>
<id>urn:sha1:8c31902cffc4d716450be549c66a67a8a3dd479c</id>
<content type='text'>
When decompressing kernel image during x86 bootup, malloc memory
for ELF program headers may run out of heap space, which leads
to system halt.  This patch doubles BOOT_HEAP_SIZE to 64KB.

Tested with 32-bit kernel which failed to boot without this patch.

Signed-off-by: H.J. Lu &lt;hjl.tools@gmail.com&gt;
Acked-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: Andy Lutomirski &lt;luto@amacapital.net&gt;
Cc: Borislav Petkov &lt;bp@alien8.de&gt;
Cc: Brian Gerst &lt;brgerst@gmail.com&gt;
Cc: Denys Vlasenko &lt;dvlasenk@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: linux-kernel@vger.kernel.org
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>UAPI: (Scripted) Disintegrate arch/x86/include/asm</title>
<updated>2012-12-14T22:37:13Z</updated>
<author>
<name>David Howells</name>
</author>
<published>2012-12-14T22:37:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=af170c5061dd78512c469e6e2d211980cdb2c193'/>
<id>urn:sha1:af170c5061dd78512c469e6e2d211980cdb2c193</id>
<content type='text'>
Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Acked-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Acked-by: Michael Kerrisk &lt;mtk.manpages@gmail.com&gt;
Acked-by: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Acked-by: Dave Jones &lt;davej@redhat.com&gt;
</content>
</entry>
<entry>
<title>x86: Use common threadinfo allocator</title>
<updated>2012-05-08T12:08:44Z</updated>
<author>
<name>Thomas Gleixner</name>
</author>
<published>2012-05-05T15:05:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=38e7c572ce7310def003d8bb7c34260f5d8118cb'/>
<id>urn:sha1:38e7c572ce7310def003d8bb7c34260f5d8118cb</id>
<content type='text'>
The only difference is the free_thread_info function, which frees
xstate.

Use the new arch_release_task_struct() function instead and switch
over to the core allocator.

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/20120505150141.559556763@linutronix.de
Cc: x86@kernel.org
</content>
</entry>
<entry>
<title>x86: support XZ-compressed kernel</title>
<updated>2011-01-13T16:03:25Z</updated>
<author>
<name>Lasse Collin</name>
</author>
<published>2011-01-13T01:01:24Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=303148045aac34b70db722a54e5ad94a3a6625c6'/>
<id>urn:sha1:303148045aac34b70db722a54e5ad94a3a6625c6</id>
<content type='text'>
This integrates the XZ decompression code to the x86 pre-boot code.

mkpiggy.c is updated to reserve about 32 KiB more buffer safety margin for
kernel decompression.  It is done unconditionally for all decompressors to
keep the code simpler.

The XZ decompressor needs around 30 KiB of heap, so the heap size is
increased to 32 KiB on both x86-32 and x86-64.

Documentation/x86/boot.txt is updated to list the XZ magic number.

With the x86 BCJ filter in XZ, XZ-compressed x86 kernel tends to be a few
percent smaller than the equivalent LZMA-compressed kernel.

Signed-off-by: Lasse Collin &lt;lasse.collin@tukaani.org&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Alain Knaff &lt;alain@knaff.lu&gt;
Cc: Albin Tonnerre &lt;albin.tonnerre@free-electrons.com&gt;
Cc: Phillip Lougher &lt;phillip@lougher.demon.co.uk&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>x86: Clean up arch/x86/Kconfig*</title>
<updated>2010-04-29T00:25:53Z</updated>
<author>
<name>Jan Beulich</name>
</author>
<published>2010-04-21T14:23:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6fc108a08dcddf8f9113cc7102ddaacf7ed37a6b'/>
<id>urn:sha1:6fc108a08dcddf8f9113cc7102ddaacf7ed37a6b</id>
<content type='text'>
No functional change intended.

Signed-off-by: Jan Beulich &lt;jbeulich@novell.com&gt;
LKML-Reference: &lt;4BCF2690020000780003B340@vpn.id2.novell.com&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
</content>
</entry>
<entry>
<title>x86, setup: correct include file in &lt;asm/boot.h&gt;</title>
<updated>2009-06-25T22:16:06Z</updated>
<author>
<name>H. Peter Anvin</name>
</author>
<published>2009-06-25T22:16:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=658dbfeb5e7ab35d440c665d643a6285e43fddcd'/>
<id>urn:sha1:658dbfeb5e7ab35d440c665d643a6285e43fddcd</id>
<content type='text'>
&lt;asm/boot.h&gt; needs &lt;asm/pgtable_types.h&gt;, not &lt;asm/page_types.h&gt; in
order to resolve PMD_SHIFT.  Also, correct a +1 which really should be
+ THREAD_ORDER.

This is a build error which was masked by a typoed #ifdef.

Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
</content>
</entry>
<entry>
<title>x86, setup: Fix typo "CONFIG_x86_64" in &lt;asm/boot.h&gt;</title>
<updated>2009-06-25T20:33:11Z</updated>
<author>
<name>Robert P. J. Day</name>
</author>
<published>2009-06-25T20:20:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=22f4319d6bc0155e6c0ae560729baa6c09dc09e7'/>
<id>urn:sha1:22f4319d6bc0155e6c0ae560729baa6c09dc09e7</id>
<content type='text'>
CONFIG_X86_64 was misspelled (wrong case), which caused the x86-64
kernel to advertise itself as more relocatable than it really is.
This could in theory cause boot failures once bootloaders start
support the new relocation fields.

Signed-off-by: Robert P. J. Day &lt;rpjday@crashcourse.ca&gt;
Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
</content>
</entry>
<entry>
<title>x86, boot: make kernel_alignment adjustable; new bzImage fields</title>
<updated>2009-05-12T00:44:39Z</updated>
<author>
<name>H. Peter Anvin</name>
</author>
<published>2009-05-11T22:56:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=37ba7ab5e33cebc25c68fffe33e9f21e7c2014e8'/>
<id>urn:sha1:37ba7ab5e33cebc25c68fffe33e9f21e7c2014e8</id>
<content type='text'>
Make the kernel_alignment field adjustable; this allows us to set it
to a large value (intended to be 16 MB to avoid ZONE_DMA contention,
memory holes and other weirdness) while a smart bootloader can still
force a loading at a lesser alignment if absolutely necessary.

Also export pref_address (preferred loading address, corresponding to
the link-time address) and init_size, the total amount of linear
memory the kernel will require during initialization.

[ Impact: allows better kernel placement, gives bootloader more info ]

Signed-off-by: H. Peter Anvin &lt;hpa@zytor.com&gt;
</content>
</entry>
</feed>
