From nobody Tue Nov 26 12:31:28 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=kolpa.me ARC-Seal: i=1; a=rsa-sha256; t=1707401289; cv=none; d=zohomail.com; s=zohoarc; b=RZacd0Zqa0V7F/re4a1njCnYbzqExXFDO8R+zuDl/u//AGKrbSjmfrVZ/ypb4SP8faGMNqErEmIt3v3mBBefhWcpbxvOIfUG2DMAVnsCViZYcitmK8oYgbbCdtKGmlDJOXOQ+70GZKZZ2H9Dycp8M5N2rmTj1hCdK4XyRLvhgSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707401289; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=A0GJtQM9byRWqwr/UNXL/dr0YjOjdeS7cQERAt/3XBk=; b=BKXiRbVOxQ+K/v48HAaDYsWi6EUaGKNL6veMZ3nxjUdzhPGbJEvZH+RwPasUrZH/zxTYeMgwp5m1SW2R3e4zyIhKHpLp4C1TeyjQLN3iTOuo8whBRddmw2mSXkxFo0Vil8f8+6RlshXSw4r1y8HFVl7ImQJOfWV8VkHIhfFPVxI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1707401288615777.7012787242596; Thu, 8 Feb 2024 06:08:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rY53I-0004iQ-Az; Thu, 08 Feb 2024 09:06:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rY2Jq-00074Z-Ol for qemu-devel@nongnu.org; Thu, 08 Feb 2024 06:11:51 -0500 Received: from dane.soverin.net ([185.233.34.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rY2Jo-0001qI-5c for qemu-devel@nongnu.org; Thu, 08 Feb 2024 06:11:49 -0500 Received: from mail2.mijndomein.nl (unknown [10.10.4.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dane.soverin.net (Postfix) with ESMTPS id 4TVvSX10wwz2xW4; Thu, 8 Feb 2024 11:11:40 +0000 (UTC) Received: from mail2.mijndomein.nl (mail2.mijndomein.nl [10.10.4.133]) by mijndomein.nl (Postfix) with ESMTPSA id 4TVvSW3hDGzyP1; Thu, 8 Feb 2024 11:11:39 +0000 (UTC) Authentication-Results: mail2.mijndomein.nl; dkim=pass (2048-bit key; unprotected) header.d=kolpa.me header.i=@kolpa.me header.a=rsa-sha256 header.s=soverin1 header.b=ruzVELs3; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolpa.me; s=soverin1; t=1707390699; h=from:from: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; bh=A0GJtQM9byRWqwr/UNXL/dr0YjOjdeS7cQERAt/3XBk=; b=ruzVELs3sFXZw54H1K6Rvtkl213BiLOnS2yJmK9g13e5RfMAE/ATCxQDu+UUSaPhquVT9n 52s5z35cAkC5lL7E5jPJQ64OoU2lrTWoft4bwCIyEz6iOS86CarKgnsAM9FJzETt5/QkpY Mop5A48wnTxFfyUN+JqmCGWKECUao5dTu1opAt2PQEn9FFlsAizAz3S8sHF5LOjCe01MMA 57g6AiY8keShCMeHrq82cdypqdhl9kbD/14wWDrL2eAqyATCpnLihn7wVUxjp8PTpiexcG PgXewQkgNADaz8cS2P06sf2ylH7UC4QyFy1yQkTTGcH3RaV+cEtfLC06cM3Igw== Mime-Version: 1.0 Date: Thu, 08 Feb 2024 11:11:39 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-ID: <9939bfcd6fad908c21bbfb751a2896d7@email.mijndomein.nl> X-Soverin-Authenticated: true From: nathan@kolpa.me Subject: [PATCH] hw/i386: return an error message when mb magic/pvh note could not be found To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, richard.henderson@linaro.org, eduardo@habkost.net, mst@redhat.com, marcel.apfelbaum@gmail.com X-Priority: 3 (Normal) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=185.233.34.31; envelope-from=nathan@kolpa.me; helo=dane.soverin.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 08 Feb 2024 09:06:47 -0500 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @kolpa.me) X-ZM-MESSAGEID: 1707401290691100005 When using a non-linux kernel where the multiboot magic is misconfigured the following message would display: "linux kernel too old to= load a ram disk". This patch instead, displays a more descriptive error message: "could not f= ind multiboot magic or PVH ELF Note". The linux specific boot sequence is s= kipped because earlier it is asserted that the linux protocol magic field c= ould not be found. Signed-off-by: Nathan Kolpa --- hw/i386/x86.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 2b6291ad8d..b59f1180f5 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -902,7 +902,10 @@ void x86_load_linux(X86MachineState *x86ms, =20 return; } - protocol =3D 0; + + fprintf(stderr, "qemu: could not find multiboot magic or " + "PVH ELF Note.\n"); + exit(1); } =20 if (protocol < 0x200 || !(header[0x211] & 0x01)) { --=20 2.43.0