NetBSD Problem Report #55543

From www@netbsd.org  Wed Aug  5 13:55:29 2020
Return-Path: <www@netbsd.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 C0B8C1A923A
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  5 Aug 2020 13:55:29 +0000 (UTC)
Message-Id: <20200805135528.610421A923B@mollari.NetBSD.org>
Date: Wed,  5 Aug 2020 13:55:28 +0000 (UTC)
From: jmcneill@invisible.ca
Reply-To: jmcneill@invisible.ca
To: gnats-bugs@NetBSD.org
Subject: PVHVM fails to attach hypervisor bus on Amazon EC2 t2.micro
X-Send-Pr-Version: www-1.0

>Number:         55543
>Category:       port-amd64
>Synopsis:       PVHVM fails to attach hypervisor bus on Amazon EC2 t2.micro
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bouyer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 05 14:00:01 +0000 2020
>Closed-Date:    Thu Sep 10 08:26:17 +0000 2020
>Last-Modified:  Thu Sep 10 08:26:17 +0000 2020
>Originator:     Jared McNeill
>Release:        9.99.69
>Organization:
>Environment:
NetBSD 9.99.69 (GENERIC) #0: Mon Aug  3 20:55:35 ADT 2020
>Description:
Booting NetBSD -current on an Amazon EC2 t2.micro instance fails to attach hypervisor at mainbus, which results in no network interface being found.

dimes below:


[   1.0000000] pool redzone disabled for 'pdppl'
[   1.0000000] pool redzone disabled for 'pvpage'
[   1.0000000] pool redzone disabled for 'kmem-04096'
[   1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
[   1.0000000]     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
[   1.0000000]     2018, 2019, 2020 The NetBSD Foundation, Inc.  All rights reserved.
[   1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
[   1.0000000]     The Regents of the University of California.  All rights reserved.

[   1.0000000] NetBSD 9.99.69 (GENERIC) #0: Mon Aug  3 20:55:35 ADT 2020
[   1.0000000]  jmcneill@session:/home/jmcneill/netbsd/git-src/sys/arch/amd64/compile/obj/GENERIC
[   1.0000000] total memory = 1023 MB
[   1.0000000] avail memory = 964 MB
[   1.0000000] pool redzone disabled for 'buf4k'
[   1.0000000] pool redzone disabled for 'buf64k'
[   1.0000000] entropy: no seed from bootloader
[   1.0000030] mainbus0 (root)
[   1.0000030] Identified Guest XEN in HVM mode.
Xen HVM: Unable to obtain xencons page address
[   1.0000030] ACPI: RSDP 0x00000000000EA020 000024 (v02 Xen   )
[   1.0000030] ACPI: XSDT 0x00000000FC00E2A0 000054 (v01 Xen    HVM      00000000 HVML 00000000)
[   1.0000030] ACPI: FACP 0x00000000FC00DF60 0000F4 (v04 Xen    HVM      00000000 HVML 00000000)
[   1.0000030] ACPI: DSDT 0x00000000FC0021C0 00BD19 (v02 Xen    HVM      00000000 INTL 20090123)
[   1.0000030] ACPI: FACS 0x00000000FC002180 000040
[   1.0000030] ACPI: APIC 0x00000000FC00E060 0000D8 (v02 Xen    HVM      00000000 HVML 00000000)
[   1.0000030] ACPI: HPET 0x00000000FC00E1B0 000038 (v01 Xen    HVM      00000000 HVML 00000000)
[   1.0000030] ACPI: WAET 0x00000000FC00E1F0 000028 (v01 Xen    HVM      00000000 HVML 00000000)
[   1.0000030] ACPI: SSDT 0x00000000FC00E220 000031 (v02 Xen    HVM      00000000 INTL 20090123)
[   1.0000030] ACPI: SSDT 0x00000000FC00E260 000033 (v02 Xen    HVM      00000000 INTL 20090123)
[   1.0000030] ACPI: 3 ACPI AML tables successfully acquired and loaded
[   1.0000030] ioapic0 at mainbus0 apid 1
[   1.0000030] cpu0 at mainbus0 apid 0
[   1.0000030] cpu0: Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz, id 0x306f2
[   1.0000030] cpu0: node 0, package 0, core 0, smt 0
[   1.0000030] acpi0 at mainbus0: Intel ACPICA 20200717
[   1.0000030] acpi0: fixed power button present
[   1.0000030] acpi0: fixed sleep button present
[   1.0058697] hpet0 at acpi0: high precision event timer (mem 0xfed00000-0xfed00400)
[   1.0108751] MEM0 (PNP0C02) at acpi0 not configured
[   1.0108751] SYSR (PNP0C02) at acpi0 not configured
[   1.0108751] attimer1 at acpi0 (TMR, PNP0100): io 0x40-0x43 irq 0
[   1.0108751] pcppi1 at acpi0 (SPKR, PNP0800): io 0x61
[   1.0108751] spkr0 at pcppi1: PC Speaker
[   1.0108751] wsbell at spkr0 not configured
[   1.0108751] midi0 at pcppi1: PC speaker
[   1.0108751] sysbeep0 at pcppi1
[   1.0108751] pckbc1 at acpi0 (PS2M, PNP0F13) (aux port): irq 12
[   1.0108751] pckbc2 at acpi0 (PS2K, PNP0303) (kbd port): io 0x60,0x64 irq 1
[   1.0108751] FDC0 (PNP0700) at acpi0 not configured
[   1.0108751] UAR1 (PNP0501) at acpi0 not configured
[   1.0108751] HP0 (PNP0C02) at acpi0 not configured
[   1.0108751] ACPI: Enabled 2 GPEs in block 00 to 0F
[   1.0108751] attimer1: attached to pcppi1
[   1.0108751] pckbd0 at pckbc2 (kbd slot)
[   1.0108751] pckbc2: using irq 1 for kbd slot
[   1.0108751] wskbd0 at pckbd0 mux 1
[   1.0108751] pms0 at pckbc2 (aux slot)
[   1.0108751] pckbc2: using irq 12 for aux slot
[   1.0108751] wsmouse0 at pms0 mux 0
[   1.0108751] pci0 at mainbus0 bus 0: configuration mode 1
[   1.0108751] pchb0 at pci0 dev 0 function 0: Intel 82441FX (PMC) PCI and Memory Controller (rev. 0x02)
[   1.0108751] pcib0 at pci0 dev 1 function 0: Intel 82371SB (PIIX3) PCI-ISA Bridge (rev. 0x00)
[   1.0108751] piixide0 at pci0 dev 1 function 1: Intel 82371SB IDE Interface (PIIX3) (rev. 0x00)
[   1.0108751] piixide0: primary channel interrupting at ioapic0 pin 14
[   1.0108751] atabus0 at piixide0 channel 0
[   1.0108751] piixide0: secondary channel interrupting at ioapic0 pin 15
[   1.0108751] atabus1 at piixide0 channel 1
[   1.0108751] piixpm0 at pci0 dev 1 function 3: Intel 82371AB (PIIX4) Power Management Controller (rev. 0x01)
[   1.0108751] piixpm0: 24-bit timer
[   1.0108751] piixpm0: SMBus disabled
[   1.0108751] vga0 at pci0 dev 2 function 0: Cirrus Logic CL-GD5446 (rev. 0x00)
[   1.0108751] wsdisplay0 at vga0 kbdmux 1
[   1.0108751] drm at vga0 not configured
[   1.0108751] XenSource, Inc. Xen Platform Device (undefined, subclass 0x80, revision 0x01) at pci0 dev 3 function 0 not configured
[   1.0108751] isa0 at pcib0
[   1.0108751] com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
[   1.0108751] com0: console
[   1.0108751] fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
[   1.0108751] fdc0: can't set up ISA DMA map
[   1.0108751] acpicpu0 at cpu0: ACPI CPU
[   4.1597077] wd0 at atabus0 drive 0
[   4.1597077] wd0: <QEMU HARDDISK>
[   4.1597077] wd0: 10240 MB, 20805 cyl, 16 head, 63 sec, 512 bytes/sect x 20971520 sectors
[   4.1732884] wd0: 17065984 trailing sectors not covered by disklabel
[   4.1796564] wd0: 17065984 trailing sectors not covered by disklabel
[   4.1796564] wd0: 17065984 trailing sectors not covered by disklabel
[   4.1908736] wd0: 17065984 trailing sectors not covered by disklabel
[   4.1908736] wd0: 17065984 trailing sectors not covered by disklabel
[   4.1998434] WARNING: 1 error while detecting hardware; check system log.
[   4.1998434] boot device: wd0
[   4.1998434] root on wd0a dumps on wd0b
[   4.1998434] wd0: 17065984 trailing sectors not covered by disklabel
[   4.2099778] root file system type: ffs
[   4.2099778] kern.module.path=/stand/amd64/9.99.69/modules
[   4.2099778] clock: unknown CMOS layout

>How-To-Repeat:
On NetBSD -current:

1) build.sh release
2) build.sh live-image
3) install sysutils/bsdec2-image-upload from pkgsrc
4) create a keyfile.txt with the following contents:
ACCESS_KEY_ID=your_access_key_id
ACCESS_KEY_SECRET=your_access_key_secret
5) gunzip the live image in obj/releasedir/images
6) mount the image with vnconfig and add 'consdev com0' to the default boot command in boot.cfg to be able to capture serial output
7) bsdec2-image-upload --srvio --ena NetBSD-9.99.69-amd64-live.img "NetBSD 9.99.69 amd64 live image" "NetBSD/amd64 9.99.69 - $(date)" us-east-1 your-s3-bucket-name keyfile.txt
>Fix:

>Release-Note:

>Audit-Trail:
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@netbsd.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon
 EC2 t2.micro
Date: Fri, 4 Sep 2020 18:02:07 +0200

 --d6Gm4EdcadzBjdND
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline

 hello,

 On Wed, Aug 05, 2020 at 02:00:01PM +0000, jmcneill@invisible.ca wrote:
 > [   1.0000030] mainbus0 (root)
 > [   1.0000030] Identified Guest XEN in HVM mode.
 > Xen HVM: Unable to obtain xencons page address

 can you try the attached patch ?

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

 --d6Gm4EdcadzBjdND
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename=diff

 ? include/xenmem.h
 ? xen/privcmd.c.hvm
 ? xen/xenmem.c
 Index: xen/hypervisor.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/xen/xen/hypervisor.c,v
 retrieving revision 1.86
 diff -u -p -u -r1.86 hypervisor.c
 --- xen/hypervisor.c	26 May 2020 10:37:25 -0000	1.86
 +++ xen/hypervisor.c	4 Sep 2020 15:59:23 -0000
 @@ -411,29 +413,31 @@ xen_hvm_init(void)
  	xen_hvm_param.index = HVM_PARAM_CONSOLE_PFN;

  	if ( HYPERVISOR_hvm_op(HVMOP_get_param, &xen_hvm_param) < 0) {
 -		aprint_error(
 +		aprint_debug(
  		    "Xen HVM: Unable to obtain xencons page address\n");
 -		return 0;
 -	}
 -
 -	/* Re-use PV field */
 -	xen_start_info.console.domU.mfn = xen_hvm_param.value;
 -
 -	pmap_kenter_pa((vaddr_t) xencons_interface, ptoa(xen_start_info.console.domU.mfn),
 -	    VM_PROT_READ|VM_PROT_WRITE, 0);
 -
 -	xen_hvm_param.domid = DOMID_SELF;
 -	xen_hvm_param.index = HVM_PARAM_CONSOLE_EVTCHN;
 +		xen_start_info.console.domU.mfn = 0;
 +		xen_start_info.console.domU.evtchn = -1;
 +		xencons_interface = 0;
 +	} else {
 +		/* Re-use PV field */
 +		xen_start_info.console.domU.mfn = xen_hvm_param.value;
 +
 +		pmap_kenter_pa((vaddr_t) xencons_interface,
 +		    ptoa(xen_start_info.console.domU.mfn),
 +		    VM_PROT_READ|VM_PROT_WRITE, 0);
 +
 +		xen_hvm_param.domid = DOMID_SELF;
 +		xen_hvm_param.index = HVM_PARAM_CONSOLE_EVTCHN;
 +
 +		if ( HYPERVISOR_hvm_op(HVMOP_get_param, &xen_hvm_param) < 0) {
 +			aprint_error(
 +			    "Xen HVM: Unable to obtain xencons event channel\n");
 +			return 0;
 +		}

 -	if ( HYPERVISOR_hvm_op(HVMOP_get_param, &xen_hvm_param) < 0) {
 -		aprint_error(
 -		    "Xen HVM: Unable to obtain xencons event channel\n");
 -		return 0;
 +		xen_start_info.console.domU.evtchn = xen_hvm_param.value;
  	}

 -	xen_start_info.console.domU.evtchn = xen_hvm_param.value;
 -
 -
  	delay_func = x86_delay = xen_delay;
  	x86_initclock_func = xen_initclocks;

 @@ -662,9 +666,11 @@ hypervisor_attach(device_t parent, devic
  	config_found_ia(self, "xendevbus", &hac.hac_xenbus, hypervisor_print);
  #endif
  #if NXENCONS > 0
 -	memset(&hac, 0, sizeof(hac));
 -	hac.hac_xencons.xa_device = "xencons";
 -	config_found_ia(self, "xendevbus", &hac.hac_xencons, hypervisor_print);
 +	if (xencons_interface != 0) {
 +		memset(&hac, 0, sizeof(hac));
 +		hac.hac_xencons.xa_device = "xencons";
 +		config_found_ia(self, "xendevbus", &hac.hac_xencons, hypervisor_print);
 +	}
  #endif
  #if defined(XENPV) && defined(DOM0OPS)
  #if NPCI > 0

 --d6Gm4EdcadzBjdND--

From: Jared McNeill <jmcneill@invisible.ca>
To: gnats-bugs@netbsd.org
Cc: port-amd64-maintainer@netbsd.org, gnats-admin@netbsd.org, 
    netbsd-bugs@netbsd.org, bouyer@netbsd.org
Subject: Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon
 EC2 t2.micro
Date: Sat, 5 Sep 2020 07:39:58 -0300 (ADT)

 On Fri, 4 Sep 2020, Manuel Bouyer wrote:

 > can you try the attached patch ?

 With the patch it crashes later during timecounter init:

 http://www.netbsd.org/~jmcneill/pr55543-with-patch.png

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Jared McNeill <jmcneill@invisible.ca>
Cc: gnats-bugs@netbsd.org, port-amd64-maintainer@netbsd.org,
        gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon
 EC2 t2.micro
Date: Sat, 5 Sep 2020 13:14:52 +0200

 On Sat, Sep 05, 2020 at 07:39:58AM -0300, Jared McNeill wrote:
 > On Fri, 4 Sep 2020, Manuel Bouyer wrote:
 > 
 > > can you try the attached patch ?
 > 
 > With the patch it crashes later during timecounter init:
 > 
 > http://www.netbsd.org/~jmcneill/pr55543-with-patch.png

 This seems to be a strange Xen instance. Can you see in the dmesg which
 version it is ?

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Jared McNeill <jmcneill@invisible.ca>
To: gnats-bugs@netbsd.org
Cc: port-amd64-maintainer@netbsd.org, gnats-admin@netbsd.org, 
    netbsd-bugs@netbsd.org, bouyer@netbsd.org
Subject: Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon
 EC2 t2.micro
Date: Sat, 5 Sep 2020 09:06:20 -0300 (ADT)

 This is the entire dmesg with your patch:

 [   1.0000000] pool redzone disabled for 'pdppl'
 [   1.0000000] pool redzone disabled for 'pvpage'
 [   1.0000000] pool redzone disabled for 'kmem-04096'
 [   1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 [   1.0000000]     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
 [   1.0000000]     2018, 2019, 2020 The NetBSD Foundation, Inc.  All rights reserved.
 [   1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
 [   1.0000000]     The Regents of the University of California.  All rights reserved.

 [   1.0000000] NetBSD 9.99.72 (GENERIC) #0: Fri Sep  4 18:57:08 ADT 2020
 [   1.0000000]  jmcneill@starscream.invisible.ca:/home/jmcneill/netbsd/cvs-src/sys/arch/amd64/compile/obj/GENERIC
 [   1.0000000] total memory = 1023 MB
 [   1.0000000] avail memory = 966 MB
 [   1.0000000] pool redzone disabled for 'buf4k'
 [   1.0000000] pool redzone disabled for 'buf64k'
 [   1.0000000] entropy: no seed from bootloader
 [   1.0000030] mainbus0 (root)
 [   1.0000030] Identified Guest XEN in HVM mode.
 [   1.0000030] ACPI: RSDP 0x00000000000EA020 000024 (v02 Xen   )
 [   1.0000030] ACPI: XSDT 0x00000000FC00E2A0 000054 (v01 Xen    HVM      00000000 HVML 00000000)
 [   1.0000030] ACPI: FACP 0x00000000FC00DF60 0000F4 (v04 Xen    HVM      00000000 HVML 00000000)
 [   1.0000030] ACPI: DSDT 0x00000000FC0021C0 00BD19 (v02 Xen    HVM      00000000 INTL 20090123)
 [   1.0000030] ACPI: FACS 0x00000000FC002180 000040
 [   1.0000030] ACPI: APIC 0x00000000FC00E060 0000D8 (v02 Xen    HVM      00000000 HVML 00000000)
 [   1.0000030] ACPI: HPET 0x00000000FC00E1B0 000038 (v01 Xen    HVM      00000000 HVML 00000000)
 [   1.0000030] ACPI: WAET 0x00000000FC00E1F0 000028 (v01 Xen    HVM      00000000 HVML 00000000)
 [   1.0000030] ACPI: SSDT 0x00000000FC00E220 000031 (v02 Xen    HVM      00000000 INTL 20090123)
 [   1.0000030] ACPI: SSDT 0x00000000FC00E260 000033 (v02 Xen    HVM      00000000 INTL 20090123)
 [   1.0000030] ACPI: 3 ACPI AML tables successfully acquired and loaded
 [   1.0000030] ioapic0 at mainbus0 apid 1
 [   1.0000030] cpu0 at mainbus0 apid 0
 [   1.0000030] cpu0: Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz, id 0x306f2
 [   1.0000030] cpu0: node 0, package 0, core 0, smt 0
 [   1.0000030] cpu0: Xen HVM: can't get VCPU id
 [   1.0000030] acpi0 at mainbus0: Intel ACPICA 20200717
 [   1.0000030] acpi0: fixed power button present
 [   1.0000030] acpi0: fixed sleep button present
 [   1.0093117] hpet0 at acpi0: high precision event timer (mem 0xfed00000-0xfed00400)
 [   1.0163945] MEM0 (PNP0C02) at acpi0 not configured
 [   1.0163945] SYSR (PNP0C02) at acpi0 not configured
 [   1.0163945] attimer1 at acpi0 (TMR, PNP0100): io 0x40-0x43 irq 0
 [   1.0163945] pcppi1 at acpi0 (SPKR, PNP0800): io 0x61
 [   1.0163945] spkr0 at pcppi1: PC Speaker
 [   1.0163945] wsbell at spkr0 not configured
 [   1.0163945] midi0 at pcppi1: PC speaker
 [   1.0163945] sysbeep0 at pcppi1
 [   1.0163945] pckbc1 at acpi0 (PS2M, PNP0F13) (aux port): irq 12
 [   1.0163945] pckbc2 at acpi0 (PS2K, PNP0303) (kbd port): io 0x60,0x64 irq 1
 [   1.0163945] FDC0 (PNP0700) at acpi0 not configured
 [   1.0163945] UAR1 (PNP0501) at acpi0 not configured
 [   1.0163945] HP0 (PNP0C02) at acpi0 not configured
 [   1.0163945] ACPI: Enabled 2 GPEs in block 00 to 0F
 [   1.0163945] attimer1: attached to pcppi1
 [   1.0163945] pckbd0 at pckbc2 (kbd slot)
 [   1.0163945] pckbc2: using irq 1 for kbd slot
 [   1.0163945] wskbd0 at pckbd0 mux 1
 [   1.0163945] pms0 at pckbc2 (aux slot)
 [   1.0163945] pckbc2: using irq 12 for aux slot
 [   1.0163945] wsmouse0 at pms0 mux 0
 [   1.0163945] pci0 at mainbus0 bus 0: configuration mode 1
 [   1.0163945] pchb0 at pci0 dev 0 function 0: Intel 82441FX (PMC) PCI and Memory Controller (rev. 0x02)
 [   1.0163945] pcib0 at pci0 dev 1 function 0: Intel 82371SB (PIIX3) PCI-ISA Bridge (rev. 0x00)
 [   1.0163945] piixide0 at pci0 dev 1 function 1: Intel 82371SB IDE Interface (PIIX3) (rev. 0x00)
 [   1.0163945] piixide0: primary channel interrupting at ioapic0 pin 14
 [   1.0163945] atabus0 at piixide0 channel 0
 [   1.0163945] piixide0: secondary channel interrupting at ioapic0 pin 15
 [   1.0163945] atabus1 at piixide0 channel 1
 [   1.0163945] piixpm0 at pci0 dev 1 function 3: Intel 82371AB (PIIX4) Power Management Controller (rev. 0x01)
 [   1.0163945] piixpm0: 24-bit timer
 [   1.0163945] piixpm0: SMBus disabled
 [   1.0163945] vga0 at pci0 dev 2 function 0: Cirrus Logic CL-GD5446 (rev. 0x00)
 [   1.0163945] wsdisplay0 at vga0 kbdmux 1
 [   1.0163945] drm at vga0 not configured
 [   1.0163945] XenSource, Inc. Xen Platform Device (undefined, subclass 0x80, revision 0x01) at pci0 dev 3 function 0 not configured
 [   1.0163945] isa0 at pcib0
 [   1.0163945] com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
 [   1.0163945] com0: console
 [   1.0163945] fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
 [   1.0163945] fdc0: can't set up ISA DMA map
 [   1.0163945] acpicpu0 at cpu0: ACPI CPU
 [   1.0163945] uvm_fault(0xffffffff8176a900, 0x0, 1) -> e
 [   1.0163945] fatal page fault in supervisor mode
 [   1.0163945] trap type 6 code 0 rip 0xffffffff802377ca cs 0x8 rflags 0x10202 cr2 0x20 ilevel 0x8 rsp 0xffffffff81af4d70
 [   1.0163945] curlwp 0xffffffff81686c80 pid 0.0 lowest kstack 0xffffffff81aef2c0
 kernel: page fault trap, code=0
 Stopped in pid 0.0 (system) at  netbsd:xen_vcputime_systime_ns+0x3b:    movl 
 20(%rbx),%r13d
 xen_vcputime_systime_ns() at netbsd:xen_vcputime_systime_ns+0x3b
 xen_global_systime_ns() at netbsd:xen_global_systime_ns+0x33
 xen_get_timecount() at netbsd:xen_get_timecount+0x12
 tc_init() at netbsd:tc_init+0xc2
 xen_initclocks() at netbsd:xen_initclocks+0x12f
 initclocks() at netbsd:initclocks+0x31
 main() at netbsd:main+0x30f
 ds          45
 es          a7c2
 fs          0
 gs          0
 rdi         8
 rsi         0
 rbp         ffffffff81af4dc0
 rbx         0
 rdx         1
 rcx         0
 rax         ffffffff8163ab40    cpu_info_primary
 r8          4
 r9          0

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Jared McNeill <jmcneill@invisible.ca>
Cc: gnats-bugs@netbsd.org, port-amd64-maintainer@netbsd.org,
        gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon
 EC2 t2.micro
Date: Sat, 5 Sep 2020 18:16:37 +0200

 --1yeeQ81UyVL57Vl7
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline

 On Sat, Sep 05, 2020 at 09:06:20AM -0300, Jared McNeill wrote:
 > [...]
 > [   1.0000030] ioapic0 at mainbus0 apid 1
 > [   1.0000030] cpu0 at mainbus0 apid 0
 > [   1.0000030] cpu0: Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz, id 0x306f2
 > [   1.0000030] cpu0: node 0, package 0, core 0, smt 0
 > [   1.0000030] cpu0: Xen HVM: can't get VCPU id

 OK, this is the cause of the problem.
 Please try the attached patch. It works on Xen 4.13 if I force it to take
 the fallback branch, but I'm not sure ci_acpiid is the right index to use
 here (linux uses smp_processor_id() but I couldn't find where this number comes
 from).

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

 --1yeeQ81UyVL57Vl7
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename=diff

 Index: xen/xen/hypervisor.c
 ===================================================================
 RCS file: /cvsroot/src/sys/arch/xen/xen/hypervisor.c,v
 retrieving revision 1.86
 diff -u -p -u -r1.86 hypervisor.c
 --- xen/xen/hypervisor.c	26 May 2020 10:37:25 -0000	1.86
 +++ xen/xen/hypervisor.c	5 Sep 2020 16:12:04 -0000
 @@ -456,13 +460,17 @@ xen_hvm_init_cpu(struct cpu_info *ci)

  	descs[0] = 0;
  	x86_cpuid(XEN_CPUID_LEAF(4), descs);
 -	if (!(descs[0] & XEN_HVM_CPUID_VCPU_ID_PRESENT)) {
 -		aprint_error_dev(ci->ci_dev, "Xen HVM: can't get VCPU id\n");
 -		vm_guest = VM_GUEST_XENHVM;
 -		return 0;
 +	if (descs[0] & XEN_HVM_CPUID_VCPU_ID_PRESENT) {
 +		ci->ci_vcpuid = descs[1];
 +	} else {
 +		aprint_error_dev(ci->ci_dev,
 +		    "HVM vid %d cpuid %ld acpid %d/%d\n",
 +			descs[1], ci->ci_cpuid, ci->ci_acpiid, ci->ci_initapicid);
 +		aprint_debug_dev(ci->ci_dev,
 +		    "Xen HVM: can't get VCPU id, falling back to ci_acpiid\n");
 +		ci->ci_vcpuid = ci->ci_acpiid;
  	}

 -	ci->ci_vcpuid = descs[1];
  	ci->ci_vcpu = &HYPERVISOR_shared_info->vcpu_info[ci->ci_vcpuid];

  	/* Register event callback handler. */

 --1yeeQ81UyVL57Vl7--

From: Jared McNeill <jmcneill@invisible.ca>
To: Manuel Bouyer <bouyer@antioche.eu.org>
Cc: gnats-bugs@netbsd.org, port-amd64-maintainer@netbsd.org, 
    gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon
 EC2 t2.micro
Date: Sat, 5 Sep 2020 17:23:21 -0300 (ADT)

 On Sat, 5 Sep 2020, Manuel Bouyer wrote:

 > OK, this is the cause of the problem.
 > Please try the attached patch. It works on Xen 4.13 if I force it to take
 > the fallback branch, but I'm not sure ci_acpiid is the right index to use
 > here (linux uses smp_processor_id() but I couldn't find where this number comes
 > from).

 Hangs at boot, and there are some extra errors now around cpu0 attach:

 [   1.0000000] pool redzone disabled for 'pdppl'
 [   1.0000000] pool redzone disabled for 'pvpage'
 [   1.0000000] pool redzone disabled for 'kmem-04096'
 [   1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 [   1.0000000]     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
 [   1.0000000]     2018, 2019, 2020 The NetBSD Foundation, Inc.  All rights reserved.
 [   1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
 [   1.0000000]     The Regents of the University of California.  All rights reserved.

 [   1.0000000] NetBSD 9.99.72 (GENERIC) #1: Sat Sep  5 16:07:57 ADT 2020
 [   1.0000000]  jmcneill@starscream.invisible.ca:/home/jmcneill/netbsd/cvs-src/sys/arch/amd64/compile/obj/GENERIC
 [   1.0000000] total memory = 1023 MB
 [   1.0000000] avail memory = 966 MB
 [   1.0000000] pool redzone disabled for 'buf4k'
 [   1.0000000] pool redzone disabled for 'buf64k'
 [   1.0000000] entropy: no seed from bootloader
 [   1.0000030] mainbus0 (root)
 [   1.0000030] Identified Guest XEN in HVM mode.
 [   1.0000030] ACPI: RSDP 0x00000000000EA020 000024 (v02 Xen   )
 [   1.0000030] ACPI: XSDT 0x00000000FC00E2A0 000054 (v01 Xen    HVM      00000000 HVML 00000000)
 [   1.0000030] ACPI: FACP 0x00000000FC00DF60 0000F4 (v04 Xen    HVM      00000000 HVML 00000000)
 [   1.0000030] ACPI: DSDT 0x00000000FC0021C0 00BD19 (v02 Xen    HVM      00000000 INTL 20090123)
 [   1.0000030] ACPI: FACS 0x00000000FC002180 000040
 [   1.0000030] ACPI: APIC 0x00000000FC00E060 0000D8 (v02 Xen    HVM      00000000 HVML 00000000)
 [   1.0000030] ACPI: HPET 0x00000000FC00E1B0 000038 (v01 Xen    HVM      00000000 HVML 00000000)
 [   1.0000030] ACPI: WAET 0x00000000FC00E1F0 000028 (v01 Xen    HVM      00000000 HVML 00000000)
 [   1.0000030] ACPI: SSDT 0x00000000FC00E220 000031 (v02 Xen    HVM      00000000 INTL 20090123)
 [   1.0000030] ACPI: SSDT 0x00000000FC00E260 000033 (v02 Xen    HVM      00000000 INTL 20090123)
 [   1.0000030] ACPI: 3 ACPI AML tables successfully acquired and loaded
 [   1.0000030] ioapic0 at mainbus0 apid 1
 [   1.0000030] cpu0 at mainbus0 apid 0
 [   1.0000030] cpu0: Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz, id 0x306f2
 [   1.0000030] cpu0: node 0, package 0, core 0, smt 0
 [   1.0000030] cpu0: HVM vid 0 cpuid 0 acpid 0/0
 [   1.0000030] cpu0: failed to set event upcall vector: -38
 [   1.0000030] cpu0: falling back to global vector
 [   1.0000030] hypervisor0 at mainbus0: Xen version 4.2.amazon
 [   1.0000030] xenbus0 at hypervisor0: Xen Virtual Bus Interface
 [   1.0000030] acpi0 at mainbus0: Intel ACPICA 20200717
 [   1.0000030] acpi0: fixed power button present
 [   1.0000030] acpi0: fixed sleep button present
 [   1.0072718] hpet0 at acpi0: high precision event timer (mem 0xfed00000-0xfed00400)
 [   1.0130312] MEM0 (PNP0C02) at acpi0 not configured
 [   1.0130312] SYSR (PNP0C02) at acpi0 not configured
 [   1.0130312] attimer1 at acpi0 (TMR, PNP0100): io 0x40-0x43 irq 0
 [   1.0130312] pcppi1 at acpi0 (SPKR, PNP0800): io 0x61
 [   1.0130312] spkr0 at pcppi1: PC Speaker
 [   1.0130312] wsbell at spkr0 not configured
 [   1.0130312] midi0 at pcppi1: PC speaker
 [   1.0130312] sysbeep0 at pcppi1
 [   1.0130312] pckbc1 at acpi0 (PS2M, PNP0F13) (aux port): irq 12
 [   1.0130312] pckbc2 at acpi0 (PS2K, PNP0303) (kbd port): io 0x60,0x64 irq 1
 [   1.0130312] FDC0 (PNP0700) at acpi0 not configured
 [   1.0130312] UAR1 (PNP0501) at acpi0 not configured
 [   1.0130312] HP0 (PNP0C02) at acpi0 not configured
 [   1.0130312] ACPI: Enabled 2 GPEs in block 00 to 0F
 [   1.0130312] attimer1: attached to pcppi1
 [   1.0130312] pckbd0 at pckbc2 (kbd slot)
 [   1.0130312] pckbc2: using irq 1 for kbd slot
 [   1.0130312] wskbd0 at pckbd0 mux 1
 [   1.0130312] pms0 at pckbc2 (aux slot)
 [   1.0130312] pckbc2: using irq 12 for aux slot
 [   1.0130312] wsmouse0 at pms0 mux 0
 [   1.0130312] pci0 at mainbus0 bus 0: configuration mode 1
 [   1.0130312] pchb0 at pci0 dev 0 function 0: Intel 82441FX (PMC) PCI and Memory Controller (rev. 0x02)
 [   1.0130312] pcib0 at pci0 dev 1 function 0: Intel 82371SB (PIIX3) PCI-ISA Bridge (rev. 0x00)
 [   1.0130312] piixide0 at pci0 dev 1 function 1: Intel 82371SB IDE Interface (PIIX3) (rev. 0x00)
 [   1.0130312] piixide0: primary channel interrupting at ioapic0 pin 14
 [   1.0130312] atabus0 at piixide0 channel 0
 [   1.0130312] piixide0: secondary channel interrupting at ioapic0 pin 15
 [   1.0130312] atabus1 at piixide0 channel 1
 [   1.0130312] piixpm0 at pci0 dev 1 function 3: Intel 82371AB (PIIX4) Power Management Controller (rev. 0x01)
 [   1.0130312] piixpm0: 24-bit timer
 [   1.0130312] piixpm0: SMBus disabled
 [   1.0130312] vga0 at pci0 dev 2 function 0: Cirrus Logic CL-GD5446 (rev. 0x00)
 [   1.0130312] wsdisplay0 at vga0 kbdmux 1
 [   1.0130312] drm at vga0 not configured
 [   1.0130312] XenSource, Inc. Xen Platform Device (undefined, subclass 0x80, revision 0x01) at pci0 dev 3 function 0 not configured
 [   1.0130312] isa0 at pcib0
 [   1.0130312] com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
 [   1.0130312] com0: console
 [   1.0130312] fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
 [   1.0130312] fdc0: can't set up ISA DMA map
 [   1.0130312] acpicpu0 at cpu0: ACPI CPU

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Jared McNeill <jmcneill@invisible.ca>
Cc: gnats-bugs@netbsd.org, port-amd64-maintainer@netbsd.org,
        gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon
 EC2 t2.micro
Date: Sat, 5 Sep 2020 22:48:36 +0200

 On Sat, Sep 05, 2020 at 05:23:21PM -0300, Jared McNeill wrote:
 > [...]
 > [   1.0000030] cpu0: HVM vid 0 cpuid 0 acpid 0/0
 > [   1.0000030] cpu0: failed to set event upcall vector: -38
 > [   1.0000030] cpu0: falling back to global vector
 > [   1.0000030] hypervisor0 at mainbus0: Xen version 4.2.amazon

 This is old. This explains why some of the interfaces are not available.

 I guess events are not working. I'll see if I can boot again a Xen 4.2
 to debug this.

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Jared McNeill <jmcneill@invisible.ca>
To: Manuel Bouyer <bouyer@antioche.eu.org>
Cc: gnats-bugs@netbsd.org, port-amd64-maintainer@netbsd.org, 
    gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon
 EC2 t2.micro
Date: Sat, 5 Sep 2020 18:18:31 -0300 (ADT)

 On Sat, 5 Sep 2020, Manuel Bouyer wrote:

 > I guess events are not working. I'll see if I can boot again a Xen 4.2
 > to debug this.

 Much appreciated. Turnaround time for testing images on AWS can be 
 painful!

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Jared McNeill <jmcneill@invisible.ca>
Cc: gnats-bugs@netbsd.org, port-amd64-maintainer@netbsd.org,
        gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon
 EC2 t2.micro
Date: Sun, 6 Sep 2020 14:31:23 +0200

 Unfortunably with Xen 4.2.5 it boots. Also, xencons is present.

 Can you enter ddb when it's hung ? if so, can you see where the Xen-related
 threads are waiting ?

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Jared McNeill <jmcneill@invisible.ca>
Cc: gnats-bugs@netbsd.org, port-amd64-maintainer@netbsd.org,
        gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon
 EC2 t2.micro
Date: Sun, 6 Sep 2020 14:34:40 +0200

 On Sun, Sep 06, 2020 at 02:31:23PM +0200, Manuel Bouyer wrote:
 > Unfortunably with Xen 4.2.5 it boots. Also, xencons is present.
 > 
 > Can you enter ddb when it's hung ? if so, can you see where the Xen-related
 > threads are waiting ?

 Also, enabling the DPRINTK macro in xenbus/xenbus_probe.c could give
 hints.

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Jared McNeill <jmcneill@invisible.ca>
To: Manuel Bouyer <bouyer@antioche.eu.org>
Cc: gnats-bugs@netbsd.org, port-amd64-maintainer@netbsd.org, 
    gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon
 EC2 t2.micro
Date: Sun, 6 Sep 2020 14:50:32 -0300 (ADT)

 On Sun, 6 Sep 2020, Manuel Bouyer wrote:

 > On Sun, Sep 06, 2020 at 02:31:23PM +0200, Manuel Bouyer wrote:
 >> Unfortunably with Xen 4.2.5 it boots. Also, xencons is present.
 >>
 >> Can you enter ddb when it's hung ? if so, can you see where the Xen-related
 >> threads are waiting ?
 >
 > Also, enabling the DPRINTK macro in xenbus/xenbus_probe.c could give
 > hints.

 I don't see any output from DPRINTK so I guess we are hung before the 
 thread had an opportunity to run. Unfortunately console input is not 
 supported on EC2 so I can't get to ddb.

From: coypu@sdf.org
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon
 EC2 t2.micro
Date: Mon, 7 Sep 2020 10:34:41 +0000

 You can get a serial console using awscli.
 I wasn't following a guide but winging it.
 You will need to grant permissions in the web interface then feed it to
 `aws configure`. Then with

 aws ec2 get-console-output --instance-id <i-YOURINSTANCEID>

 You should be able to get console output.

From: Jared McNeill <jmcneill@invisible.ca>
To: gnats-bugs@netbsd.org
Cc: port-amd64-maintainer@netbsd.org, gnats-admin@netbsd.org, 
    netbsd-bugs@netbsd.org
Subject: Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon
 EC2 t2.micro
Date: Mon, 7 Sep 2020 07:50:11 -0300 (ADT)

 On Mon, 7 Sep 2020, coypu@sdf.org wrote:

 > You can get a serial console using awscli.

 Yep that's how I've been capturing the dmesgs attached to this PR. The 
 issue here is that I can't use ddb because console _input_ is not 
 supported.

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Jared McNeill <jmcneill@invisible.ca>
Cc: gnats-bugs@netbsd.org, port-amd64-maintainer@netbsd.org,
        gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon
 EC2 t2.micro
Date: Mon, 7 Sep 2020 12:51:28 +0200

 On Sun, Sep 06, 2020 at 02:50:32PM -0300, Jared McNeill wrote:
 > On Sun, 6 Sep 2020, Manuel Bouyer wrote:
 > 
 > > On Sun, Sep 06, 2020 at 02:31:23PM +0200, Manuel Bouyer wrote:
 > > > Unfortunably with Xen 4.2.5 it boots. Also, xencons is present.
 > > > 
 > > > Can you enter ddb when it's hung ? if so, can you see where the Xen-related
 > > > threads are waiting ?
 > > 
 > > Also, enabling the DPRINTK macro in xenbus/xenbus_probe.c could give
 > > hints.
 > 
 > I don't see any output from DPRINTK so I guess we are hung before the thread
 > had an opportunity to run. Unfortunately console input is not supported on
 > EC2 so I can't get to ddb.

 OK, so we have to make guesses.
 acpicpu0 is attached via config_defer() so I guess it doens't need
 threads to be running. On my test systems, after acpicpu0 there are
 xen devices and uhub0.
 Maybe the clock isn't fully functionnal ? Can you try commenting out
 the delay_func/x86_initclock_func override in xen_hvm_init() (carefull,
 there is also this code in init_xen_early(), this one isn't used
 for HVM).

 --- xen/hypervisor.c.orig	2020-09-07 12:48:12.005563460 +0200
 +++ xen/hypervisor.c	2020-09-07 12:46:25.405240796 +0200
 @@ -438,8 +438,10 @@
  		xen_start_info.console.domU.evtchn = xen_hvm_param.value;
  	}

 +#if 0
  	delay_func = x86_delay = xen_delay;
  	x86_initclock_func = xen_initclocks;
 +#endif

  	vm_guest = VM_GUEST_XENPVHVM; /* Be more specific */
  	return 1;

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Jared McNeill <jmcneill@invisible.ca>
To: gnats-bugs@netbsd.org
Cc: port-amd64-maintainer@netbsd.org, gnats-admin@netbsd.org, 
    netbsd-bugs@netbsd.org
Subject: Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon
 EC2 t2.micro
Date: Wed, 9 Sep 2020 08:10:57 -0300 (ADT)

 Yep that works:

 [   1.0000000] pool redzone disabled for 'pdppl'
 [   1.0000000] pool redzone disabled for 'pvpage'
 [   1.0000000] pool redzone disabled for 'kmem-04096'
 [   1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 [   1.0000000]     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
 [   1.0000000]     2018, 2019, 2020 The NetBSD Foundation, Inc.  All rights reserved.
 [   1.0000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
 [   1.0000000]     The Regents of the University of California.  All rights reserved.

 [   1.0000000] NetBSD 9.99.72 (GENERIC) #7: Tue Sep  8 08:21:35 ADT 2020
 [   1.0000000]  jmcneill@starscream.invisible.ca:/home/jmcneill/netbsd/cvs-src/sys/arch/amd64/compile/obj/GENERIC
 [   1.0000000] total memory = 1023 MB
 [   1.0000000] avail memory = 966 MB
 [   1.0000000] pool redzone disabled for 'buf4k'
 [   1.0000000] pool redzone disabled for 'buf64k'
 [   1.0000000] entropy: no seed from bootloader
 [   1.0000030] mainbus0 (root)
 [   1.0000030] Identified Guest XEN in HVM mode.
 [   1.0000030] ACPI: RSDP 0x00000000000EA020 000024 (v02 Xen   )
 [   1.0000030] ACPI: XSDT 0x00000000FC00E2A0 000054 (v01 Xen    HVM      00000000 HVML 00000000)
 [   1.0000030] ACPI: FACP 0x00000000FC00DF60 0000F4 (v04 Xen    HVM      00000000 HVML 00000000)
 [   1.0000030] ACPI: DSDT 0x00000000FC0021C0 00BD19 (v02 Xen    HVM      00000000 INTL 20090123)
 [   1.0000030] ACPI: FACS 0x00000000FC002180 000040
 [   1.0000030] ACPI: APIC 0x00000000FC00E060 0000D8 (v02 Xen    HVM      00000000 HVML 00000000)
 [   1.0000030] ACPI: HPET 0x00000000FC00E1B0 000038 (v01 Xen    HVM      00000000 HVML 00000000)
 [   1.0000030] ACPI: WAET 0x00000000FC00E1F0 000028 (v01 Xen    HVM      00000000 HVML 00000000)
 [   1.0000030] ACPI: SSDT 0x00000000FC00E220 000031 (v02 Xen    HVM      00000000 INTL 20090123)
 [   1.0000030] ACPI: SSDT 0x00000000FC00E260 000033 (v02 Xen    HVM      00000000 INTL 20090123)
 [   1.0000030] ACPI: 3 ACPI AML tables successfully acquired and loaded
 [   1.0000030] ioapic0 at mainbus0 apid 1
 [   1.0000030] cpu0 at mainbus0 apid 0
 [   1.0000030] cpu0: Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz, id 0x306f2
 [   1.0000030] cpu0: node 0, package 0, core 0, smt 0
 [   1.0000030] cpu0: HVM vid 0 cpuid 0 acpid 0/0
 [   1.0000030] cpu0: failed to set event upcall vector: -38
 [   1.0000030] cpu0: falling back to global vector
 [   1.0000030] hypervisor0 at mainbus0: Xen version 4.2.amazon
 [   1.0000030] xenbus0 at hypervisor0: Xen Virtual Bus Interface
 [   1.0000030] acpi0 at mainbus0: Intel ACPICA 20200717
 [   1.0000030] acpi0: fixed power button present
 [   1.0000030] acpi0: fixed sleep button present
 [   1.0056853] hpet0 at acpi0: high precision event timer (mem 0xfed00000-0xfed00400)
 [   1.0113824] MEM0 (PNP0C02) at acpi0 not configured
 [   1.0113824] SYSR (PNP0C02) at acpi0 not configured
 [   1.0113824] attimer1 at acpi0 (TMR, PNP0100): io 0x40-0x43 irq 0
 [   1.0113824] pcppi1 at acpi0 (SPKR, PNP0800): io 0x61
 [   1.0113824] spkr0 at pcppi1: PC Speaker
 [   1.0113824] wsbell at spkr0 not configured
 [   1.0113824] midi0 at pcppi1: PC speaker
 [   1.0113824] sysbeep0 at pcppi1
 [   1.0113824] pckbc1 at acpi0 (PS2M, PNP0F13) (aux port): irq 12
 [   1.0113824] pckbc2 at acpi0 (PS2K, PNP0303) (kbd port): io 0x60,0x64 irq 1
 [   1.0113824] FDC0 (PNP0700) at acpi0 not configured
 [   1.0113824] UAR1 (PNP0501) at acpi0 not configured
 [   1.0113824] HP0 (PNP0C02) at acpi0 not configured
 [   1.0113824] ACPI: Enabled 2 GPEs in block 00 to 0F
 [   1.0113824] attimer1: attached to pcppi1
 [   1.0113824] pckbd0 at pckbc2 (kbd slot)
 [   1.0113824] pckbc2: using irq 1 for kbd slot
 [   1.0113824] wskbd0 at pckbd0 mux 1
 [   1.0113824] pms0 at pckbc2 (aux slot)
 [   1.0113824] pckbc2: using irq 12 for aux slot
 [   1.0113824] wsmouse0 at pms0 mux 0
 [   1.0113824] pci0 at mainbus0 bus 0: configuration mode 1
 [   1.0113824] pchb0 at pci0 dev 0 function 0: Intel 82441FX (PMC) PCI and Memory Controller (rev. 0x02)
 [   1.0113824] pcib0 at pci0 dev 1 function 0: Intel 82371SB (PIIX3) PCI-ISA Bridge (rev. 0x00)
 [   1.0113824] piixide0 at pci0 dev 1 function 1: Intel 82371SB IDE Interface (PIIX3) (rev. 0x00)
 [   1.0113824] piixide0: primary channel interrupting at ioapic0 pin 14
 [   1.0113824] atabus0 at piixide0 channel 0
 [   1.0113824] piixide0: secondary channel interrupting at ioapic0 pin 15
 [   1.0113824] atabus1 at piixide0 channel 1
 [   1.0113824] piixpm0 at pci0 dev 1 function 3: Intel 82371AB (PIIX4) Power Management Controller (rev. 0x01)
 [   1.0113824] piixpm0: 24-bit timer
 [   1.0113824] piixpm0: SMBus disabled
 [   1.0113824] vga0 at pci0 dev 2 function 0: Cirrus Logic CL-GD5446 (rev. 0x00)
 [   1.0113824] wsdisplay0 at vga0 kbdmux 1
 [   1.0113824] drm at vga0 not configured
 [   1.0113824] XenSource, Inc. Xen Platform Device (undefined, subclass 0x80, revision 0x01) at pci0 dev 3 function 0 not configured
 [   1.0113824] isa0 at pcib0
 [   1.0113824] com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
 [   1.0113824] com0: console
 [   1.0113824] fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
 [   1.0113824] fdc0: can't set up ISA DMA map
 [   1.0113824] acpicpu0 at cpu0: ACPI CPU
 [   1.2505649] xenbus_probe (xenbus_probe_init:679) .
 [   1.2505649] xenbus_probe (xenbus_probe_frontends:518) probe device.
 [   1.2567363] xenbus_probe (xenbus_probe_frontends:520) directory err 0 dir_ (xenbus_probe_device_type:325) probe device/vbd type vbd.
 [   1.2667278] xenbus_probe (xenbus_probe_device_type:327) directory err 0 dir_n 1.
 [   1.2737434] xenbus_probe (xenbus_probe_device_type:419) xenbus_probe_device_type probe device/vbd/768
 [   1.2_otherend_details:200) read_otherend_details: read device/vbd/768/backend returned /local/domain/0/backend/vbd/30762/768
 [   1.2737434] .
 [   1.2902307] xbd0 at xenbus0 id 768: Xen Virtual Block Device Interface
 [   1.2940600] xenbus_probe (xenbus_probe_d   1.3045458] xenbus_probe (xenbus_probe_device_type:327) directory err 0 dir_n 1.
 [   1.3137456] xenbus_probe (xenbus_probe_device_type:419) xenbus_probe_device_type probe device/vif/0
 [   1.3137456] .
 [   1.3137456] xenbus_probe (read_otherend_details:2kend returned /local/domain/0/backend/vif/30762/0
 [   1.3137456] .
 [   1.3292018] xennet0 at xenbus0 id 0: Xen Virtual Network Interface
 [   1.3292018] xennet0: backend features 0x6<SG,RX-COPY>
 [   1.3363843] pool redzone disabled for 'xnfrx'
 [   1.336384 1.3437442] xenbus_probe (xenbus_probe_backends:551) probe backend.
 [   1.3437442] xenbus_probe (xenbus_probe_backends:553) directory err 2 dirt_n 836997024.
 [   1.3437442] balloon at xenbus0 id 0 not configured
 [   1.3540881] xenbus_probe (xenbus_probe_iotherend_changed:260) state is 4, /local/domain/0/backend/vbd/30762/768/state, /local/domain/0/backend/vbd/30762/768/state.
 [   1.3664406] xbd0: 10240 MB, 512 bytes/sect x 20971520 sectors
 [   1.3664406] xbd0: backend features 0
 [   1.3737203] xbd0: 17065y disklabel
 [   1.3737203] xenbus_probe (otherend_changed:260) state is 4, /local/domain/0/backend/vbd/30762/768/state, /local/domain/0/backend/vbd/30762/768/state.
 [   1.3859582] xenbus_probe (otherend_changed:260) state is 2, /local/domain/0/backend/vif30762/0/state.
 [   1.3859582] xbd0: 17065984 trailing sectors not covered by disklabel
 [   1.3980893] xbd0: 17065984 trailing sectors not covered by disklabel
 [   1.4037457] xbd0: 17065984 trailing sectors not covered by disklabel
 [   1.4037457] xbd0: 17054227] xenbus_probe (frontend_changed:604) frontend_changed device
 [   1.4154227] .
 [   1.4154227] xenbus_probe (xenbus_probe_frontends:518) probe device.
 [   1.4154227] WARNING: 3 errors while detecting hardware; check system log.
 [   1.4273735] boot dev
 [   1.4273735] xenbus_probe (xenbus_probe_frontends:520) directory err 0 dir_n 3.
 [   1.4351365] xenbus_probe (xenbus_probe_device_type:325) probe device/vbd type vbd.
 [   1.4351365] xenbus_probe (xenbus_probe_device_type:327) directory err 0 dir_n 1.
 [ e:325) probe device/vif type vif.
 [   1.4476085] xenbus_probe (xenbus_probe_device_type:327) directory err 0 dir_n 1.
 [   1.4476085] xenbus_probe (backend_changed:612) backend_changed backend
 [   1.4476085] .
 [   1.4564584] xenbus_probe (xenbus_probe_back84 trailing sectors not covered by disklabel
 [   1.4637418] xenbus_probe (xenbus_probe_backends:553) directory err 2 dirt_n -2123594272.
 [   1.4637418] root file system type: ffs
 [   1.4637418] xenbus_probe (frontend_changed:604) frontend_changed device/vprobe_frontends:518) probe device.
 [   1.4786151] kern.module.path=/stand/amd64/9.99.72/modules
 [   1.4854488] xenbus_probe (xenbus_probe_frontends:520) directory err 0 dir_n 3.
 [   1.4854488] xenbus_probe (xenbus_probe_device_type:325) probe device/vbd t32] xenbus_probe (xenbus_probe_device_type:327) directory err 0 dir_n 1.
 [   1.4984232] xenbus_probe (xenbus_probe_device_type:325) probe device/vif type vif.
 [   1.5068649] xenbus_probe (xenbus_probe_device_type:327) directory err 0 dir_n 1.
 [   1.506864/domain/0/backend/vif/30762/0/state, /local/domain/0/backend/vif/30762/0/state.
 Wed Sep  9 11:06:41 UTC 2020
 Starting root file system check:
 /dev/rxbd0a: file system is clean; not checking

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Jared McNeill <jmcneill@invisible.ca>
Cc: gnats-bugs@netbsd.org, port-amd64-maintainer@netbsd.org,
        gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon
 EC2 t2.micro
Date: Wed, 9 Sep 2020 18:47:23 +0200

 On Wed, Sep 09, 2020 at 08:10:57AM -0300, Jared McNeill wrote:
 > Yep that works:

 Good, so it should work with the stock hypervisor.c 1.88, which I
 just commited.
 Can you try it ?

 -- 
 Manuel Bouyer <bouyer@antioche.eu.org>
      NetBSD: 26 ans d'experience feront toujours la difference
 --

From: Jared McNeill <jmcneill@invisible.ca>
To: Manuel Bouyer <bouyer@antioche.eu.org>
Cc: gnats-bugs@netbsd.org, port-amd64-maintainer@netbsd.org, 
    gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-amd64/55543: PVHVM fails to attach hypervisor bus on Amazon
 EC2 t2.micro
Date: Wed, 9 Sep 2020 20:47:44 -0300 (ADT)

 On Wed, 9 Sep 2020, Manuel Bouyer wrote:

 > Good, so it should work with the stock hypervisor.c 1.88, which I
 > just commited.
 > Can you try it ?

 Looks good!

 [     1.000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 [     1.000000]     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
 [     1.000000]     2018, 2019, 2020 The NetBSD Foundation, Inc.  All rights reserved.
 [     1.000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
 [     1.000000]     The Regents of the University of California.  All rights reserved.

 [     1.000000] NetBSD 9.99.72 (GENERIC) #10: Wed Sep  9 19:09:01 ADT 2020
 [     1.000000]         jmcneill@starscream.invisible.ca:/home/jmcneill/netbsd/cvs-src/sys/arch/amd64/compile/obj/GENERIC
 [     1.000000] total memory = 1023 MB
 [     1.000000] avail memory = 966 MB
 [     1.000000] pool redzone disabled for 'buf4k'
 [     1.000000] pool redzone disabled for 'buf64k'
 [     1.000000] entropy: no seed from bootloader
 [     1.000000] timecounter: Timecounters tick every 10.000 msec
 [     1.000000] Kernelized RAIDframe activated
 [     1.000000] timecounter: Timecounter "i8254" frequency 1193182 Hz quality 100
 [     1.000003] Xen HVM domU (4.2.amazon)
 [     1.000003] mainbus0 (root)
 [     1.000003] Identified Guest XEN in HVM mode.
 [     1.000003] ACPI: RSDP 0x00000000000EA020 000024 (v02 Xen   )
 [     1.000003] ACPI: XSDT 0x00000000FC00E2A0 000054 (v01 Xen    HVM      00000000 HVML 00000000)
 [     1.000003] ACPI: FACP 0x00000000FC00DF60 0000F4 (v04 Xen    HVM      00000000 HVML 00000000)
 [     1.000003] ACPI: DSDT 0x00000000FC0021C0 00BD19 (v02 Xen    HVM      00000000 INTL 20090123)
 [     1.000003] ACPI: FACS 0x00000000FC002180 000040
 [     1.000003] ACPI: APIC 0x00000000FC00E060 0000D8 (v02 Xen    HVM      00000000 HVML 00000000)
 [     1.000003] ACPI: HPET 0x00000000FC00E1B0 000038 (v01 Xen    HVM      00000000 HVML 00000000)
 [     1.000003] ACPI: WAET 0x00000000FC00E1F0 000028 (v01 Xen    HVM      00000000 HVML 00000000)
 [     1.000003] ACPI: SSDT 0x00000000FC00E220 000031 (v02 Xen    HVM      00000000 INTL 20090123)
 [     1.000003] ACPI: SSDT 0x00000000FC00E260 000033 (v02 Xen    HVM      00000000 INTL 20090123)
 [     1.000003] ACPI: 3 ACPI AML tables successfully acquired and loaded
 [     1.000003] ioapic0 at mainbus0 apid 1: pa 0xfec00000, version 0x11, 48 pins
 [     1.000003] cpu0 at mainbus0 apid 0
 [     1.000003] cpu0: Use lfence to serialize rdtsc
 [     1.000003] cpu0: Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz, id 0x306f2
 [     1.000003] cpu0: node 0, package 0, core 0, smt 0
 [     1.000003] cpu0: autoconfiguration error: failed to set event upcall vector: -38
 [     1.000003] cpu0: autoconfiguration error: falling back to global vector
 [     1.000003] hypervisor0 at mainbus0: Xen version 4.2.amazon
 [     1.000003] hypervisor0: features:  writable_page_tables auto_translated_physmap hvm_callback_vector hvm_safe_pvclock hvm_pirqs
 [     1.000003] xenbus0 at hypervisor0: Xen Virtual Bus Interface
 [     1.000003] acpi0 at mainbus0: Intel ACPICA 20200717
 [     1.000003] acpi0: X/RSDT: OemId <   Xen,     HVM,00000000>, AslId <HVML,00000000>
 [     1.000003] acpi0: SCI interrupting at int 9
 [     1.000003] acpi0: fixed power button present
 [     1.000003] acpi0: fixed sleep button present
 [     1.000003] timecounter: Timecounter "ACPI-Safe" frequency 3579545 Hz quality 900
 [     1.002884] hpet0 at acpi0: high precision event timer (mem 0xfed00000-0xfed00400)
 [     1.002884] timecounter: Timecounter "hpet0" frequency 62500000 Hz quality 2000
 [     1.009071] MEM0 (PNP0C02) at acpi0 not configured
 [     1.009071] SYSR (PNP0C02) at acpi0 not configured
 [     1.009071] attimer1 at acpi0 (TMR, PNP0100): io 0x40-0x43 irq 0
 [     1.009071] pcppi1 at acpi0 (SPKR, PNP0800): io 0x61
 [     1.009071] spkr0 at pcppi1: PC Speaker
 [     1.009071] wsbell at spkr0 not configured
 [     1.009071] midi0 at pcppi1: PC speaker
 [     1.009071] sysbeep0 at pcppi1
 [     1.009071] pckbc1 at acpi0 (PS2M, PNP0F13) (aux port): irq 12
 [     1.009071] pckbc2 at acpi0 (PS2K, PNP0303) (kbd port): io 0x60,0x64 irq 1
 [     1.009071] FDC0 (PNP0700) at acpi0 not configured
 [     1.009071] UAR1 (PNP0501) at acpi0 not configured
 [     1.009071] HP0 (PNP0C02) at acpi0 not configured
 [     1.009071] ACPI: Enabled 2 GPEs in block 00 to 0F
 [     1.009071] attimer1: attached to pcppi1
 [     1.009071] pckbd0 at pckbc2 (kbd slot)
 [     1.009071] pckbc2: using irq 1 for kbd slot
 [     1.009071] wskbd0 at pckbd0 mux 1
 [     1.009071] pms0 at pckbc2 (aux slot)
 [     1.009071] pckbc2: using irq 12 for aux slot
 [     1.009071] wsmouse0 at pms0 mux 0
 [     1.009071] pci0 at mainbus0 bus 0: configuration mode 1
 [     1.009071] pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
 [     1.009071] pchb0 at pci0 dev 0 function 0: Intel 82441FX (PMC) PCI and Memory Controller (rev. 0x02)
 [     1.009071] pcib0 at pci0 dev 1 function 0: Intel 82371SB (PIIX3) PCI-ISA Bridge (rev. 0x00)
 [     1.009071] piixide0 at pci0 dev 1 function 1: Intel 82371SB IDE Interface (PIIX3) (rev. 0x00)
 [     1.009071] piixide0: bus-master DMA support present
 [     1.009071] piixide0: primary channel wired to compatibility mode
 [     1.009071] piixide0: primary channel interrupting at ioapic0 pin 14
 [     1.009071] atabus0 at piixide0 channel 0
 [     1.009071] piixide0: secondary channel wired to compatibility mode
 [     1.009071] piixide0: secondary channel interrupting at ioapic0 pin 15
 [     1.009071] atabus1 at piixide0 channel 1
 [     1.009071] piixpm0 at pci0 dev 1 function 3: Intel 82371AB (PIIX4) Power Management Controller (rev. 0x01)
 [     1.009071] timecounter: Timecounter "piixpm0" frequency 3579545 Hz quality 900
 [     1.009071] piixpm0: 24-bit timer
 [     1.009071] piixpm0: SMBus disabled
 [     1.009071] vga0 at pci0 dev 2 function 0: Cirrus Logic CL-GD5446 (rev. 0x00)
 [     1.009071] wsdisplay0 at vga0 kbdmux 1
 [     1.009071] wsmux1: connecting to wsdisplay0
 [     1.009071] wskbd0: connecting to wsdisplay0
 [     1.009071] drm at vga0 not configured
 [     1.009071] XenSource, Inc. Xen Platform Device (undefined, subclass 0x80, revision 0x01) at pci0 dev 3 function 0 not configured
 [     1.009071] isa0 at pcib0
 [     1.009071] com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
 [     1.009071] com0: console
 [     1.009071] fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
 [     1.009071] fdc0: can't set up ISA DMA map
 [     1.009071] acpicpu0 at cpu0: ACPI CPU
 [     1.009071] acpicpu0: C1: HLT, lat   0 us, pow     0 mW
 [     1.009071] timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
 [     1.182865] xenbus0: using event channel 3
 [     1.182865] IPsec: Initialized Security Association Processing.
 [     1.182865] aes: Intel AES-NI
 [     1.182865] chacha: x86 SSE2 ChaCha
 [     1.182865] adiantum: self-test passed
 [     1.182865] aes_ccm: self-test passed
 [     1.182865] blake2s: self-test passed
 [     1.182865] xbd0 at xenbus0 id 768: Xen Virtual Block Device Interface
 [     1.191689] xbd0: using event channel 5
 [     1.191689] xennet0 at xenbus0 id 0: Xen Virtual Network Interface
 [     1.210478] xennet0: backend features 0x7<IPV6-CSUM,SG,RX-COPY>
 [     1.210478] pool redzone disabled for 'xnfrx'
 [     1.210478] xennet0: MAC address 12:12:e0:36:4f:c3
 [     1.221142] xennet0: using event channel 6
 [     1.221142] balloon at xenbus0 id 0 not configured
 [     1.221142] xbd0: 10240 MB, 512 bytes/sect x 20971520 sectors
 [     1.221142] xbd0: backend features 0
 [     1.232341] cgd: self-test aes-xts-256
 [     1.232341] cgd: self-test aes-xts-512
 [     1.232341] cgd: self-test aes-cbc-128
 [     1.232341] cgd: self-test aes-cbc-256
 [     1.232341] cgd: self-test 3des-cbc-192
 [     1.232341] cgd: self-test blowfish-cbc-448
 [     1.232341] cgd: self-test aes-cbc-128 (encblkno8)
 [     1.232341] cgd: self-tests passed
 [     1.232341] WARNING: 2 errors while detecting hardware; check system log.
 [     1.244188] boot device: xbd0
 [     1.244188] root on xbd0a dumps on xbd0b
 [     1.250396] root file system type: ffs
 [     1.250396] kern.module.path=/stand/amd64/9.99.72/modules
 [     1.250396] clock: unknown CMOS layout

Responsible-Changed-From-To: port-amd64-maintainer->bouyer
Responsible-Changed-By: bouyer@NetBSD.org
Responsible-Changed-When: Thu, 10 Sep 2020 08:26:17 +0000
Responsible-Changed-Why:
.


State-Changed-From-To: open->closed
State-Changed-By: bouyer@NetBSD.org
State-Changed-When: Thu, 10 Sep 2020 08:26:17 +0000
State-Changed-Why:
Confirmed fixed with hypervisor.c 1.88


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.