From nobody Sat Oct 25 21:45:33 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521178943841479.1857784946212; Thu, 15 Mar 2018 22:42:23 -0700 (PDT) Received: from localhost ([::1]:55095 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewi86-0006mp-1z for importer@patchew.org; Fri, 16 Mar 2018 01:42:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55388) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewi6D-0005b8-12 for qemu-devel@nongnu.org; Fri, 16 Mar 2018 01:40:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewi6C-0003Bw-3F for qemu-devel@nongnu.org; Fri, 16 Mar 2018 01:40:17 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:52782 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ewi67-00035s-Kp; Fri, 16 Mar 2018 01:40:11 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E0AA840201A3; Fri, 16 Mar 2018 05:40:07 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BA38215CDAF; Fri, 16 Mar 2018 05:40:05 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Fri, 16 Mar 2018 06:39:53 +0100 Message-Id: <1521178795-21894-2-git-send-email-thuth@redhat.com> In-Reply-To: <1521178795-21894-1-git-send-email-thuth@redhat.com> References: <1521178795-21894-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 16 Mar 2018 05:40:07 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 16 Mar 2018 05:40:07 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH v2 1/3] tests/boot-sector: Add magic bytes to s390x boot code header X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Victor Kaplansky , qemu-block@nongnu.org, "Michael S. Tsirkin" , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-s390x@nongnu.org, =?UTF-8?q?Herv=C3=A9=20Poussineau?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We're going to use the s390x boot code for testing CD-ROM booting. But the ISO loader of the s390-ccw bios is a little bit more picky than the network loader and expects some magic bytes in the header of the file (see linux_s390_magic in pc-bios/s390-ccw/bootmap.c), so we've got to add them in our boot code here, too. Reviewed-by: Christian Borntraeger Signed-off-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- tests/boot-sector.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/boot-sector.c b/tests/boot-sector.c index c373f0e..7824286 100644 --- a/tests/boot-sector.c +++ b/tests/boot-sector.c @@ -68,8 +68,11 @@ static uint8_t x86_boot_sector[512] =3D { }; =20 /* For s390x, use a mini "kernel" with the appropriate signature */ -static const uint8_t s390x_psw[] =3D { - 0x00, 0x08, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00 +static const uint8_t s390x_psw_and_magic[] =3D { + 0x00, 0x08, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, /* Program status wor= d */ + 0x02, 0x00, 0x00, 0x18, 0x60, 0x00, 0x00, 0x50, /* Magic: = */ + 0x02, 0x00, 0x00, 0x68, 0x60, 0x00, 0x00, 0x50, /* see linux_s390_mag= ic */ + 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40 /* in the s390-ccw bi= os */ }; static const uint8_t s390x_code[] =3D { 0xa7, 0xf4, 0x00, 0x0a, /* j 0x10010 */ @@ -110,7 +113,7 @@ int boot_sector_init(char *fname) } else if (g_str_equal(arch, "s390x")) { len =3D 0x10000 + sizeof(s390x_code); boot_code =3D g_malloc0(len); - memcpy(boot_code, s390x_psw, sizeof(s390x_psw)); + memcpy(boot_code, s390x_psw_and_magic, sizeof(s390x_psw_and_magic)= ); memcpy(&boot_code[0x10000], s390x_code, sizeof(s390x_code)); } else { g_assert_not_reached(); --=20 1.8.3.1