Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4847068rdb; Fri, 15 Sep 2023 14:20:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEKtdh1xUw+lQQ7AdjgmSUTaQ2s10t0MYR5lEGQoyxa+QRHE/+onvtaxYodeYj0+T+eKCrS X-Received: by 2002:a05:6a20:7d96:b0:123:149b:a34f with SMTP id v22-20020a056a207d9600b00123149ba34fmr3166145pzj.1.1694812814672; Fri, 15 Sep 2023 14:20:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694812814; cv=none; d=google.com; s=arc-20160816; b=xUgJWZRKt426rQole8/eABR8JCoHtshbqVc6G8CE0+yjoF7jTl1T42/7+CJNigJ9CT kNR5PAf7BhqRkz4kI+LIx1Q6B/BJdc7UvUMsQ5Mb76R4WcsBG0siqLzwZKk7Gw/MVLqI NcsQl48QuWvwEAgnWUz6lNOorB9hhF2skUa/uLyCinZLZYgiXbRvsYqUCd3m/eYV9HhC oIwG2TXj3052M1NnVveEbnzaxp3yeKFjt8fG8mFb/R7AU3xnJmgD0Kz3PnJi6aXMrimK etl5wcPkHDItSTq5YKFbdscfbZHIFD7VE+ikTXY2ydo0bGnqYkYJUWVws0Ws/9XGloPj LZkg== 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 header.b=kM38AQwz; 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 Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id a2-20020a170902ecc200b001c446b59c8dsi742027plh.271.2023.09.15.14.20.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 14:20:14 -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 header.b=kM38AQwz; 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 0F9AA80ACFC9; Fri, 15 Sep 2023 02:38:20 -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 S233817AbjIOJiU (ORCPT + 99 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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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:20 -0700 (PDT) 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) }