NetBSD Problem Report #30027
From yamt@mwd.biglobe.ne.jp Fri Apr 22 01:55:14 2005
Return-Path: <yamt@mwd.biglobe.ne.jp>
Received: from yamt.dyndns.org (FLA1Abz230.kng.mesh.ad.jp [218.227.188.230])
by narn.netbsd.org (Postfix) with ESMTP id 311FC63B11A
for <gnats-bugs@gnats.NetBSD.org>; Fri, 22 Apr 2005 01:55:14 +0000 (UTC)
Message-Id: <1114134906.337993.812.nullmailer@yamt.dyndns.org>
Date: Fri, 22 Apr 2005 10:55:06 +0900
From: yamt@mwd.biglobe.ne.jp
Reply-To: yamt@mwd.biglobe.ne.jp
To: gnats-bugs@netbsd.org
Subject: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN abuses errno
X-Send-Pr-Version: 3.95
>Number: 30027
>Category: port-xen
>Synopsis: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN abuses errno
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: port-xen-maintainer
>State: closed
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Fri Apr 22 01:56:00 +0000 2005
>Closed-Date: Sun Jan 07 12:05:28 +0000 2007
>Last-Modified: Sun Jan 07 12:05:28 +0000 2007
>Originator: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
>Release: NetBSD 3.99.3
>Organization:
>Environment:
System: NetBSD kaeru 3.99.3 NetBSD 3.99.3 (build.kaeru.xen) #72: Thu Apr 21 12:18:08 JST 2005 takashi@kaeru:/usr/home/takashi/work/kernel/build.kaeru.xen i386
Architecture: i386
Machine: i386
>Description:
IOCTL_PRIVCMD_INITDOMAIN_EVTCHN abuses errno to return event channel.
>How-To-Repeat:
code inspection.
>Fix:
change to return the value via ap->a_data.
(and renumber the ioctl for backward compatibility?)
>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/30027: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN abuses errno
Date: Fri, 22 Apr 2005 21:00:48 +0200
On Fri, Apr 22, 2005 at 01:56:00AM +0000, yamt@mwd.biglobe.ne.jp wrote:
> >Environment:
>
>
> System: NetBSD kaeru 3.99.3 NetBSD 3.99.3 (build.kaeru.xen) #72: Thu Apr 21 12:18:08 JST 2005 takashi@kaeru:/usr/home/takashi/work/kernel/build.kaeru.xen i386
> Architecture: i386
> Machine: i386
> >Description:
> IOCTL_PRIVCMD_INITDOMAIN_EVTCHN abuses errno to return event channel.
Well, this is just the way it works on linux too. Changing this would also
mean changing the Xen tools. I don't want to add unecessary differrences
with linux domain0 here.
--
Manuel Bouyer <bouyer@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
To: gnats-bugs@netbsd.org
Cc: port-xen-maintainer@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: port-xen/30027: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN abuses errno
Date: Sat, 23 Apr 2005 22:34:27 +0900
> > >Description:
> > IOCTL_PRIVCMD_INITDOMAIN_EVTCHN abuses errno to return event channel.
>
> Well, this is just the way it works on linux too. Changing this would also
> mean changing the Xen tools. I don't want to add unecessary differrences
> with linux domain0 here.
we're already different from linux.
patch-ac in pkgsrc is for this difference.
YAMAMOTO Takashi
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/30027: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN abuses errno
Date: Sat, 23 Apr 2005 16:01:40 +0200
On Sat, Apr 23, 2005 at 01:35:01PM +0000, YAMAMOTO Takashi wrote:
> The following reply was made to PR port-xen/30027; it has been noted by GNATS.
>
> From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
> To: gnats-bugs@netbsd.org
> Cc: port-xen-maintainer@netbsd.org, gnats-admin@netbsd.org,
> netbsd-bugs@netbsd.org
> Subject: Re: port-xen/30027: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN abuses errno
> Date: Sat, 23 Apr 2005 22:34:27 +0900
>
> > > >Description:
> > > IOCTL_PRIVCMD_INITDOMAIN_EVTCHN abuses errno to return event channel.
> >
> > Well, this is just the way it works on linux too. Changing this would also
> > mean changing the Xen tools. I don't want to add unecessary differrences
> > with linux domain0 here.
>
> we're already different from linux.
> patch-ac in pkgsrc is for this difference.
Ha yes, I forgot I made this change, sorry.
But if we fix this we'll have a backward compat issue. I'm not sure how to
handle it.
--
Manuel Bouyer <bouyer@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
To: 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/30027: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN abuses errno
Date: Mon, 25 Apr 2005 11:16:22 +0900
> But if we fix this we'll have a backward compat issue. I'm not sure how to
> handle it.
isn't it enough to renumber the ioctl
(and keep the old one for compatibility if needed)?
YAMAMOTO Takashi
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
To: port-xen@netbsd.org
Cc: bouyer@antioche.eu.org
Subject: Re: port-xen/30027: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN abuses errno
Date: Thu, 19 May 2005 17:46:10 +0900
> > But if we fix this we'll have a backward compat issue. I'm not sure how to
> > handle it.
>
> isn't it enough to renumber the ioctl
> (and keep the old one for compatibility if needed)?
if no one objects, i'll
- change the ioctl as the following diff.
- then request pullup for netbsd-3.
- finally change xentools in pkgsrc.
YAMAMOTO Takashi
Index: arch/xen/include/xenio.h
===================================================================
--- arch/xen/include/xenio.h (revision 1082)
+++ arch/xen/include/xenio.h (working copy)
@@ -72,14 +72,11 @@ typedef struct privcmd_blkmsg
#define IOCTL_PRIVCMD_HYPERCALL \
_IOWR('P', 0, privcmd_hypercall_t)
-/*
- * @cmd: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN
- * @arg: n/a
- * Return: Port associated with domain-controller end of control event channel
- * for the initial domain.
- */
-#define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN \
+#if defined(_KERNEL)
+/* compat */
+#define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN_OLD \
_IO('P', 1)
+#endif /* defined(_KERNEL) */
#define IOCTL_PRIVCMD_MMAP \
_IOW('P', 2, privcmd_mmap_t)
@@ -87,6 +84,15 @@ typedef struct privcmd_blkmsg
_IOW('P', 3, privcmd_mmapbatch_t)
#define IOCTL_PRIVCMD_GET_MACH2PHYS_START_MFN \
_IOW('P', 4, unsigned long)
+
+/*
+ * @cmd: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN
+ * @arg: n/a
+ * Return: Port associated with domain-controller end of control event channel
+ * for the initial domain.
+ */
+#define IOCTL_PRIVCMD_INITDOMAIN_EVTCHN \
+ _IOR('P', 5, int)
/* Interface to /dev/xenevt */
/* EVTCHN_RESET: Clear and reinit the event buffer. Clear error condition. */
Index: arch/xen/xen/privcmd.c
===================================================================
--- arch/xen/xen/privcmd.c (revision 1082)
+++ arch/xen/xen/privcmd.c (working copy)
@@ -82,11 +82,20 @@ privcmd_ioctl(void *v)
: "=a" (error) : "0" (ap->a_data) : "memory" );
error = -error;
break;
- case IOCTL_PRIVCMD_INITDOMAIN_EVTCHN:
+#if 1 /* COMPAT_xxx */
+ case IOCTL_PRIVCMD_INITDOMAIN_EVTCHN_OLD:
{
extern int initdom_ctrlif_domcontroller_port;
error = initdom_ctrlif_domcontroller_port;
}
+ break;
+#endif
+ case IOCTL_PRIVCMD_INITDOMAIN_EVTCHN:
+ {
+ extern int initdom_ctrlif_domcontroller_port;
+ *(int *)ap->a_data = initdom_ctrlif_domcontroller_port;
+ }
+ error = 0;
break;
case IOCTL_PRIVCMD_MMAP:
{
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Cc: port-xen@netbsd.org, gnats-bugs@netbsd.org,
port-xen-maintainer@netbsd.org, gnats-admin@netbsd.org,
netbsd-bugs@netbsd.org
Subject: Re: port-xen/30027: IOCTL_PRIVCMD_INITDOMAIN_EVTCHN abuses errno
Date: Thu, 19 May 2005 11:45:20 +0200
On Thu, May 19, 2005 at 05:46:10PM +0900, YAMAMOTO Takashi wrote:
>
> if no one objects, i'll
> - change the ioctl as the following diff.
> - then request pullup for netbsd-3.
> - finally change xentools in pkgsrc.
>
> [...]
> - case IOCTL_PRIVCMD_INITDOMAIN_EVTCHN:
> +#if 1 /* COMPAT_xxx */
> + case IOCTL_PRIVCMD_INITDOMAIN_EVTCHN_OLD:
> {
I think you could define this as COMPAT_3 om current, and include it
unconditionally in netbsd-3.
Thanks for doing this !
--
Manuel Bouyer, LIP6, Universite Paris VI. Manuel.Bouyer@lip6.fr
NetBSD: 26 ans d'experience feront toujours la difference
--
From: YAMAMOTO Takashi <yamt@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: PR/30027 CVS commit: src/sys/arch/xen
Date: Tue, 24 May 2005 12:07:12 +0000 (UTC)
Module Name: src
Committed By: yamt
Date: Tue May 24 12:07:12 UTC 2005
Modified Files:
src/sys/arch/xen/include: xenio.h
src/sys/arch/xen/xen: privcmd.c
Log Message:
privcmd_ioctl: don't abuse errno for IOCTL_PRIVCMD_INITDOMAIN_EVTCHN.
renumber the ioctl and keep the old one for compatibility.
PR/30027.
To generate a diff of this commit:
cvs rdiff -r1.2 -r1.3 src/sys/arch/xen/include/xenio.h
cvs rdiff -r1.2 -r1.3 src/sys/arch/xen/xen/privcmd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: Matthias Scheler <tron@netbsd.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: PR/30027 CVS commit: [netbsd-3] src/sys/arch/xen
Date: Sat, 28 May 2005 13:52:42 +0000 (UTC)
Module Name: src
Committed By: tron
Date: Sat May 28 13:52:42 UTC 2005
Modified Files:
src/sys/arch/xen/include [netbsd-3]: xenio.h
src/sys/arch/xen/xen [netbsd-3]: privcmd.c
Log Message:
Pull up revision 1.3 (requested by yamt in ticket #351):
privcmd_ioctl: don't abuse errno for IOCTL_PRIVCMD_INITDOMAIN_EVTCHN.
renumber the ioctl and keep the old one for compatibility.
PR/30027.
To generate a diff of this commit:
cvs rdiff -r1.2 -r1.2.2.1 src/sys/arch/xen/include/xenio.h
cvs rdiff -r1.2 -r1.2.2.1 src/sys/arch/xen/xen/privcmd.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->closed
State-Changed-By: bouyer@netbsd.org
State-Changed-When: Sun, 07 Jan 2007 12:05:28 +0000
State-Changed-Why:
fixed by yamt on May 24 2005
>Unformatted:
(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.