NetBSD Problem Report #48770

From www@NetBSD.org  Tue Apr 29 15:06:32 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 9B67CA5818
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 29 Apr 2014 15:06:32 +0000 (UTC)
Message-Id: <20140429150631.0C7AAA5847@mollari.NetBSD.org>
Date: Tue, 29 Apr 2014 15:06:31 +0000 (UTC)
From: netbsd@precedence.co.uk
Reply-To: netbsd@precedence.co.uk
To: gnats-bugs@NetBSD.org
Subject: XenServer 6.2 cannot boot NetBSD 5, 6 or -current as HVM
X-Send-Pr-Version: www-1.0

>Number:         48770
>Category:       kern
>Synopsis:       XenServer 6.2 cannot boot NetBSD 5, 6 or -current as HVM
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 29 15:10:00 +0000 2014
>Closed-Date:    Wed Jan 14 09:50:30 +0000 2015
>Last-Modified:  Wed Jan 14 09:50:30 +0000 2015
>Originator:     Stephen Borrill
>Release:        NetBSD-current 29/4/14
>Organization:
>Environment:
n/a
>Description:
Trying to boot any supported version of NetBSD as an HVM domU on XenServer 6.2 fails due to a 'ghost' hard drive:

wd1 at atabus1 drive 0
wd1: <ST506>
wd1: 69632 KB, 1024 cyl, 8 head, 17 sec, 512 bytes/sect x 139264 sectors
wdc1:0:0: lost interrupt
        type: ata tc_bcount: 512 tc_skip:0
wd1d: device timeout reading fsbn 0 (wd1 bn 0; cn 0 tn 0 sn 0), retrying

Last 2 lines repeat.

Rogue device is actually the virtual CD drive (but appearing as wd device with incorrect geometry). Geometry is same even if virtual CD drive is empty.

Deleting the virtual CD device will stop the hang, but means you can't use the CD to install the OS, of course. Should be OK for OS installed previously:

root@xenserver1 ~]# xe vbd-list vm-uuid=c1352fd1-b3d8-799b-1b84-9aa0d69bf317 device=hdd
uuid ( RO)             : dbb6f49e-9b47-03fc-fd41-460bc03626e8
          vm-uuid ( RO): c1352fd1-b3d8-799b-1b84-9aa0d69bf317
    vm-name-label ( RO): test NetBSD
         vdi-uuid ( RO): <not in database>
            empty ( RO): true
           device ( RO): hdd


[root@xenserver1 ~]# xe vbd-destroy uuid=dbb6f49e-9b47-03fc-fd41-460bc03626e8

>How-To-Repeat:
Boot from a release CD iso image on XenServer 6.2 (free)
>Fix:

>Release-Note:

>Audit-Trail:
From: Quentin Garnier <cube@cubidou.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: re: kern/48770
Date: Thu, 1 May 2014 19:12:45 +0000

 Hi Stephen,

 This is the same issue as kern/45671.  The fact that you don't get the
 CD-ROM device is actually the least of your trouble :-)  I don't know
 why (or if) an atapi device can attach to wdc@isa, but in any case the
 real issue is that you get wdc@isa, and that's because you don't get
 anything on the PCI bus (see kern/45671).

 The workaround for 45671 doesn't apply to a Xen HVM (because the actual
 CPU is seen).  I think it'd be better to use pmf_get_platform to check
 if "system-vendor" is "Xen" and "system-product" is "HVM domU" because
 that's what you get on XenServer 6.2 according to my dmesg(8) output.

 As a workaround, you can boot the install media with:

 boot netbsd -d

 And then at the ddb prompt, do:

 write pci_mode 1

 And then build a custom kernel with:

 options PCI_CONF_MODE=1

 -- 
 Quentin Garnier - cube@cubidou.net
 "See the look on my face from staying too long in one place
 [...] every time the morning breaks I know I'm closer to falling"
 KT Tunstall, Saving My Face, Drastic Fantastic, 2007.

From: Quentin Garnier <cube@cubidou.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/48770
Date: Thu, 1 May 2014 23:04:41 +0000

 On Thu, May 01, 2014 at 07:12:45PM +0000, Quentin Garnier wrote:
 > The workaround for 45671 doesn't apply to a Xen HVM (because the actual
 > CPU is seen).  I think it'd be better to use pmf_get_platform to check
 > if "system-vendor" is "Xen" and "system-product" is "HVM domU" because
 > that's what you get on XenServer 6.2 according to my dmesg(8) output.

 This should do it.  A test for the version can be added if necessary.

 Index: pci_machdep.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/x86/pci/pci_machdep.c,v
 retrieving revision 1.65
 diff -u -u -r1.65 pci_machdep.c
 --- pci_machdep.c       27 Jan 2014 23:11:50 -0000      1.65
 +++ pci_machdep.c       1 May 2014 23:02:56 -0000
 @@ -555,7 +555,9 @@
                         return (pci_mode);
                 }
         }
 -        if (memcmp(cpu_brand_string, "QEMU", 4) == 0) {
 +        if (memcmp(cpu_brand_string, "QEMU", 4) == 0 ||
 +           (!strcmp(pmf_get_platform("system-vendor"), "Xen") &&
 +            !strcmp(pmf_get_platform("system-product"), "HVM domU"))) {
                 /* PR 45671, https://bugs.launchpad.net/qemu/+bug/897771 */
  #ifdef DEBUG
                 printf("forcing PCI mode 1 for QEMU\n");

 -- 
 Quentin Garnier - cube@cubidou.net
 "See the look on my face from staying too long in one place
 [...] every time the morning breaks I know I'm closer to falling"
 KT Tunstall, Saving My Face, Drastic Fantastic, 2007.

State-Changed-From-To: open->closed
State-Changed-By: sborrill@NetBSD.org
State-Changed-When: Wed, 14 Jan 2015 09:50:30 +0000
State-Changed-Why:
Fixed by patches in PR 45671


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.