NetBSD Problem Report #53830

From gson@gson.org  Thu Jan  3 11:05:39 2019
Return-Path: <gson@gson.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id BF5DF7A1A9
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  3 Jan 2019 11:05:39 +0000 (UTC)
Message-Id: <20190103110533.B880E989321@guava.gson.org>
Date: Thu,  3 Jan 2019 13:05:33 +0200 (EET)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: sparc64 install CD selects wrong root device under qemu-current
X-Send-Pr-Version: 3.95

>Number:         53830
>Category:       port-sparc64
>Synopsis:       sparc64 install CD selects wrong root device under qemu-current
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    martin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 03 11:10:00 +0000 2019
>Closed-Date:    Tue Jan 08 13:52:56 +0000 2019
>Last-Modified:  Tue Jan 08 13:55:00 +0000 2019
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current, source date >= 2017.09.15.13.27.53
>Organization:

>Environment:
System: NetBSD
Architecture: sparc64
Machine: sparc64
>Description:

Booting the sparc64 install ISO of NetBSD-current (2017.09.15.13.27.53
or newer) in a version of qemu recent enough to have commit
09d0c187aa4cce9b349f23724f50587a0014b33b fails with "cannot mount root":

   [   4.2043099] root on wd0a dumps on wd0b
   [   4.2043099] vfs_mountroot: can't open root device
   [   4.2043099] cannot mount root, error = 6
   [   4.2043099] root device (default wd0a): 

When using an older version of NetBSD and/or qemu, the correct root
device is identified and the boot succeeds:

    root on cd0a dumps on cd0b
    root file system type: cd9660

The NetBSD commit required for failure is:

   src/sys/arch/sparc64/sparc64/autoconf.c 1.213
   Fri Sep 15 13:27:53 2017 UTC by martin 

   If the bootloader passes us information about the boot device lun/target/
   and wwn, use those to properly match the boot device.
   If the new bootinfo is not available, fall back to the old heuristic
   trying to match the pathname of the boot device (which is ugly, firmware
   dependend and known to fail in some QEMU configurations).

and the qemu commit required for failure is:

   commit 09d0c187aa4cce9b349f23724f50587a0014b33b
   Author: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
   Date:   Fri Aug 31 12:19:07 2018 +0100

       Update OpenBIOS images to a1280807 built from submodule.

       Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

>How-To-Repeat:

For example, install qemu-3.1.0nb1 from pkgsrc and run:

   ftp http://www.gson.org/bugs/qemu/NetBSD-8.99.30-sparc64.iso
   qemu-img create wd0.img 1G
   qemu-system-sparc64 -nographic -drive file=wd0.img,media=disk -cdrom NetBSD-8.99.30-sparc64.iso -boot d

>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: port-sparc64-maintainer->martin
Responsible-Changed-By: martin@NetBSD.org
Responsible-Changed-When: Thu, 03 Jan 2019 15:17:32 +0000
Responsible-Changed-Why:
Take


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53830 CVS commit: src/sys/arch/sparc64/sparc64
Date: Fri, 4 Jan 2019 16:25:06 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Fri Jan  4 16:25:06 UTC 2019

 Modified Files:
 	src/sys/arch/sparc64/sparc64: autoconf.c

 Log Message:
 PR port-sparc64/53830: adapt QEMU workarounds to newer OpenBIOS device
 tree layout.


 To generate a diff of this commit:
 cvs rdiff -u -r1.213 -r1.214 src/sys/arch/sparc64/sparc64/autoconf.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: martin@NetBSD.org
State-Changed-When: Fri, 04 Jan 2019 16:34:07 +0000
State-Changed-Why:
Should work now - can you test too before I request pullup to -8 ?


From: Andreas Gustafsson <gson@gson.org>
To: martin@NetBSD.org
Cc: gnats-bugs@NetBSD.org
Subject: Re: port-sparc64/53830 (sparc64 install CD selects wrong root device under qemu-current)
Date: Fri, 4 Jan 2019 19:58:37 +0200

 martin@NetBSD.org wrote:
 > Should work now - can you test too before I request pullup to -8 ?

 Done - the install now succeeds using qemu 3.1.0.  Thank you!
 -- 
 Andreas Gustafsson, gson@gson.org

State-Changed-From-To: feedback->pending-pullups
State-Changed-By: gson@NetBSD.org
State-Changed-When: Sat, 05 Jan 2019 11:18:07 +0000
State-Changed-Why:
Feedback provided.


State-Changed-From-To: pending-pullups->needs-pullups
State-Changed-By: gson@NetBSD.org
State-Changed-When: Tue, 08 Jan 2019 13:09:54 +0000
State-Changed-Why:
I meant needs-pullups, not pending-pullups - no pullup request
has been submitted yet.


From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: Andreas Gustafsson <gson@gson.org>
Subject: Re: port-sparc64/53830 (sparc64 install CD selects wrong root device
 under qemu-current)
Date: Tue, 8 Jan 2019 14:34:15 +0100

 On Tue, Jan 08, 2019 at 01:09:54PM +0000, gson@NetBSD.org wrote:
 > I meant needs-pullups, not pending-pullups - no pullup request
 > has been submitted yet.

 I'm open to suggestion here - the pullup itself is not strictly necessary,
 as the bootloader extensions have not been pulled up to -8 either
 and this just works with latest qemu as long as you only emulate
 a single hard disk.

 However, with two hard disks you get the same old failure as with old
 qemu:

 0 > boot disk:a
 [..]
 NetBSD 8.0_STABLE (GENERIC) #0: Fri Jan  4 14:56:25 UTC 2019
         mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/sparc64/compile/GENERIC
 [..]
 No counter-timer -- using %tick at 100MHz as system clock.
 wd0 at atabus0 drive 0
 wd0: <QEMU HARDDISK>
 wd0: 1024 MB, 2080 cyl, 16 head, 63 sec, 512 bytes/sect x 2097152 sectors
 wd1 at atabus0 drive 1
 wd1: <QEMU HARDDISK>
 wd1: 1024 MB, 2080 cyl, 16 head, 63 sec, 512 bytes/sect x 2097152 sectors
 atapibus0 at atabus1: 2 targets
 cd0 at atapibus0 drive 0: <QEMU DVD-ROM, QM00003, 2.5+> cdrom removable
 WARNING: 1 error while detecting hardware; check system log.
 root on wd1a dumps on wd1b
 vfs_mountroot: can't open root device
 cannot mount root, error = 6

 If you like we can pull it all up, but this needs more testing first.

 Martin

From: Andreas Gustafsson <gson@gson.org>
To: Martin Husemann <martin@duskware.de>
Cc: gnats-bugs@NetBSD.org
Subject: Re: port-sparc64/53830 (sparc64 install CD selects wrong root device
 under qemu-current)
Date: Tue, 8 Jan 2019 15:47:51 +0200

 Martin Husemann wrote:
 > I'm open to suggestion here - the pullup itself is not strictly necessary,
 > as the bootloader extensions have not been pulled up to -8 either
 > and this just works with latest qemu as long as you only emulate
 > a single hard disk.
 > 
 > However, with two hard disks you get the same old failure as with old
 > qemu:
 [...]
 > If you like we can pull it all up, but this needs more testing first.

 Closing this without a pullup is fine by me, I only set it to needs-pullups
 because you said "can you test too before I request pullup to -8" earlier.
 -- 
 Andreas Gustafsson, gson@gson.org

State-Changed-From-To: needs-pullups->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Tue, 08 Jan 2019 13:52:56 +0000
State-Changed-Why:
Works in -current, -8 is not affected (but has older unresolved bugs)


From: Martin Husemann <martin@duskware.de>
To: Andreas Gustafsson <gson@gson.org>
Cc: gnats-bugs@NetBSD.org
Subject: Re: port-sparc64/53830 (sparc64 install CD selects wrong root device
 under qemu-current)
Date: Tue, 8 Jan 2019 14:51:23 +0100

 On Tue, Jan 08, 2019 at 03:47:51PM +0200, Andreas Gustafsson wrote:
 > Closing this without a pullup is fine by me, I only set it to needs-pullups
 > because you said "can you test too before I request pullup to -8" earlier.

 Yeah, I initially thought the booloader stuff would be in -8 too.

 Closing for now, we can revisit it when needed.

 Martin

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.