From patchwork Fri Sep 15 09:37:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 140508 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1129370vqi; Fri, 15 Sep 2023 08:28:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEUHOFFjXsAO5CCrgSky3jiqSRqTCOK9HKAHFe4Bwe3+I3gSVjK2ZtLbP2TBroTNIrWJrsO X-Received: by 2002:a17:90a:128c:b0:263:3386:9da8 with SMTP id g12-20020a17090a128c00b0026333869da8mr1552502pja.49.1694791723697; Fri, 15 Sep 2023 08:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694791723; cv=none; d=google.com; s=arc-20160816; b=wAtp+KLYn6GXAw/S/QXfOrSAoSuRxvMUBb4OQKeOGvAyGLr6+pfT3IdqemZUbcds/K karkXYSgJLMMahtEfJd1W/rGtvHGORWvW07uBvaBxs42v/0h83SM5IAFdE8DfgD6KeAI V+OiOWzbJVfusHintpZUEA+MzHEkCOJDA4qnllshNaOBWR5A6vmIjZo0fzd3o9F6VUK7 9yL5USXq028oCPVlc/wr9exbFxc9a3LB5xPDcJBCV/+LBByy6kMqY5gQ5j3WbVsCB3Gf TkqJFNYD4GEQMTi/tps7Xhbs+VstOmPykRWncK+F9wfMYLITQuhME+b9G/LJjEPdQk4k R/dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=EE61iGjvOKaFn7fyLoxh9U79yxfabPeWqSVBImwLf1Y=; fh=Waxe6Rmpzd4JyC8xfe9tLlzkr215vze3+JXE0JQk96c=; b=CFOwVNoAc3OiYiIqp+eHjZ92w7b7DWY9AueWg5rfGcUZlfDSBoFJb5foO+8WFIq2CC N2pSXFiEMjHrc5YLZxpFoZ3K5ckR2k7jXWYgrneDFtBTpRqxzLLiK4bFmznHyoA9dkCc DCZpspSgJIOcWA7bjwg43GEBXFj8dyti8Vq5lmme1SoF26cW2vBr82TsBWR2hFRNywfF jCtQs7Ui76K6e6APclmVxJgOFvOX88RWZl1Cy/j/ytSEUWGLWEMBoflOxPtzIrE/SQTX wfluICvKKWRt0/Hm7q1nQDtOezrBDA7qqz25UdsOz7WrsNOIbspbehX4P9fGn17aPY2n k2IQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=TEkKyMW8; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id y22-20020a17090aa41600b0026b46704d43si3596177pjp.92.2023.09.15.08.28.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 08:28:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=TEkKyMW8; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 6289B80ACFDD; Fri, 15 Sep 2023 02:38:29 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233819AbjIOJiU (ORCPT + 32 others); Fri, 15 Sep 2023 05:38:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233775AbjIOJiQ (ORCPT ); Fri, 15 Sep 2023 05:38:16 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EFA12126; Fri, 15 Sep 2023 02:37:50 -0700 (PDT) Date: Fri, 15 Sep 2023 09:37:48 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1694770668; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EE61iGjvOKaFn7fyLoxh9U79yxfabPeWqSVBImwLf1Y=; b=TEkKyMW8lJb3p+u9pXpDP+X/w5SGKiCgsgCQ0wjZp1sHaTqmZCO5ilBU9RfgiRQ5/8jXOj IBYoG4vUrO1X6CY7lBtXAzlrLyzmork+zrY21nPdqMoDYrbJlnAFWGs7TwcSTt/ZzY3t7w dq5HrEUc99mH0a8XOzx5kaDL0y1Hl2ipJ+CAlhMUil4lVO1J0r1DzZTx6+Con7VoYWiemY 2T78SttPrhqjuLkC/r1X9AhrVxBpola1s08oI2iUl0vcspKCsVh03DWbKFbHenzgIUlFOH e8WGkRavjeITTQa8m0CTCTXOcPawJ0E/bq+4WZGS9qdvJ8viZZGH3O6kdjaRNA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1694770668; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EE61iGjvOKaFn7fyLoxh9U79yxfabPeWqSVBImwLf1Y=; b=kM38AQwzRKeIUKF/Y2EtQOv+vowAagaMreW78SfdjyP6y5w3v0hPALXMnbt4NDNk0YmF5V +EB1pFHytEo7M1Bg== From: "tip-bot2 for Ard Biesheuvel" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/boot] x86/boot: Remove the 'bugger off' message Cc: Ard Biesheuvel , Ingo Molnar , "H. Peter Anvin (Intel)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230912090051.4014114-21-ardb@google.com> References: <20230912090051.4014114-21-ardb@google.com> MIME-Version: 1.0 Message-ID: <169477066830.27769.10174123783303237568.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 15 Sep 2023 02:38:29 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776836043543920623 X-GMAIL-MSGID: 1777117926368855461 The following commit has been merged into the x86/boot branch of tip: Commit-ID: 768171d7ebbce005210e1cf8456f043304805c15 Gitweb: https://git.kernel.org/tip/768171d7ebbce005210e1cf8456f043304805c15 Author: Ard Biesheuvel AuthorDate: Tue, 12 Sep 2023 09:00:55 Committer: Ingo Molnar CommitterDate: Fri, 15 Sep 2023 11:18:41 +02:00 x86/boot: Remove the 'bugger off' message Ancient (pre-2003) x86 kernels could boot from a floppy disk straight from the BIOS, using a small real mode boot stub at the start of the image where the BIOS would expect the boot record (or boot block) to appear. Due to its limitations (kernel size < 1 MiB, no support for IDE, USB or El Torito floppy emulation), this support was dropped, and a Linux aware bootloader is now always required to boot the kernel from a legacy BIOS. To smoothen this transition, the boot stub was not removed entirely, but replaced with one that just prints an error message telling the user to install a bootloader. As it is unlikely that anyone doing direct floppy boot with such an ancient kernel is going to upgrade to v6.5+ and expect that this boot method still works, printing this message is kind of pointless, and so it should be possible to remove the logic that emits it. Let's free up this space so it can be used to expand the PE header in a subsequent patch. Signed-off-by: Ard Biesheuvel Signed-off-by: Ingo Molnar Acked-by: H. Peter Anvin (Intel) Link: https://lore.kernel.org/r/20230912090051.4014114-21-ardb@google.com --- arch/x86/boot/header.S | 49 +----------------------------------------- arch/x86/boot/setup.ld | 7 +++--- 2 files changed, 4 insertions(+), 52 deletions(-) diff --git a/arch/x86/boot/header.S b/arch/x86/boot/header.S index 8c8148d..b24fa50 100644 --- a/arch/x86/boot/header.S +++ b/arch/x86/boot/header.S @@ -38,64 +38,15 @@ SYSSEG = 0x1000 /* historical load address >> 4 */ .code16 .section ".bstext", "ax" - - .global bootsect_start -bootsect_start: #ifdef CONFIG_EFI_STUB # "MZ", MS-DOS header .word MZ_MAGIC -#endif - - # Normalize the start address - ljmp $BOOTSEG, $start2 - -start2: - movw %cs, %ax - movw %ax, %ds - movw %ax, %es - movw %ax, %ss - xorw %sp, %sp - sti - cld - - movw $bugger_off_msg, %si - -msg_loop: - lodsb - andb %al, %al - jz bs_die - movb $0xe, %ah - movw $7, %bx - int $0x10 - jmp msg_loop - -bs_die: - # Allow the user to press a key, then reboot - xorw %ax, %ax - int $0x16 - int $0x19 - - # int 0x19 should never return. In case it does anyway, - # invoke the BIOS reset code... - ljmp $0xf000,$0xfff0 - -#ifdef CONFIG_EFI_STUB .org 0x38 # # Offset to the PE header. # .long LINUX_PE_MAGIC .long pe_header -#endif /* CONFIG_EFI_STUB */ - - .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 - -#ifdef CONFIG_EFI_STUB pe_header: .long PE_MAGIC diff --git a/arch/x86/boot/setup.ld b/arch/x86/boot/setup.ld index 49546c2..b11c45b 100644 --- a/arch/x86/boot/setup.ld +++ b/arch/x86/boot/setup.ld @@ -10,10 +10,11 @@ ENTRY(_start) SECTIONS { . = 0; - .bstext : { *(.bstext) } - .bsdata : { *(.bsdata) } + .bstext : { + *(.bstext) + . = 495; + } =0xffffffff - . = 495; .header : { *(.header) } .entrytext : { *(.entrytext) } .inittext : { *(.inittext) }