NetBSD Problem Report #53965

From kre@munnari.OZ.AU  Sat Feb  9 14:16:26 2019
Return-Path: <kre@munnari.OZ.AU>
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 7811B7A1CF
	for <gnats-bugs@gnats.NetBSD.org>; Sat,  9 Feb 2019 14:16:26 +0000 (UTC)
Message-Id: <201902091416.x19EGN9b017621@jinx.noi.kre.to>
Date: Sat, 9 Feb 2019 21:16:23 +0700 (+07)
From: kre@munnari.OZ.AU
To: gnats-bugs@NetBSD.org
Subject: XEN DomU fails to poweroff in new HEAD kernels
X-Send-Pr-Version: 3.95

>Number:         53965
>Category:       port-xen
>Synopsis:       XEN DomU fails to poweroff in new HEAD kernels
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-xen-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 09 14:20:00 +0000 2019
>Closed-Date:    Sun Feb 10 14:07:46 +0000 2019
>Last-Modified:  Sun Feb 10 20:35:00 +0000 2019
>Originator:     Robert Elz
>Release:        NetBSD 8.99.30
>Organization:
>Environment:
System: NetBSD jinx.noi.kre.to 8.99.30 NetBSD 8.99.30 (1.1-20190114) #9: Mon Jan 14 13:29:08 ICT 2019 kre@onyx.coe.psu.ac.th:/usr/obj/testing/kernels/amd64/JINX amd64
Architecture: x86_64
Machine: amd64
	however the architecture and machine are the right type,
	assuming you stick a XEN Dom0 on there, and then run a DomU
	(PV mode) on top of that.

>Description:
	Sometime in the recent past, my XEN DomU kernels lost the
	ability to power off the (virtual) machine (and cause the
	XEN hypervisor to let go.)

	It was working with 8.99.32 (of some vintage, the last kernel
	update I did was probably a couple of weeks ago) and failed
	with the first update to a 8.99.34 kernel I attempted (though
	the first time I just assumed I left the "-p" off the shutdown
	command by accident, and didn't think any more of it.)

	Note I am running a very old (by current standards) Xen kernel
	and Dom0 system, however they are (and have been) working well,
	and as (ignoring my uses for testing up to date current kernels,
	and particularly, shells) this is a production system I'm in no
	great hurry to update it.

	pkg_info on the Dom0 tells me:

	onyx$ pkg_info | grep xen
	xentools42-4.2.5nb15 Userland Tools for Xen 4.2.x
	xenkernel42-4.2.2   Xen 4.2.x Kernel

	(with some other noise that just happened to match.)

	The kernel I am running is not GENERIC, in fact it contains
	almost nothing that is not absolutely required for a Xen DomU
	(so very few drivers, file systems etc).   For the test shown
	below I simply made a new (up to the minute) kernel and userland,
	and booted that, then more or less immediately (after I noticed
	the build had finished and it was running) did the commands
	below.   Nothing has changed in the kernel config in a long time.

	The date/time in the uname output (kernel build time) is
	UTC+0700, the running kernel does not have any TZ configired
	and the dates shown there are (as indicated) simply UTC.

	13:51:52 UTC is about 10 mins later than 20:41:06 UTC+0700.
	There was a cvs update done immediately before the (-u) build
	(which did not take very long.)

	===> build.sh started:    Sat Feb  9 20:07:25 ICT 2019
	===================  DONE: Sat Feb 9 20:45:32 ICT 2019


>How-To-Repeat:

netbsd# uname -a
NetBSD netbsd.noi.kre.to 8.99.34 NetBSD 8.99.34 (MUNNARI-DomU) #408: Sat Feb  9 20:41:06 ICT 2019  kre@onyx.coe.psu.ac.th:/usr/obj/testing/kernels/amd64/MUNNARI-DomU amd64
netbsd# shutdown -p now
Shutdown NOW!
shutdown: [pid 421]
netbsd# wall: You have write permission turned off; no reply possible

*** FINAL System shutdown message from root@netbsd.noi.kre.to ***            
System going down IMMEDIATELY                                                  


Feb  9 13:51:52 netbsd shutdown: poweroff by root: 

System shutdown time has arrived

About to run shutdown hooks...
Stopping cron.
Stopping inetd.
Saved entropy to /var/db/entropy-file.
Sat Feb  9 13:51:54 UTC 2019

Done running shutdown hooks.
Feb  9 13:51:59 netbsd syslogd[178]: Exiting on signal 15
[ 386.2701065] syncing disks... done

[ 386.2900919] The operating system has halted.
[ 386.2900919] Please press any key to reboot.

after which it is possible to simply exit the console and
"xl destroy ..." withoutg problems.

>Fix:
	??

	If no-one can easily spot which change might have caused
	this, I can bisect and test with just the cost of the time
	to do the cvs updates and builds.

>Release-Note:

>Audit-Trail:
From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@NetBSD.org
Cc: port-xen-maintainer@netbsd.org, gnats-admin@netbsd.org,
        netbsd-bugs@netbsd.org
Subject: Re: port-xen/53965: XEN DomU fails to poweroff in new HEAD kernels
Date: Sat, 9 Feb 2019 17:36:37 +0100

 On Sat, Feb 09, 2019 at 02:20:00PM +0000, kre@munnari.OZ.AU wrote:
 > >Description:
 > 	Sometime in the recent past, my XEN DomU kernels lost the
 > 	ability to power off the (virtual) machine (and cause the
 > 	XEN hypervisor to let go.)
 > 
 > 	It was working with 8.99.32 (of some vintage, the last kernel
 > 	update I did was probably a couple of weeks ago) and failed
 > 	with the first update to a 8.99.34 kernel I attempted (though
 > 	the first time I just assumed I left the "-p" off the shutdown
 > 	command by accident, and didn't think any more of it.)
 > 
 > 	Note I am running a very old (by current standards) Xen kernel
 > 	and Dom0 system, however they are (and have been) working well,
 > 	and as (ignoring my uses for testing up to date current kernels,
 > 	and particularly, shells) this is a production system I'm in no
 > 	great hurry to update it.
 > 
 > 	pkg_info on the Dom0 tells me:
 > 
 > 	onyx$ pkg_info | grep xen
 > 	xentools42-4.2.5nb15 Userland Tools for Xen 4.2.x
 > 	xenkernel42-4.2.2   Xen 4.2.x Kernel
 > 
 > 	(with some other noise that just happened to match.)

 I'm not seeing this with the Daily ATF runs:
 http://www-soc.lip6.fr/~bouyer/NetBSD-tests/xen/HEAD/
 but the server is running Xen 4.11

 I wonder if it could be related to the recent Xen API version bump in our
 source tree

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

From: Robert Elz <kre@munnari.OZ.AU>
To: Manuel Bouyer <bouyer@antioche.eu.org>
Cc: gnats-bugs@NetBSD.org, port-xen-maintainer@netbsd.org,
        gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-xen/53965: XEN DomU fails to poweroff in new HEAD kernels
Date: Sun, 10 Feb 2019 00:29:48 +0700

     Date:        Sat, 9 Feb 2019 17:36:37 +0100
     From:        Manuel Bouyer <bouyer@antioche.eu.org>
     Message-ID:  <20190209163637.GA3729@antioche.eu.org>

 Thanks for the reply.

   | I wonder if it could be related to the recent Xen API version bump in our
   | source tree

 If you could point me to an approximate time that happened, I could
 try before and after kernels and see.

 I should have also pointed out that as best I can tell, everything
 else is working properly (though I rarely use the network from that
 DomU, just the console).

 kre

From: Greg Oster <oster@netbsd.org>
To: Manuel Bouyer <bouyer@antioche.eu.org>
Cc: gnats-bugs@NetBSD.org, port-xen-maintainer@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-xen/53965: XEN DomU fails to poweroff in new HEAD kernels
Date: Sat, 9 Feb 2019 11:37:31 -0600

 On Sat, 9 Feb 2019 17:36:37 +0100
 Manuel Bouyer <bouyer@antioche.eu.org> wrote:

 > On Sat, Feb 09, 2019 at 02:20:00PM +0000, kre@munnari.OZ.AU wrote:
 > > >Description:  
 > > 	Sometime in the recent past, my XEN DomU kernels lost the
 > > 	ability to power off the (virtual) machine (and cause the
 > > 	XEN hypervisor to let go.)
 > > 
 > > 	It was working with 8.99.32 (of some vintage, the last
 > > kernel update I did was probably a couple of weeks ago) and failed
 > > 	with the first update to a 8.99.34 kernel I attempted
 > > (though the first time I just assumed I left the "-p" off the
 > > shutdown command by accident, and didn't think any more of it.)
 > > 
 > > 	Note I am running a very old (by current standards) Xen
 > > kernel and Dom0 system, however they are (and have been) working
 > > well, and as (ignoring my uses for testing up to date current
 > > kernels, and particularly, shells) this is a production system I'm
 > > in no great hurry to update it.
 > > 
 > > 	pkg_info on the Dom0 tells me:
 > > 
 > > 	onyx$ pkg_info | grep xen
 > > 	xentools42-4.2.5nb15 Userland Tools for Xen 4.2.x
 > > 	xenkernel42-4.2.2   Xen 4.2.x Kernel
 > > 
 > > 	(with some other noise that just happened to match.)  
 > 
 > I'm not seeing this with the Daily ATF runs:
 > http://www-soc.lip6.fr/~bouyer/NetBSD-tests/xen/HEAD/
 > but the server is running Xen 4.11
 > 
 > I wonder if it could be related to the recent Xen API version bump in
 > our source tree

 I'm seeing this with an 8.0_STABLE DOM0... I instrumented cpu_reset()
 with printfs before/after the call to HYPERVISOR_reboot():

 #ifdef XEN
         printf("calling HYPERVISOR_reboot()\n");
 	HYPERVISOR_reboot();
         printf("done HYPERVISOR_reboot()\n");
 #else

 and both are printed:
 [ 119.1643554] xbd1: detached
 [ 119.3838479] rebooting...
 [ 119.3838479] calling x86_disable_intr()
 [ 119.3838479] calling HYPERVISOR_reboot()
 [ 119.3838479] done HYPERVISOR_reboot()

 I note that if I do a 'shutdown -h' I can enter 5 "+"'s to get to ddb,
 but once it hits the "done HYPERVISOR_reboot()" I can no longer get to
 ddb on the DOMU.

 Is HYPERVISOR_reboot() expected to return?  The next line in
 cpu_reset() is effectively: 

  for (;;);

 so I'm thinking not...

 Later...

 Greg Oster

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: gnats-bugs@NetBSD.org
Cc: port-xen-maintainer@netbsd.org, gnats-admin@netbsd.org,
        netbsd-bugs@netbsd.org, kre@munnari.OZ.AU
Subject: Re: port-xen/53965: XEN DomU fails to poweroff in new HEAD kernels
Date: Sat, 9 Feb 2019 19:11:44 +0100

 On Sat, Feb 09, 2019 at 05:40:01PM +0000, Greg Oster wrote:
 >  I'm seeing this with an 8.0_STABLE DOM0... I instrumented cpu_reset()
 >  with printfs before/after the call to HYPERVISOR_reboot():
 >  
 >  #ifdef XEN
 >          printf("calling HYPERVISOR_reboot()\n");
 >  	HYPERVISOR_reboot();
 >          printf("done HYPERVISOR_reboot()\n");
 >  #else
 >  
 >  and both are printed:
 >  [ 119.1643554] xbd1: detached
 >  [ 119.3838479] rebooting...
 >  [ 119.3838479] calling x86_disable_intr()
 >  [ 119.3838479] calling HYPERVISOR_reboot()
 >  [ 119.3838479] done HYPERVISOR_reboot()
 >  
 >  I note that if I do a 'shutdown -h' I can enter 5 "+"'s to get to ddb,
 >  but once it hits the "done HYPERVISOR_reboot()" I can no longer get to
 >  ddb on the DOMU.
 >  
 >  Is HYPERVISOR_reboot() expected to return?  The next line in

 I don't think it should, indeed.

 AFAIK shutdown -r always worked properly for me, even with 8.0.
 shutdown -p never did

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

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Robert Elz <kre@munnari.OZ.AU>
Cc: gnats-bugs@NetBSD.org, port-xen-maintainer@netbsd.org,
        gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-xen/53965: XEN DomU fails to poweroff in new HEAD kernels
Date: Sat, 9 Feb 2019 19:15:17 +0100

 On Sun, Feb 10, 2019 at 12:29:48AM +0700, Robert Elz wrote:
 >     Date:        Sat, 9 Feb 2019 17:36:37 +0100
 >     From:        Manuel Bouyer <bouyer@antioche.eu.org>
 >     Message-ID:  <20190209163637.GA3729@antioche.eu.org>
 > 
 > Thanks for the reply.
 > 
 >   | I wonder if it could be related to the recent Xen API version bump in our
 >   | source tree
 > 
 > If you could point me to an approximate time that happened, I could
 > try before and after kernels and see.

 It is:
 date: 2019/02/04 18:14:53;  

 From the commit log you should be able to add
 options         __XEN_INTERFACE_VERSION__=0x00030201 # Xen 3.1 interface

 to get the old API/ABI

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

From: Robert Elz <kre@munnari.OZ.AU>
To: Manuel Bouyer <bouyer@antioche.eu.org>
Cc: gnats-bugs@NetBSD.org, port-xen-maintainer@netbsd.org,
        gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-xen/53965: XEN DomU fails to poweroff in new HEAD kernels
Date: Sun, 10 Feb 2019 01:25:10 +0700

     Date:        Sat, 9 Feb 2019 19:11:44 +0100
     From:        Manuel Bouyer <bouyer@antioche.eu.org>
     Message-ID:  <20190209181144.GA3869@antioche.eu.org>

   | On Sat, Feb 09, 2019 at 05:40:01PM +0000, Greg Oster wrote:
   | >  I'm seeing this with an 8.0_STABLE DOM0... I instrumented cpu_reset()
   | >  with printfs before/after the call to HYPERVISOR_reboot():

 That's shutdown -r, right?   I don't have a real need for that,
 so I am not sure I ever tried.    But if I do what it says
 "hit any key to reboot", it doesn't...

    | Just tried a kernel from Jan 11, 2019, and it rebooted without incident....
    | Going to test a Jan 19 kernel next... 

 Sounds good, looks like the current issue might be affecting both
 HEAD and 8.0_STABLE (with any luck it is the same problem.)


 bouyer@antioche.eu.org said:
   |  AFAIK shutdown -r always worked properly for me, even with 8.0. shutdown -p
   | never did 

 shutdown -p has always worked for me.   Still does on my 8.0_STABLE
 test system - but that has a much older kernel still...

 netbsd# uname -a
 NetBSD netbsd.noi.kre.to 8.0_STABLE NetBSD 8.0_STABLE (MUNNARI-DomU) #37: Wed Nov 28 23:08:14 ICT 2018  kre@onyx.coe.psu.ac.th:/usr/obj/8/kernels/amd64/MUNNARI-DomU amd64
 netbsd# shutdown -p now
 Shutdown NOW!
 shutdown: [pid 420]
 netbsd# wall: You have write permission turned off; no reply possible

 *** FINAL System shutdown message from root@netbsd.noi.kre.to ***            
 System going down IMMEDIATELY                                                  


 Feb  9 18:15:00 netbsd shutdown: poweroff by root: 

 System shutdown time has arrived

 About to run shutdown hooks...
 Stopping cron.
 Stopping inetd.
 Saved entropy to /var/db/entropy-file.
 Sat Feb  9 18:15:03 UTC 2019

 Done running shutdown hooks.
 Feb  9 18:15:08 netbsd syslogd[189]: Exiting on signal 15
 syncing disks... done
 audio0: detached
 onyx# 

 (that is back at the sh prompt on the Dom0).

 I'll look see what intervening kernels I have lying around and try a
 few of them - but one big clue from Greg's message is that the change
 that matters is one that has been pulled up to -8 which should narrow
 the field a little.

 kre

From: Manuel Bouyer <bouyer@antioche.eu.org>
To: Robert Elz <kre@munnari.OZ.AU>
Cc: gnats-bugs@NetBSD.org, port-xen-maintainer@netbsd.org,
        gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-xen/53965: XEN DomU fails to poweroff in new HEAD kernels
Date: Sat, 9 Feb 2019 19:40:50 +0100

 On Sun, Feb 10, 2019 at 01:25:10AM +0700, Robert Elz wrote:
 > Sounds good, looks like the current issue might be affecting both
 > HEAD and 8.0_STABLE (with any luck it is the same problem.)
 > 
 > 
 > bouyer@antioche.eu.org said:
 >   |  AFAIK shutdown -r always worked properly for me, even with 8.0. shutdown -p
 >   | never did 
 > 
 > shutdown -p has always worked for me.   Still does on my 8.0_STABLE
 > test system - but that has a much older kernel still...
 > 
 > netbsd# uname -a
 > NetBSD netbsd.noi.kre.to 8.0_STABLE NetBSD 8.0_STABLE (MUNNARI-DomU) #37: Wed Nov 28 23:08:14 ICT 2018  kre@onyx.coe.psu.ac.th:/usr/obj/8/kernels/amd64/MUNNARI-DomU amd64

 that's a domU; I was talking about dom0.
 shutdown -p always worked in domUs for me, even with a 2-days old kernel
 (this is part of the daily anita run)

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

From: Greg Oster <oster@netbsd.org>
To: Robert Elz <kre@munnari.OZ.AU>
Cc: gnats-bugs@NetBSD.org, port-xen-maintainer@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-xen/53965: XEN DomU fails to poweroff in new HEAD kernels
Date: Sat, 9 Feb 2019 11:47:41 -0600

 On Sat,  9 Feb 2019 17:35:01 +0000 (UTC)
 Robert Elz <kre@munnari.OZ.AU> wrote:

 > The following reply was made to PR port-xen/53965; it has been noted
 > by GNATS.
 > 
 > From: Robert Elz <kre@munnari.OZ.AU>
 > To: Manuel Bouyer <bouyer@antioche.eu.org>
 > Cc: gnats-bugs@NetBSD.org, port-xen-maintainer@netbsd.org,
 >         gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
 > Subject: Re: port-xen/53965: XEN DomU fails to poweroff in new HEAD
 > kernels Date: Sun, 10 Feb 2019 00:29:48 +0700
 > 
 >      Date:        Sat, 9 Feb 2019 17:36:37 +0100
 >      From:        Manuel Bouyer <bouyer@antioche.eu.org>
 >      Message-ID:  <20190209163637.GA3729@antioche.eu.org>
 >  
 >  Thanks for the reply.
 >  
 >    | I wonder if it could be related to the recent Xen API version
 > bump in our | source tree
 >  
 >  If you could point me to an approximate time that happened, I could
 >  try before and after kernels and see.

 Just tried a kernel from Jan 11, 2019, and it rebooted without
 incident....  Going to test a Jan 19 kernel next...


 Later...

 Greg Oster

From: Greg Oster <oster@netbsd.org>
To: Robert Elz <kre@munnari.OZ.AU>
Cc: gnats-bugs@NetBSD.org, port-xen-maintainer@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, cherry@netbsd.org
Subject: Re: port-xen/53965: XEN DomU fails to poweroff in new HEAD kernels
Date: Sat, 9 Feb 2019 12:15:35 -0600

 On Sat, 9 Feb 2019 11:47:41 -0600
 Greg Oster <oster@netbsd.org> wrote:

 > On Sat,  9 Feb 2019 17:35:01 +0000 (UTC)
 > Robert Elz <kre@munnari.OZ.AU> wrote:
 > 
 > > The following reply was made to PR port-xen/53965; it has been noted
 > > by GNATS.
 > > 
 > > From: Robert Elz <kre@munnari.OZ.AU>
 > > To: Manuel Bouyer <bouyer@antioche.eu.org>
 > > Cc: gnats-bugs@NetBSD.org, port-xen-maintainer@netbsd.org,
 > >         gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
 > > Subject: Re: port-xen/53965: XEN DomU fails to poweroff in new HEAD
 > > kernels Date: Sun, 10 Feb 2019 00:29:48 +0700
 > > 
 > >      Date:        Sat, 9 Feb 2019 17:36:37 +0100
 > >      From:        Manuel Bouyer <bouyer@antioche.eu.org>
 > >      Message-ID:  <20190209163637.GA3729@antioche.eu.org>
 > >  
 > >  Thanks for the reply.
 > >  
 > >    | I wonder if it could be related to the recent Xen API version
 > > bump in our | source tree
 > >  
 > >  If you could point me to an approximate time that happened, I could
 > >  try before and after kernels and see.  
 > 
 > Just tried a kernel from Jan 11, 2019, and it rebooted without
 > incident....  Going to test a Jan 19 kernel next...
 >

 A kernel from Jan 31 works, but a kernel from Feb 3 doesn't.  The 

  Switch NetBSD/xen to use XEN api tag RELEASE-4.11.1

 happened on Feb 2....  Next question is: how to fix..

 Later...

 Greg Oster

From: Robert Elz <kre@munnari.OZ.AU>
To: Manuel Bouyer <bouyer@antioche.eu.org>
Cc: gnats-bugs@NetBSD.org, port-xen-maintainer@netbsd.org,
        gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-xen/53965: XEN DomU fails to poweroff in new HEAD kernels
Date: Sun, 10 Feb 2019 02:51:55 +0700

     Date:        Sat, 9 Feb 2019 19:40:50 +0100
     From:        Manuel Bouyer <bouyer@antioche.eu.org>
     Message-ID:  <20190209184050.GA6107@antioche.eu.org>

   | that's a domU; I was talking about dom0.

 OK, and yes, I think I remember that too ... it has been years since
 I wanted to shutdown my Dom0 (power outages are all that normally affect
 it) that I had almost forgotten that.

   | shutdown -p always worked in domUs for me, even with a 2-days old kernel
   | (this is part of the daily anita run)

 This is the case we're concerned with, and now I look at Greg's messages
 I see he meant a current DomU on an 8_STABLE Dom0.  So we're seeking
 the same thing, and it appears that you're right, and it is something
 from the API change, and that it needs to be altered.

 It should be easy to build with
 	options         __XEN_INTERFACE_VERSION__=0x00030201
 as you suggested, so I will try that.

 kre

From: Robert Elz <kre@munnari.OZ.AU>
To: Manuel Bouyer <bouyer@antioche.eu.org>
Cc: gnats-bugs@NetBSD.org, port-xen-maintainer@netbsd.org,
        gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: port-xen/53965: XEN DomU fails to poweroff in new HEAD kernels
Date: Sun, 10 Feb 2019 03:30:37 +0700

     Date:        Sat, 9 Feb 2019 19:15:17 +0100
     From:        Manuel Bouyer <bouyer@antioche.eu.org>
     Message-ID:  <20190209181517.GB3869@antioche.eu.org>

   | From the commit log you should be able to add
   | options         __XEN_INTERFACE_VERSION__=0x00030201 # Xen 3.1 interface
   |
   | to get the old API/ABI

 Tried that (using sources as they are on HEAD) - I still need to
 check to verify that everything was recompiled, but from whatching it
 fly past, it certainly looked to be, with the -D for that option
 included everywhere.

 It didn't change anything, the poweroff still did not happen.  After
 checking that the build was correct, I'll try using (kernel) sources
 from just before the rlevant checkin to verify that it worked immediately 
 before, and then see if I can see what particular code change is affecting
 things.

 Whatever happens, backwards compat is important, we need to find a way
 for a standard GENERIC XEN kernel to run (fully, including shutting down)
 on whatever version of XEN it happens to find itself booted on.

 kre

From: Cherry G.Mathew <cherry@zyx.in>
To: Greg Oster <oster@netbsd.org>
Cc: Robert Elz <kre@munnari.OZ.AU>, gnats-bugs@NetBSD.org,
  port-xen-maintainer@netbsd.org, gnats-admin@netbsd.org,
  netbsd-bugs@netbsd.org
Subject: Re: port-xen/53965: XEN DomU fails to poweroff in new HEAD kernels
Date: Sun, 10 Feb 2019 12:28:26 +0530

 Greg Oster <oster@netbsd.org> writes:

 > On Sat, 9 Feb 2019 11:47:41 -0600
 > Greg Oster <oster@netbsd.org> wrote:
 >
 >> On Sat,  9 Feb 2019 17:35:01 +0000 (UTC)
 >> Robert Elz <kre@munnari.OZ.AU> wrote:
 >> 
 >> > The following reply was made to PR port-xen/53965; it has been noted
 >> > by GNATS.
 >> > 
 >> > From: Robert Elz <kre@munnari.OZ.AU>
 >> > To: Manuel Bouyer <bouyer@antioche.eu.org>
 >> > Cc: gnats-bugs@NetBSD.org, port-xen-maintainer@netbsd.org,
 >> >         gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
 >> > Subject: Re: port-xen/53965: XEN DomU fails to poweroff in new HEAD
 >> > kernels Date: Sun, 10 Feb 2019 00:29:48 +0700
 >> > 
 >> >      Date:        Sat, 9 Feb 2019 17:36:37 +0100
 >> >      From:        Manuel Bouyer <bouyer@antioche.eu.org>
 >> >      Message-ID:  <20190209163637.GA3729@antioche.eu.org>
 >> >  
 >> >  Thanks for the reply.
 >> >  
 >> >    | I wonder if it could be related to the recent Xen API version
 >> > bump in our | source tree
 >> >  
 >> >  If you could point me to an approximate time that happened, I could
 >> >  try before and after kernels and see.  
 >> 
 >> Just tried a kernel from Jan 11, 2019, and it rebooted without
 >> incident....  Going to test a Jan 19 kernel next...
 >>
 >
 > A kernel from Jan 31 works, but a kernel from Feb 3 doesn't.  The 
 >
 >  Switch NetBSD/xen to use XEN api tag RELEASE-4.11.1
 >
 > happened on Feb 2....  Next question is: how to fix..
 >

 The problem is that we use the sched_op hypercall with what is now
 sched_op_compat arguments.

 I'm working on a fix, will commit it later today.

 Thanks for the alert.

 -- 
 ~cherry

From: "Cherry G. Mathew" <cherry@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/53965 CVS commit: src/sys/arch/xen/include
Date: Sun, 10 Feb 2019 11:10:34 +0000

 Module Name:	src
 Committed By:	cherry
 Date:		Sun Feb 10 11:10:34 UTC 2019

 Modified Files:
 	src/sys/arch/xen/include/amd64: hypercalls.h
 	src/sys/arch/xen/include/i386: hypercalls.h

 Log Message:
 Catchup hypercall interfaces for HYPERVISOR_sched_op which use
 arguments to __XEN_INTERFACE_VERSION__ >= 0x00030201

 We've been using the sched_op_compat API with sched_op arguments.

 fixes PR port-xen/53965


 To generate a diff of this commit:
 cvs rdiff -u -r1.11 -r1.12 src/sys/arch/xen/include/amd64/hypercalls.h
 cvs rdiff -u -r1.18 -r1.19 src/sys/arch/xen/include/i386/hypercalls.h

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

From: Cherry G.Mathew <cherry@zyx.in>
To: Greg Oster <oster@netbsd.org>
Cc: Robert Elz <kre@munnari.OZ.AU>, gnats-bugs@NetBSD.org,
  port-xen-maintainer@netbsd.org, gnats-admin@netbsd.org,
  netbsd-bugs@netbsd.org
Subject: Re: port-xen/53965: XEN DomU fails to poweroff in new HEAD kernels
Date: Sun, 10 Feb 2019 16:43:36 +0530

 Cherry G. Mathew <cherry@zyx.in> writes:

 > Greg Oster <oster@netbsd.org> writes:
 >
 >> On Sat, 9 Feb 2019 11:47:41 -0600
 >> Greg Oster <oster@netbsd.org> wrote:
 >>
 >>> On Sat,  9 Feb 2019 17:35:01 +0000 (UTC)
 >>> Robert Elz <kre@munnari.OZ.AU> wrote:
 >>> 
 >>> > The following reply was made to PR port-xen/53965; it has been noted
 >>> > by GNATS.
 >>> > 
 >>> > From: Robert Elz <kre@munnari.OZ.AU>
 >>> > To: Manuel Bouyer <bouyer@antioche.eu.org>
 >>> > Cc: gnats-bugs@NetBSD.org, port-xen-maintainer@netbsd.org,
 >>> >         gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
 >>> > Subject: Re: port-xen/53965: XEN DomU fails to poweroff in new HEAD
 >>> > kernels Date: Sun, 10 Feb 2019 00:29:48 +0700
 >>> > 
 >>> >      Date:        Sat, 9 Feb 2019 17:36:37 +0100
 >>> >      From:        Manuel Bouyer <bouyer@antioche.eu.org>
 >>> >      Message-ID:  <20190209163637.GA3729@antioche.eu.org>
 >>> >  
 >>> >  Thanks for the reply.
 >>> >  
 >>> >    | I wonder if it could be related to the recent Xen API version
 >>> > bump in our | source tree
 >>> >  
 >>> >  If you could point me to an approximate time that happened, I could
 >>> >  try before and after kernels and see.  
 >>> 
 >>> Just tried a kernel from Jan 11, 2019, and it rebooted without
 >>> incident....  Going to test a Jan 19 kernel next...
 >>>
 >>
 >> A kernel from Jan 31 works, but a kernel from Feb 3 doesn't.  The 
 >>
 >>  Switch NetBSD/xen to use XEN api tag RELEASE-4.11.1
 >>
 >> happened on Feb 2....  Next question is: how to fix..
 >>
 >
 > The problem is that we use the sched_op hypercall with what is now
 > sched_op_compat arguments.
 >
 > I'm working on a fix, will commit it later today.
 >
 > Thanks for the alert.

 Committed.

 http://mail-index.netbsd.org/source-changes/2019/02/10/msg103417.html

 -- 
 ~cherry

State-Changed-From-To: open->closed
State-Changed-By: kre@NetBSD.org
State-Changed-When: Sun, 10 Feb 2019 14:07:46 +0000
State-Changed-Why:
Thanks, that did indeed fix it.


From: Greg Oster <oster@netbsd.org>
To: "Cherry G.Mathew" <cherry@zyx.in>
Cc: Robert Elz <kre@munnari.OZ.AU>, gnats-bugs@NetBSD.org,
 port-xen-maintainer@netbsd.org, gnats-admin@netbsd.org,
 netbsd-bugs@netbsd.org
Subject: Re: port-xen/53965: XEN DomU fails to poweroff in new HEAD kernels
Date: Sun, 10 Feb 2019 14:32:55 -0600

 On Sun, 10 Feb 2019 16:43:36 +0530
 Cherry G.Mathew <cherry@zyx.in> wrote:

 > > The problem is that we use the sched_op hypercall with what is now
 > > sched_op_compat arguments.
 > >
 > > I'm working on a fix, will commit it later today.
 > >
 > > Thanks for the alert.  
 > 
 > Committed.
 > 
 > http://mail-index.netbsd.org/source-changes/2019/02/10/msg103417.html

 Thanks for the quick fix -- reboots work fine now!

 Later...

 Greg Oster

>Unformatted:
 	All this is from the system where I am doing the send-pr
 	and is unrelated to the system with the problem...

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.