From: Evgeniy Baskov <baskov@ispras.ru>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: Evgeniy Baskov <baskov@ispras.ru>, Borislav Petkov <bp@alien8.de>,
Andy Lutomirski <luto@kernel.org>,
Dave Hansen <dave.hansen@linux.intel.com>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Alexey Khoroshilov <khoroshilov@ispras.ru>,
Peter Jones <pjones@redhat.com>,
lvc-project@linuxtesting.org, x86@kernel.org,
linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-hardening@vger.kernel.org
Subject: [PATCH v2 17/23] x86/boot: Reduce size of the DOS stub
Date: Tue, 25 Oct 2022 17:12:55 +0300 [thread overview]
Message-ID: <2edb38e355437b1946e7fedcd4f5b4857a24be84.1666705333.git.baskov@ispras.ru> (raw)
In-Reply-To: <cover.1666705333.git.baskov@ispras.ru>
This is required to fit more sections in PE section tables,
since its size is restricted by zero page located at specific offset
after the PE header.
Signed-off-by: Evgeniy Baskov <baskov@ispras.ru>
---
| 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
--git a/arch/x86/boot/header.S b/arch/x86/boot/header.S
index f912d7770130..e4de831b2f64 100644
--- a/arch/x86/boot/header.S
+++ b/arch/x86/boot/header.S
@@ -59,17 +59,16 @@ start2:
cld
movw $bugger_off_msg, %si
+ movw $bugger_off_msg_size, %cx
msg_loop:
lodsb
- andb %al, %al
- jz bs_die
movb $0xe, %ah
movw $7, %bx
int $0x10
- jmp msg_loop
+ decw %cx
+ jnz msg_loop
-bs_die:
# Allow the user to press a key, then reboot
xorw %ax, %ax
int $0x16
@@ -89,10 +88,9 @@ bs_die:
.section ".bsdata", "a"
bugger_off_msg:
- .ascii "Use a boot loader.\r\n"
- .ascii "\n"
- .ascii "Remove disk and press any key to reboot...\r\n"
- .byte 0
+ .ascii "Use a boot loader. "
+ .ascii "Press a key to reboot"
+ .set bugger_off_msg_size, . - bugger_off_msg
#ifdef CONFIG_EFI_STUB
pe_header:
--
2.37.4
next prev parent reply other threads:[~2022-10-25 14:14 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-25 14:12 [PATCH v2 00/23] x86_64: Improvements at compressed kernel stage Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 01/23] x86/boot: Align vmlinuz sections on page size Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 02/23] x86/build: Remove RWX sections and align on 4KB Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 03/23] x86/boot: Set cr0 to known state in trampoline Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 04/23] x86/boot: Increase boot page table size Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 05/23] x86/boot: Support 4KB pages for identity mapping Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 06/23] x86/boot: Setup memory protection for bzImage code Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 07/23] x86/build: Check W^X of vmlinux during build Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 08/23] x86/boot: Map memory explicitly Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 09/23] x86/boot: Remove mapping from page fault handler Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 10/23] efi/libstub: Move helper function to related file Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 11/23] x86/boot: Make console interface more abstract Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 12/23] x86/boot: Make kernel_add_identity_map() a pointer Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 13/23] x86/boot: Split trampoline and pt init code Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 14/23] x86/boot: Add EFI kernel extraction interface Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 15/23] efi/x86: Support extracting kernel from libstub Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 16/23] x86/boot: Reduce lower limit of physical KASLR Evgeniy Baskov
2022-10-25 14:12 ` Evgeniy Baskov [this message]
2022-10-25 14:12 ` [PATCH v2 18/23] tools/include: Add simplified version of pe.h Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 19/23] x86/build: Cleanup tools/build.c Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 20/23] x86/build: Make generated PE more spec compliant Evgeniy Baskov
2022-10-25 14:12 ` [PATCH v2 21/23] efi/x86: Explicitly set sections memory attributes Evgeniy Baskov
2022-10-25 14:13 ` [PATCH v2 22/23] efi/libstub: Add memory attribute protocol definitions Evgeniy Baskov
2022-10-25 14:13 ` [PATCH v2 23/23] efi/libstub: Use memory attribute protocol Evgeniy Baskov
2022-11-04 18:21 ` [PATCH v2 00/23] x86_64: Improvements at compressed kernel stage Limonciello, Mario
2022-11-08 7:01 ` Evgeniy Baskov
2022-11-08 18:17 ` Limonciello, Mario
2022-11-08 23:49 ` Evgeniy Baskov
2022-11-20 1:49 ` joeyli
2022-11-20 15:37 ` Evgeniy Baskov
2022-11-21 9:42 ` joeyli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2edb38e355437b1946e7fedcd4f5b4857a24be84.1666705333.git.baskov@ispras.ru \
--to=baskov@ispras.ru \
--cc=ardb@kernel.org \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=khoroshilov@ispras.ru \
--cc=linux-efi@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=lvc-project@linuxtesting.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=pjones@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®