Message ID | cb62472011a0c4151276b6a05b83b60b1bf6f352.1671098103.git.baskov@ispras.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp328055wrn; Thu, 15 Dec 2022 04:44:13 -0800 (PST) X-Google-Smtp-Source: AA0mqf7onzg5RUiKaYrOU6kmPgefwpOKZytPYWTvG09jqBa1i2Q27qJhhbu0qkuU0hP2gQ5V3xKf X-Received: by 2002:a17:906:d8b7:b0:7c4:f752:e959 with SMTP id qc23-20020a170906d8b700b007c4f752e959mr3893142ejb.33.1671108253059; Thu, 15 Dec 2022 04:44:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671108253; cv=none; d=google.com; s=arc-20160816; b=Lo2hDCpF1jagJZ/IzLaLEJT83joKYrqD4NqkJTvSOi1+oL0ULJbBQPhSItttrf7jon 9eE6sN5hWIvjKFgoepk+AeD4UCi1EaFd1POuk0RPf04XfFewSOQeFUJmqWD5iHt1A+2V sz+WwNIiKkprq6OLMqxjUE8L7aYIxvu+zG+JefoVCFtHB/EuFBjuOVjCW+9UFz67kubu wIuVPTBIEF9AMTrII7kf7nPdCWGpxW4NQrh5PDPhxWnyGmS7cX/7oajQhrlugSjANRMz i9lwsG952CCyks9AdMITuhfaCir/8mM+eTE/Z3NO8Fpo4YFp7visrnAYiiuZFGKwh9E4 /uQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=qQtYT34Nan6gkSonGyD+MDz80X5GRCr49QTdaEtziC0=; b=dMwBDfZr3ekomJHgdGqyakVJddfs22dQSNqxZyHcRjc172PH42GEoCg/1rKRMFpzoi x/W51RruK/KNMIirFVHtcBdXPgMW4dF0ncx+y8WB7VADDpK6VOBLS7OuhJ9jjqjWwUhh GJztO8d3JdRMkqwkMCQdWGgi+gl+PbVzgmm8lOgPfOU6G2pkbVYlOZHGwEfH80c3ydGh LaNzSa8jwTmVSTzBFgcMeLuBo5YlmfdhHarp6jQK4cWSHOUCKLEE7UhRUgHJAodcl95O Zohf2CFTC3y8U/8ALc2tfJ7P8RNJxv/xNirGZjMbb56ZV61P1z1Vw7tBvnf5w+LB5xaj hkEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=izHOb1pB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go7-20020a1709070d8700b007b874abc9b6si15654376ejc.790.2022.12.15.04.43.49; Thu, 15 Dec 2022 04:44:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ispras.ru header.s=default header.b=izHOb1pB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ispras.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229908AbiLOMmn (ORCPT <rfc822;jeantsuru.cumc.mandola@gmail.com> + 99 others); Thu, 15 Dec 2022 07:42:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229918AbiLOMl2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 15 Dec 2022 07:41:28 -0500 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FDF12F02E; Thu, 15 Dec 2022 04:40:28 -0800 (PST) Received: from localhost.localdomain (unknown [83.149.199.65]) by mail.ispras.ru (Postfix) with ESMTPSA id 50B4A40737A4; Thu, 15 Dec 2022 12:40:25 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 50B4A40737A4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1671108025; bh=qQtYT34Nan6gkSonGyD+MDz80X5GRCr49QTdaEtziC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=izHOb1pB6ni2VyJVMRfTBCce4P5MOQ6F5K6FKoMkg/PhsZwXw1gEm23Adk0aeQCfu MdBtw9M+EEldUmGHNenxAmItWlGkwnHrHCHlDnASTBXmt4Yljvgg3jMAz45w7/KpBi SewGNmcPEZSIPOSQea3gHks6SIb9i3yQtdsQcXSw= 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>, "Limonciello, Mario" <mario.limonciello@amd.com>, joeyli <jlee@suse.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 v4 17/26] x86/boot: Reduce size of the DOS stub Date: Thu, 15 Dec 2022 15:38:08 +0300 Message-Id: <cb62472011a0c4151276b6a05b83b60b1bf6f352.1671098103.git.baskov@ispras.ru> X-Mailer: git-send-email 2.37.4 In-Reply-To: <cover.1671098103.git.baskov@ispras.ru> References: <cover.1671098103.git.baskov@ispras.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752284007290146345?= X-GMAIL-MSGID: =?utf-8?q?1752284007290146345?= |
Series |
x86_64: Improvements at compressed kernel stage
|
|
Commit Message
Evgeniy Baskov
Dec. 15, 2022, 12:38 p.m. UTC
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. Tested-by: Mario Limonciello <mario.limonciello@amd.com> Tested-by: Peter Jones <pjones@redhat.com> Signed-off-by: Evgeniy Baskov <baskov@ispras.ru> --- arch/x86/boot/header.S | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
Comments
On Thu, 15 Dec 2022 at 13:40, Evgeniy Baskov <baskov@ispras.ru> wrote: > > 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. > > Tested-by: Mario Limonciello <mario.limonciello@amd.com> > Tested-by: Peter Jones <pjones@redhat.com> > Signed-off-by: Evgeniy Baskov <baskov@ispras.ru> I'd prefer to rip this out altogether. https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/commit/?id=9510f6f04f579b9a3f54ad762c75ab2d905e37d8 (and refer to the other thread in linux-efi@) > --- > arch/x86/boot/header.S | 14 ++++++-------- > 1 file changed, 6 insertions(+), 8 deletions(-) > > diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S > index 9338c68e7413..9fec80bc504b 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 > @@ -90,10 +89,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 >
On 2023-03-10 17:59, Ard Biesheuvel wrote: > On Thu, 15 Dec 2022 at 13:40, Evgeniy Baskov <baskov@ispras.ru> wrote: >> >> 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. >> >> Tested-by: Mario Limonciello <mario.limonciello@amd.com> >> Tested-by: Peter Jones <pjones@redhat.com> >> Signed-off-by: Evgeniy Baskov <baskov@ispras.ru> > > I'd prefer to rip this out altogether. > > https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/commit/?id=9510f6f04f579b9a3f54ad762c75ab2d905e37d8 Sounds great! Can I replace this patch with yours in v5? > > (and refer to the other thread in linux-efi@) Which thread exactly? The one about the removal of real-mode code? > >> --- >> arch/x86/boot/header.S | 14 ++++++-------- >> 1 file changed, 6 insertions(+), 8 deletions(-) >> >> diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S >> index 9338c68e7413..9fec80bc504b 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 >> @@ -90,10 +89,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 >>
On Sat, 11 Mar 2023 at 15:49, Evgeniy Baskov <baskov@ispras.ru> wrote: > > On 2023-03-10 17:59, Ard Biesheuvel wrote: > > On Thu, 15 Dec 2022 at 13:40, Evgeniy Baskov <baskov@ispras.ru> wrote: > >> > >> 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. > >> > >> Tested-by: Mario Limonciello <mario.limonciello@amd.com> > >> Tested-by: Peter Jones <pjones@redhat.com> > >> Signed-off-by: Evgeniy Baskov <baskov@ispras.ru> > > > > I'd prefer to rip this out altogether. > > > > https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/commit/?id=9510f6f04f579b9a3f54ad762c75ab2d905e37d8 > > Sounds great! Can I replace this patch with yours in v5? > Of course. > > > > (and refer to the other thread in linux-efi@) > > Which thread exactly? The one about the removal of > real-mode code? > Yes, this one https://lore.kernel.org/linux-efi/20230308202209.2980947-1-ardb@kernel.org/
On 2023-03-11 20:27, Ard Biesheuvel wrote: > On Sat, 11 Mar 2023 at 15:49, Evgeniy Baskov <baskov@ispras.ru> wrote: >> >> On 2023-03-10 17:59, Ard Biesheuvel wrote: >> > On Thu, 15 Dec 2022 at 13:40, Evgeniy Baskov <baskov@ispras.ru> wrote: >> >> >> >> 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. >> >> >> >> Tested-by: Mario Limonciello <mario.limonciello@amd.com> >> >> Tested-by: Peter Jones <pjones@redhat.com> >> >> Signed-off-by: Evgeniy Baskov <baskov@ispras.ru> >> > >> > I'd prefer to rip this out altogether. >> > >> > https://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git/commit/?id=9510f6f04f579b9a3f54ad762c75ab2d905e37d8 >> >> Sounds great! Can I replace this patch with yours in v5? >> > > Of course. > >> > >> > (and refer to the other thread in linux-efi@) >> >> Which thread exactly? The one about the removal of >> real-mode code? >> > > Yes, this one > > https://lore.kernel.org/linux-efi/20230308202209.2980947-1-ardb@kernel.org/ Thanks!
diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S index 9338c68e7413..9fec80bc504b 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 @@ -90,10 +89,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: