Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37498C6FD1C for ; Sat, 11 Mar 2023 14:49:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230093AbjCKOt3 (ORCPT ); Sat, 11 Mar 2023 09:49:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230129AbjCKOtY (ORCPT ); Sat, 11 Mar 2023 09:49:24 -0500 Received: from mail.ispras.ru (mail.ispras.ru [83.149.199.84]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57C0510F85B; Sat, 11 Mar 2023 06:49:21 -0800 (PST) Received: from mail.ispras.ru (unknown [83.149.199.84]) by mail.ispras.ru (Postfix) with ESMTPSA id 8D5F940737C5; Sat, 11 Mar 2023 14:49:19 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 8D5F940737C5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ispras.ru; s=default; t=1678546159; bh=bXR0wVthFGOHXm8iZRJxzhw/jF3u2+uvzl6NREjvGaw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Yq1XRrO+G6JtjEfebIJeemsQswU3CCcPVpg31TCH2G0DfVJNRxHlxrCKebcdJXk+P VmYoidNqAj38GNnR/osfd5mHkmAoEnwP4WOzDN6Lz4ze75I/34Af5z74mc5muVgz+D imVX53ONtFKipc0oeX0dpCZn7GmtgysKntbGCFE8= MIME-Version: 1.0 Date: Sat, 11 Mar 2023 17:49:19 +0300 From: Evgeniy Baskov To: Ard Biesheuvel Cc: Borislav Petkov , Andy Lutomirski , Dave Hansen , Ingo Molnar , Peter Zijlstra , Thomas Gleixner , Alexey Khoroshilov , Peter Jones , "Limonciello, Mario" , joeyli , lvc-project@linuxtesting.org, x86@kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v4 17/26] x86/boot: Reduce size of the DOS stub In-Reply-To: References: User-Agent: Roundcube Webmail/1.4.4 Message-ID: X-Sender: baskov@ispras.ru Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-03-10 17:59, Ard Biesheuvel wrote: > On Thu, 15 Dec 2022 at 13:40, Evgeniy Baskov 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 >> Tested-by: Peter Jones >> Signed-off-by: Evgeniy Baskov > > 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 >>