Discussion:
what is _RP ?
E***@netscape.net
2005-08-31 19:43:05 UTC
Permalink
Hi,

Pardon my ignorance, what is _RP ?

Like in :
static int _RP connld_open(queue_t *, dev_t*, int, int, cred_t *);

in connld.c source and multiple other places.

Sorry, I cannot find definitions of that.

thanks,
--
Eugene


__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
Brian F. G. Bidulock
2005-08-31 20:36:18 UTC
Permalink
EugeneLisStreams,

Sometimes

#define _RP __attribute__((regparm(3)))

othertimes

#define _RP

Defined by Configure script.

--brian
Post by E***@netscape.net
Hi,
Pardon my ignorance, what is _RP ?
static int _RP connld_open(queue_t *, dev_t*, int, int, cred_t *);
in connld.c source and multiple other places.
Sorry, I cannot find definitions of that.
thanks,
--
Eugene
__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register
Netscape. Just the Net You Need.
New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
_______________________________________________
Linux-streams mailing list
http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams
--
Brian F. G. Bidulock ¦ The reasonable man adapts himself to the ¦
***@openss7.org ¦ world; the unreasonable one persists in ¦
http://www.openss7.org/ ¦ trying to adapt the world to himself. ¦
¦ Therefore all progress depends on the ¦
¦ unreasonable man. -- George Bernard Shaw ¦
E***@netscape.net
2005-08-31 23:05:49 UTC
Permalink
Brian,

1.
Does it mean I now have to append _RP before my mod_open(), mod_close()
and other functions from my driver which I use to populate qinit structure
in the same manner as LiS 2.18 does it before connld_open?

Like if 2.18 does:

static int _RP connld_open(queue_t *, dev_t*, int, int, cred_t *);

should I also do :

int _RP mymod_open(...);
?

2.

LiS does a good job of finding CC compilation options based on
info extracted from kernel and other sources.

When I compile my module for LiS I apparently need to use exactly
the same CC options that LiS has already found and used.

Is there any elegant way to 'steal' this CC options from LiS
so that I will not need to get into a trouble of finding
them from the kernel and sources again?

LiS could save them somewhere, so that I could take and use them?

thanks for your comments,
--
Eugene
Post by Brian F. G. Bidulock
EugeneLisStreams,
Sometimes
#define _RP __attribute__((regparm(3)))
othertimes
#define _RP
__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
Brian F. G. Bidulock
2005-09-01 14:47:03 UTC
Permalink
EugeneLisStreams,
Post by E***@netscape.net
Brian,
1.
Does it mean I now have to append _RP before my mod_open(), mod_close()
and other functions from my driver which I use to populate qinit structure
in the same manner as LiS 2.18 does it before connld_open?
static int _RP connld_open(queue_t *, dev_t*, int, int, cred_t *);
int _RP mymod_open(...);
?
Dunno. I defeated the entire _RP thing in the autoconf build. The
autoconf build properly detects kernel build parameters.
Post by E***@netscape.net
2.
LiS does a good job of finding CC compilation options based on
info extracted from kernel and other sources.
When I compile my module for LiS I apparently need to use exactly
the same CC options that LiS has already found and used.
Actually, it does a poor job. For 2.18.1 build I rip kernel flags
out of the kernel Makefiles with an autoconf macro.

Also, stock LiS is quite poor at handling distro kernels, because
it uses kernel.org version tests. The same autoconf macros I use
test kernel headers for specific patterns so adapt better to
production distro kernels that have various patches applied.
Post by E***@netscape.net
Is there any elegant way to 'steal' this CC options from LiS
so that I will not need to get into a trouble of finding
them from the kernel and sources again?
I use the same autoconf macros for building packages against LiS
and LfS.
Post by E***@netscape.net
LiS could save them somewhere, so that I could take and use them?
The autoconf build places them in a config.cache file.

--brian
Post by E***@netscape.net
thanks for your comments,
--
Eugene
Post by Brian F. G. Bidulock
EugeneLisStreams,
Sometimes
#define _RP __attribute__((regparm(3)))
othertimes
#define _RP
__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register
Netscape. Just the Net You Need.
New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
_______________________________________________
Linux-streams mailing list
http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams
--
Brian F. G. Bidulock ¦ The reasonable man adapts himself to the ¦
***@openss7.org ¦ world; the unreasonable one persists in ¦
http://www.openss7.org/ ¦ trying to adapt the world to himself. ¦
¦ Therefore all progress depends on the ¦
¦ unreasonable man. -- George Bernard Shaw ¦
Dan Gora
2005-09-01 17:07:30 UTC
Permalink
Eugene,

Are you using Brian's LiS or some other version?

Please note that my comments below are only relevant if you are not
using Brian's version. If you are then whatever Brian says about his
code goes since I've never seen it.
Post by Brian F. G. Bidulock
EugeneLisStreams,
Post by E***@netscape.net
Brian,
1.
Does it mean I now have to append _RP before my mod_open(),
mod_close()
Post by E***@netscape.net
and other functions from my driver which I use to populate qinit
structure
Post by E***@netscape.net
in the same manner as LiS 2.18 does it before connld_open?
No, in fact you should not. What these _RP macros do is to insulate
drivers and modules from kernels which are built with mregparm=3.
What this means is that since LiS _should_ be the only thing calling
kernel functions, it has to be built with the same mregparm settings
as the kernel. LiS functions which you call from your driver are
built with mregparm(0) so that all parameters are passed on the
stack. This means in theory that you only need one binary of your
driver to support kernels which use either mregparm=3 or mregparm=0,
however you need to explicitly set -mregparm=0 when you build your
driver.

SuSE 32 bit kernels use the -mregparm=3 while Red Hat 32 bit kernels
use -mregparm=0. 64 bit kernels have their own ABI so should not
have any -mregparm settings in either LiS nor your driver.

Also note that the easiest way to build your driver under 2.6 kernels
is to use the kernel's module build system which takes care of all of
the details of turning your .o into a .ko for inclusion into the
system.

Also note that you should not call any kernel functions directly.
You should only call LiS exported functions which have this _RP
coloring. This way you can just compile you driver/module with
-mregparm=0 and not have to worry if the kernel uses -mregparm=0 or
-mregparm=3. If you call a kernel function directly on a kernel
which uses -mregparm=3, then it will crash since that called
function's parameters will not be where the function expects them to
be.
Post by Brian F. G. Bidulock
Post by E***@netscape.net
static int _RP connld_open(queue_t *, dev_t*, int, int, cred_t
*);
Post by E***@netscape.net
int _RP mymod_open(...);
?
Dunno. I defeated the entire _RP thing in the autoconf build. The
autoconf build properly detects kernel build parameters.
The _RP thing is there for the reason that I explained above, to
insulate the user's driver from differences in the parameter passing
conventions of the kernel.
Post by Brian F. G. Bidulock
Post by E***@netscape.net
2.
LiS does a good job of finding CC compilation options based on
info extracted from kernel and other sources.
When I compile my module for LiS I apparently need to use exactly
the same CC options that LiS has already found and used.
Actually, it does a poor job. For 2.18.1 build I rip kernel flags
out of the kernel Makefiles with an autoconf macro.
No it doesn't. It works just fine.
Post by Brian F. G. Bidulock
Also, stock LiS is quite poor at handling distro kernels, because
it uses kernel.org version tests. The same autoconf macros I use
test kernel headers for specific patterns so adapt better to
production distro kernels that have various patches applied.
This is also not true. The version that I have works fine on all
SuSE and RH distros with 2.4 and 2.6 kernels. 32 and 64 bit.
Post by Brian F. G. Bidulock
Post by E***@netscape.net
Is there any elegant way to 'steal' this CC options from LiS
so that I will not need to get into a trouble of finding
them from the kernel and sources again?
I use the same autoconf macros for building packages against LiS
and LfS.
You don't need to steal anything if you are using my version. Just
use the kernel's module build Makefile and add -mregparam=0 to your
flags.
Post by Brian F. G. Bidulock
Post by E***@netscape.net
Post by Brian F. G. Bidulock
EugeneLisStreams,
Sometimes
#define _RP __attribute__((regparm(3)))
othertimes
#define _RP
This also is not true. For 2.6 kernels you get:

#define _RP __attribute__((regparm(0)))

For 2.4 kernels you get:

#define _RP


-Dan
e***@netscape.net
2006-02-02 17:18:16 UTC
Permalink
Post by Dan Gora
The version that I have works fine on all
SuSE and RH distros with 2.4 and 2.6 kernels. 32 and 64 bit.
Hello,

I plan to move my driver to 64-bit RH 2.6.9-5ELsmp.

I'd like to know if people on the list have experience with 64-bit RH
that they could share.

Looks like Dan have some good results with that.

The 1st problem I noticed it that Configure script cannot figure out if my system is SMP.
There seems to be special RH-oriented function in Configure:
# Red Hat helper for getting SMP info
rh_get_smp()
but I do not see who calls it.

Anyway, I'll appreciate any 64-bit experience in building and debugging.


--
Eugene




-----Original Message-----
From: Dan Gora <***@terra.com.br>
To: ***@netscape.net
Cc: linux-***@gsyc.escet.urjc.es
Sent: Thu, 1 Sep 2005 10:07:30 -0700 (PDT)
Subject: Re: [Linux-streams] what is _RP ?
...
Post by Dan Gora
The version that I have works fine on all
SuSE and RH distros with 2.4 and 2.6 kernels. 32 and 64 bit.
...
___________________________________________________
Try the New Netscape Mail Today!
Virtually Spam-Free | More Storage | Import Your Contact List
http://mail.netscape.com
E***@netscape.net
2005-09-01 17:42:43 UTC
Permalink
Post by Dan Gora
Eugene,
Are you using Brian's LiS or some other version?
Dan,

At the moment I use stock 2.18.0.
I may use your version of LiS later on.

I'll try your advice about using mregparm=0 and removing
_RP from my driver.
I may get back to you with further questions.

thanks,
--
Eugene


__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
E***@netscape.net
2005-09-01 20:20:24 UTC
Permalink
Post by Dan Gora
If you call a kernel function directly on a kernel
which uses -mregparm=3, then it will crash since that called
function's parameters will not be where the function expects them to
be.
The problem is that I do call pci_register_driver() directly.
I do not see any LiS equivalent for that one.
Is there any?

--
Eugene


__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
Dan Gora
2005-09-01 21:20:11 UTC
Permalink
Post by E***@netscape.net
Post by Dan Gora
If you call a kernel function directly on a kernel
which uses -mregparm=3, then it will crash since that called
function's parameters will not be where the function expects them
to
Post by Dan Gora
be.
The problem is that I do call pci_register_driver() directly.
I do not see any LiS equivalent for that one.
Is there any?
No there is not but I don't think that you need it. I don't use it.
I just use pci_enable_device, which is redef'd to an LiS function,
lis_pci_enable_device. Do you really need pci_register_driver?

dan
E***@netscape.net
2005-09-01 23:34:11 UTC
Permalink
Post by Dan Gora
Do you really need pci_register_driver?
This seems to be the only way to support hot-plugable devices.
Post by Dan Gora
Post by E***@netscape.net
Post by Dan Gora
If you call a kernel function directly on a kernel
which uses -mregparm=3, then it will crash since that called
function's parameters will not be where the function expects them
to
Post by Dan Gora
be.
The problem is that I do call pci_register_driver() directly.
I do not see any LiS equivalent for that one.
Is there any?
No there is not but I don't think that you need it.  I don't use it.
I just use pci_enable_device, which is redef'd to an LiS function,
lis_pci_enable_device.  Do you really need pci_register_driver?
dan
__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
Dan Gora
2005-09-02 17:03:23 UTC
Permalink
You'll have to add a wrapper function in LiS then.

dan
Post by E***@netscape.net
Post by Dan Gora
Do you really need pci_register_driver?
This seems to be the only way to support hot-plugable devices.
e***@netscape.net
2006-02-02 20:53:41 UTC
Permalink
Dan,

I reviewed maillist searching for 64 bit issues.

In one of e-mails you said you were considering sharing your 64 bit changes to LiS.

Can you share, please?

Maybe, just in general terms.

thanks,
--
Eugene

___________________________________________________
Try the New Netscape Mail Today!
Virtually Spam-Free | More Storage | Import Your Contact List
http://mail.netscape.com
Brian F. G. Bidulock
2005-09-02 19:09:48 UTC
Permalink
EugeneLisStreams,

You might be starting to understand why I defeated it. ;)

--brian
Post by E***@netscape.net
Post by Dan Gora
Do you really need pci_register_driver?
This seems to be the only way to support hot-plugable devices.
Post by Dan Gora
Post by E***@netscape.net
Post by Dan Gora
If you call a kernel function directly on a kernel
which uses -mregparm=3, then it will crash since that called
function's parameters will not be where the function expects them
to
Post by Dan Gora
be.
The problem is that I do call pci_register_driver() directly.
I do not see any LiS equivalent for that one.
Is there any?
No there is not but I don't think that you need it.  I don't use it.
I just use pci_enable_device, which is redef'd to an LiS function,
lis_pci_enable_device.  Do you really need pci_register_driver?
dan
__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register
Netscape. Just the Net You Need.
New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
_______________________________________________
Linux-streams mailing list
http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams
--
Brian F. G. Bidulock ¦ The reasonable man adapts himself to the ¦
***@openss7.org ¦ world; the unreasonable one persists in ¦
http://www.openss7.org/ ¦ trying to adapt the world to himself. ¦
¦ Therefore all progress depends on the ¦
¦ unreasonable man. -- George Bernard Shaw ¦
John Hodgkinson
2005-09-02 07:50:45 UTC
Permalink
Dear list,
You might consider this approach to calling kernel routines directly from
a driver in 2.6.

I reversed the logic so that the streams interface calls are defined as :-

STATIC void __attribute__ ((regparm(0)))rput(queue_t *q, mblk_t *mp);

But the driver is built with relevant -mregparm setting.

John


-----Original Message-----
From: ***@netscape.net [mailto:***@netscape.net]
Sent: 02 September 2005 00:34
To: ***@terra.com.br
Cc: linux-***@gsyc.escet.urjc.es
Subject: Re: [Linux-streams] what is _RP ?
Post by Dan Gora
Do you really need pci_register_driver?
This seems to be the only way to support hot-plugable devices.
Post by Dan Gora
Post by E***@netscape.net
Post by Dan Gora
If you call a kernel function directly on a kernel
which uses -mregparm=3, then it will crash since that called
function's parameters will not be where the function expects them
to
Post by Dan Gora
be.
The problem is that I do call pci_register_driver() directly.
I do not see any LiS equivalent for that one.
Is there any?
No there is not but I don't think that you need it.  I don't use it.
I just use pci_enable_device, which is redef'd to an LiS function,
lis_pci_enable_device.  Do you really need pci_register_driver?
dan
__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
Paul Landay
2006-02-03 13:25:05 UTC
Permalink
Post by e***@netscape.net
Hello,
I plan to move my driver to 64-bit RH 2.6.9-5ELsmp.
I'd like to know if people on the list have experience
with 64-bit RH that they could share.
Looks like Dan have some good results with that.
The 1st problem I noticed it that Configure script cannot figure out
if my system is SMP.
# Red Hat helper for getting SMP info
rh_get_smp()
but I do not see who calls it.
Anyway, I'll appreciate any 64-bit experience in
building and debugging.
Attached are three patches which we apply on top of the
LiS 2.18.0 from ftp.gcom.com. These patches allow us
to build and run on RHEL4 and SLES9 for ppc64 and s390x
(64bit) platforms. They also contain changes for the
x86_64 platform, but those have not been tested yet.

Before running the LiS 'make' we do this:
RHEL4:
ln -fs /usr/src/kernels/2.6.9-5.EL-smp-i686 /usr/src/linux
change the '2.6.9-5.EL-smp-i686' as needed
SLES9:
cd /usr/src/linux-2.6.5-7.xxx
change the '2.6.5-7.xxx' as needed
make cloneconfig
make modules_prepare

There are parts of those patches which you may not want
to use in your case, in particular the change to __SID
in stropts.h which was needed for s390x (IBM Mainframes).

Paul Landay
e***@netscape.net
2006-02-06 18:56:41 UTC
Permalink
Paul, thanks a lot for sharing,

A couple of questions:

1. The files you sent look like diffs, how should I use them?
should I manually copy the changes visible in those diffs
or there is some sort of semi-automatic way to do this?

2. Is there any logic in the way you placed those diffs in A,B,C files?
Or there is no special meaning in that.

3. My target platform is x86_64, you said there are some relevant changes in those
files, but they were not tested. Do you know of anything else x86_64 related that
I should pay attention to?


Again, thanks a lot for sharing,
--
Eugene


-----Original Message-----
From: Paul Landay <***@us.ibm.com>
To: ***@netscape.net; linux-***@gsyc.escet.urjc.es
Sent: Fri, 03 Feb 2006 08:25:05 -0500
Subject: [Linux-streams] RH 2.6 64-bit experience needed
Post by e***@netscape.net
Hello,
I plan to move my driver to 64-bit RH 2.6.9-5ELsmp.
I'd like to know if people on the list have experience
with 64-bit RH that they could share.
Looks like Dan have some good results with that.
The 1st problem I noticed it that Configure script cannot figure out > if my system is SMP.
# Red Hat helper for getting SMP info
rh_get_smp()
but I do not see who calls it.
Anyway, I'll appreciate any 64-bit experience in
building and debugging.
Attached are three patches which we apply on top of the
LiS 2.18.0 from ftp.gcom.com. These patches allow us
to build and run on RHEL4 and SLES9 for ppc64 and s390x
(64bit) platforms. They also contain changes for the
x86_64 platform, but those have not been tested yet.

Before running the LiS 'make' we do this:
RHEL4:
ln -fs /usr/src/kernels/2.6.9-5.EL-smp-i686 /usr/src/linux
change the '2.6.9-5.EL-smp-i686' as needed
SLES9:
cd /usr/src/linux-2.6.5-7.xxx
change the '2.6.5-7.xxx' as needed
make cloneconfig
make modules_prepare

There are parts of those patches which you may not want
to use in your case, in particular the change to __SID
in stropts.h which was needed for s390x (IBM Mainframes).

Paul Landay
___________________________________________________
Try the New Netscape Mail Today!
Virtually Spam-Free | More Storage | Import Your Contact List
http://mail.netscape.com
Brian F. G. Bidulock
2006-02-06 20:35:18 UTC
Permalink
Eugene,

I worked Paul's pp64 and xa_64 changes by hand over LiS 2.18.2 and will
release an LiS 2.18.3 in a day or so. There was problems with the xa_64
changes (they didn't compile) but I cleaned those up too. It does not
circumvent the fact that LiS locks up over 40 of the test suite test
cases on an SMP kernel, but I will release it anyway.

I don't believe that any changes are necessary for streams 0.7a.4, and
it, of course, does not lock up on any test cases.

I also have two bug fixes on strinet that I will release.

I also have a gentoo fix for the configuration script that was reported
earlier that applies to all packages.

I will announce the release here when it is done.

--brian
Post by e***@netscape.net
Paul, thanks a lot for sharing,
1. The files you sent look like diffs, how should I use them?
should I manually copy the changes visible in those diffs
or there is some sort of semi-automatic way to do this?
2. Is there any logic in the way you placed those diffs in A,B,C
files?
Or there is no special meaning in that.
3. My target platform is x86_64, you said there are some relevant
changes in those
files, but they were not tested. Do you know of anything else
x86_64 related that
I should pay attention to?
Again, thanks a lot for sharing,
--
Eugene
-----Original Message-----
Sent: Fri, 03 Feb 2006 08:25:05 -0500
Subject: [Linux-streams] RH 2.6 64-bit experience needed
Post by e***@netscape.net
Hello,
I plan to move my driver to 64-bit RH 2.6.9-5ELsmp.
I'd like to know if people on the list have experience
with 64-bit RH that they could share.
Looks like Dan have some good results with that.
The 1st problem I noticed it that Configure script cannot figure out
if my system is SMP.
# Red Hat helper for getting SMP info
rh_get_smp()
but I do not see who calls it.
Anyway, I'll appreciate any 64-bit experience in
building and debugging.
Attached are three patches which we apply on top of the
LiS 2.18.0 from [1]ftp.gcom.com. These patches allow us
to build and run on RHEL4 and SLES9 for ppc6 4 and s390x
(64bit) platforms. They also contain changes for the
x86_64 platform, but those have not been tested yet.
ln -fs /usr/src/kernels/2.6.9-5.EL-smp-i686 /usr/src/linux
change the '2.6.9-5.EL-smp-i686' as needed
cd /usr/src/linux-2.6.5-7.xxx
change the '2.6.5-7.xxx' as needed
make cloneconfig
make modules_prepare
There are parts of those patches which you may not want
to use in your case, in particular the change to __SID
in stropts.h which was needed for s390x (IBM Mainframes).
Paul Landay
_________________________________________________________________
Try the New Netscape Mail Today!
Virtually Spam-Free | More Storage | Import Your Contact List
[2]http://mail.netscape.com
References
1. http://ftp.gcom.com/
2. http://mail.netscape.com/
--
Brian F. G. Bidulock ¦ The reasonable man adapts himself to the ¦
***@openss7.org ¦ world; the unreasonable one persists in ¦
http://www.openss7.org/ ¦ trying to adapt the world to himself. ¦
¦ Therefore all progress depends on the ¦
¦ unreasonable man. -- George Bernard Shaw ¦
e***@netscape.net
2006-02-06 22:56:46 UTC
Permalink
Post by Brian F. G. Bidulock
I don't believe that any changes are necessary for streams 0.7a.4, and
it, of course, does not lock up on any test cases.
I plan to give it a try this week.
I'll keep you posted.

--
Eugene

___________________________________________________
Try the New Netscape Mail Today!
Virtually Spam-Free | More Storage | Import Your Contact List
http://mail.netscape.com
Paul Landay
2006-02-06 21:01:01 UTC
Permalink
They are patch files. You apply them with the 'patch' command.
For example:
Create the link from /usr/src/linux to /usr/src/kernels/xxx
as I described in the previous e-mail.
cd /usr/src
tar -xvf LiS-2.18.0.tgz
cd /usr/src/LiS-2.18
patch -g0 -p1 < LiS-2.18.0-A.patch
patch -g0 -p1 < LiS-2.18.0-B.patch
patch -g0 -p1 < LiS-2.18.0-C.patch
make
for sles9 say 'n' to the third prompt and enter the correct path
Do you intend to run LiS on this machine with
the currently running kernel? [default: y]
use defaults for all other prompts
make install

The A,B,C does imply the order in which they should be applied.
For x86_64 you should look at the LiS-2.18.0-C.patch file and
note the compile and link flags used for that platform. That
information comes from /usr/src/linux/arch/x86_64/Makefile

Paul Landay
e***@netscape.net
2006-02-06 22:54:46 UTC
Permalink
They are patch files. You apply them with the 'patch' command.
Got it.
The A,B,C does imply the order in which they should be applied.
Understand.

I'm not sure about the following change:
+#if (!defined(_S390_LIS_) && !defined(_S390X_LIS_) && !defined(_PPC64_LIS_) && !defined(_X86_64_LIS_))
retval = request_irq(devptr->irq, devptr->handler, 0, name, NULL);

This will remove request_irq() call from the compilation on x86_64, right?
So, what is used instead? I probably miss something again.

thanks,
--
Eugene


-----Original Message-----
From: Paul Landay <***@us.ibm.com>
To: ***@netscape.net
Cc: linux-***@gsyc.escet.urjc.es
Sent: Mon, 6 Feb 2006 16:01:01 -0500
Subject: Re: [Linux-streams] RH 2.6 64-bit experience needed


They are patch files. You apply them with the 'patch' command.
For example:
Create the link from /usr/src/linux to /usr/src/kernels/xxx
as I described in the previous e-mail.
cd /usr/src
tar -xvf LiS-2.18.0.tgz
cd /usr/src/LiS-2.18
patch -g0 -p1 < LiS-2.18.0-A.patch
patch -g0 -p1 < LiS-2.18.0-B.patch
patch -g0 -p1 < LiS-2.18.0-C.patch
make
for sles9 say 'n' to the third prompt and enter the correct path
Do you intend to run LiS on this machine with
the currently running kernel? [default: y]
use defaults for all other prompts
make install

The A,B,C does imply the order in which they should be applied.
For x86_64 you should look at the LiS-2.18.0-C.patch file and
note the compile and link flags used for that platform. That
information comes from /usr/src/linux/arch/x86_64/Makefile

Paul Landay
___________________________________________________
Try the New Netscape Mail Today!
Virtually Spam-Free | More Storage | Import Your Contact List
http://mail.netscape.com
Paul Landay
2006-02-07 11:47:42 UTC
Permalink
Post by e***@netscape.net
They are patch files. You apply them with the 'patch' command.
Got it.
The A,B,C does imply the order in which they should be applied.
Understand.
+#if (!defined(_S390_LIS_) && !defined(_S390X_LIS_) &&
!defined(_PPC64_LIS_) &&
Post by e***@netscape.net
!defined(_X86_64_LIS_))
retval = request_irq(devptr->irq, devptr->handler, 0, name, NULL);
This will remove request_irq() call from the compilation on x86_64, right?
So, what is used instead? I probably miss something again.
My use of LiS does not include real/physical adapters, so I don't
use any of the *pci* or *irq* calls. They don't exist on an s390
kernel, so that is where that #ifdef came from originally. I did
a blind extension of all my 64bit #ifdefs to include x86_64 and
this one got caught up in that sweep. The kernel symbol request_irq
does exist for RHEL4-x86_64, so that #ifdef should be fixed to
remove the conditional on x86_64 platforms. Sorry about that.
The same problem may exist for other #ifdefs in the 'C' patch.

Paul Landay
e***@netscape.net
2006-02-10 22:18:50 UTC
Permalink
Hello,

I made some progress with that.

When I do insmod I see the following messages:

redhat64 kernel: Trying to register duplicated ioctl32 handler 5309
redhat64 kernel: Trying to register duplicated ioctl32 handler 5306
redhat64 kernel: Trying to register duplicated ioctl32 handler 5302
redhat64 kernel: Trying to register duplicated ioctl32 handler 530c
redhat64 kernel: Trying to register duplicated ioctl32 handler 530d
redhat64 kernel: Trying to register duplicated ioctl32 handler 5308

Which apparently caused by :
lis_init_module()
{
...
#if (defined(_S390X_LIS_) || defined(_PPC64_LIS_) || defined(_X86_64_LIS_))
register_ioctl32_conversion(I_SETSIG,sys_ioctl);
register_ioctl32_conversion(I_SRDOPT,sys_ioctl);
register_ioctl32_conversion(I_PUSH,sys_ioctl);
register_ioctl32_conversion(I_LINK,sys_ioctl);
register_ioctl32_conversion(I_UNLINK,sys_ioctl);
register_ioctl32_conversion(I_STR,lis_ioctl32_str);
#endif
...
}

What is the significance of that ?

Am I in danger?

--
Eugene

___________________________________________________
Try the New Netscape Mail Today!
Virtually Spam-Free | More Storage | Import Your Contact List
http://mail.netscape.com
Paul Landay
2006-02-10 22:50:30 UTC
Permalink
I believe, if my memory is working right, that is the same
problem we saw on s390x which caused us to change the

#define __SID ...

in LiS/include/sys/gnu.stropts.h and LiS/include/sys/stropts.h
If you look at the patch(es) I sent, they redefine __SID to have
a higher starting/base value to avoid a collision with some
linux kernel defined ioctl. If you change __SID your LiS dependent
drivers have to be recompiled with that same __SID.

If you took the __SID part out of the patch, try putting it
back in. I don't have easy access to a RHEL4-x86_64 system
right now, but I should be able to check this out more early
next week if that suggestion does not help.





eugenelisstreams@
netscape.net
To
02/10/2006 05:18 Paul Landay/Raleigh/***@IBMUS
PM cc
linux-***@gsyc.escet.urjc.es
Subject
Re: [Linux-streams] RH 2.6 64-bit
experience needed (..duplicated
ioctl32 handler )
Post by e***@netscape.net
I made some progress with that.
redhat64 kernel: Trying to register duplicated ioctl32 handler 5309
redhat64 kernel: Trying to register duplicated ioctl32 handler 5306
redhat64 kernel: Trying to register duplicated ioctl32 handler 5302
redhat64 kernel: Trying to register duplicated ioctl32 handler 530c
redhat64 kernel: Trying to register duplicated ioctl32 handler 530d
redhat64 kernel: Trying to register duplicated ioctl32 handler 5308
lis_init_module()
{
...
#if (defined(_S390X_LIS_) || defined(_PPC64_LIS_) ||
defined(_X86_64_LIS_))
Post by e***@netscape.net
register_ioctl32_conversion(I_SETSIG,sys_ioctl);
register_ioctl32_conversion(I_SRDOPT,sys_ioctl);
register_ioctl32_conversion(I_PUSH,sys_ioctl);
r>egister_ioctl32_conversion(I_LINK,sys_ioctl);
register_ioctl32_conversion(I_UNLINK,sys_ioctl);
register_ioctl32_conversion(I_STR,lis_ioctl32_str);
#endif
What is the significance of that ?
Am I in danger?
Eugene
e***@netscape.net
2006-03-10 22:12:25 UTC
Permalink
Hi,

I'm debugging 32-bit ioctls over 64-bit LiS/kernel.

It works most of the time, but then it crashes due to memory corruption
in the lis_ioctl32_str() function.

The allocated memory, saved in datap pointer:
datap = ALLOCF(par64.ic_len+32,"ioctl32 ");

may get corrupted after sys_ioctl() call.

To catch corruption, I have added check guard calls before and after sys_ioctl() calls:

lis_check_guard(datap, "---- before sys_ioctl\n");

rc = sys_ioctl(fd,cmd,(unsigned long)&par64);

lis_check_guard(datap, "---- after sys_ioctl\n");

The '---after sys_ioctl' check guard call indicates memory corruption.


I looked through sources but cannot find the bug.

Seems like memory pointed by datap will be memcpy'ied into streams message
in lis_strioctl/lis_strdoioctl later on and should be unaffected by further processing
in underlying drivers.

Or do I miss something here?

--
Eugene



___________________________________________________
Try the New Netscape Mail Today!
Virtually Spam-Free | More Storage | Import Your Contact List
http://mail.netscape.com
Brian F. G. Bidulock
2006-03-16 12:48:49 UTC
Permalink
Eugene,

You must pass sys_ioctl a user address not a kernel address. You can
set KERNEL_DS across the call to sys_ioctl(), but then *all* addresses
must be kernel addresses (including iocp->ic_dp), which means you will
have to copy the entire buffer in and then back out again.

I notices that the dlpi.h and npi.h header files in 2.18.0 are broken.
They use long instead of int32_t or t_scalar_t in many places.
Therefore, all 32/64-bit compatibility of networking is broken in
2.18.0. These headers could be fixed (as they are in 2.18.2) but then
binary compatibility with 2.18.0 breaks.

I have just announced a version of Linux Fast-STREAMS, STREAMS XNS,
XTI/TLI, and INET that have validated 32/64-bit compatibility. I ran
the 600 odd test cases in the POSIX test suite and the 1000 odd libxnet
and inet TPI test cases 32-bit over a 64-bit kernel (x86_64 on HT PIV
630) an passed them all. (LiS can't even pass them all 32/32-bit!).

At the same time I noticed that LiS fails even more test cases 64/64-bit
than 32/32-bit, and locks the machine good on SMP for even more test
cases (with HT enabled on the 630). I'm sorry but LiS is really too
broken to salvage.

--brian
Post by e***@netscape.net
Hi,
I'm debugging 32-bit ioctls over 64-bit LiS/kernel.
It works most of the time, but then it crashes due to memory
corruption
in the lis_ioctl32_str() function.
datap = ALLOCF(par64.ic_len+32,"ioctl32 ");
may get corrupted after sys_ioctl() call.
To catch corruption, I have added check guard calls before and after
lis_check_guard(datap, "---- before sys_ioctl\n");
rc = sys_ioctl(fd,cmd,(unsigned long)&par64);
lis_check_guard(datap, "---- after sys_ioctl\n");
The '---after sys_ioctl' check guard call indicates memory corruption.
I looked through sources but cannot find the bug.
Seems like memory pointed by datap will be memcpy'ied into streams
message
in lis_strioctl/lis_strdoioctl later on and should be unaffected by
further processing
in underlying drivers.
Or do I miss something here?
--
Eugene
_________________________________________________________________
Try the New Netscape Mail Today!
Virtually Spam-Free | More Storage | Import Your Contact List
[1]http://mail.netscape.com
References
1. http://mail.netscape.com/
--
Brian F. G. Bidulock ¦ The reasonable man adapts himself to the ¦
***@openss7.org ¦ world; the unreasonable one persists in ¦
http://www.openss7.org/ ¦ trying to adapt the world to himself. ¦
¦ Therefore all progress depends on the ¦
¦ unreasonable man. -- George Bernard Shaw ¦
e***@netscape.net
2006-03-16 23:37:19 UTC
Permalink
Brian,

Couple of questions.

Is it possible to link my modules with resulting LFS module so that
it will be one piece only? In the same manner as we can do with LiS.

Can you tell if LFS is being run by anyone in some real commercial environment.
On openss7 website it is designated as alpha, if I'm not mistaken.
So I'm just curious if LFS is industrial strength kind of software?

--
Eugene



Try the New Netscape Mail Today!
Virtually Spam-Free | More Storage | Import Your Contact List
http://mail.netscape.com
___________________________________________________
Try the New Netscape Mail Today!
Virtually Spam-Free | More Storage | Import Your Contact List
http://mail.netscape.com
Brian F. G. Bidulock
2006-03-17 00:07:51 UTC
Permalink
Eugene,
Post by E***@netscape.net
Brian,
Couple of questions.
Is it possible to link my modules with resulting LFS module so that
it will be one piece only? In the same manner as we can do with LiS.
That is what the strbcm package I started would do. In fact you could
link LiS 2.18.0 objects to Linux Fast-STREAMS too! The current approach
is slightly different than LiS: it generates a loadable kernel module
wrapper from the Config file, compiles the wrapper for the current
system and links the binary object with that wrapper and generates a
proper (.ko on 2.6) separate loadable kernel module. It also creates
and installs init scripts for device generation and module loading, if
you choose not to mount the specfs device filesystem.

Why do you want to do this? Are you looking for a release mechanism
whereby your users download some software and follow simple instructions
to add your object module and relink it for their system? If that's the
case the BCM package can do this.
Post by E***@netscape.net
Can you tell if LFS is being run by anyone in some real commercial
environment.
Yes. It is being run in a telecommunications environment in the field.
Post by E***@netscape.net
On openss7 website it is designated as alpha, if I'm not mistaken.
The current release (0.7a.5) is beta. See

http://www.openss7.org/codefiles/streams-0.7a.5/README-alpha

The characteristics of OpenSS7 Project beta releases is described there
(tested, but not rigorously on all platforms and distributions).
Post by E***@netscape.net
So I'm just curious if LFS is industrial strength kind of software?
It is far more industrial strength than the alternative, LiS. When the
software is in gamma release it can be validated for your target (or
your users can run the validation for their own target) to be fully
industrial strength.

The OpenSS7 Project's concept of industrial strength and that of other
OSS projects probably differ radically. OpenSS7 considers something
stable only when it has been proven stable with testing. See

http://www.openss7.org/STREAMS_manual.html#Maturity

for a discussion on software maturity and release philosophy under the
OpenSS7 Project. This is beta software. It is more stable that LiS on
all platforms. It is more stable that many OSS project's release
software.

Our LiS 2.18.3 release is unstable alpha (because it contains known
problems of a critical nature: i.e. kernel locks and crashes).

Some of the other releases are alpha release simply because I have not
had the time to run the regression tests on all distros and platforms.

--brian
Post by E***@netscape.net
--
Eugene
_________________________________________________________________
Try the New Netscape Mail Today!
Virtually Spam-Free | More Storage | Import Your Contact List
[1]http://mail.netscape.com
References
1. http://mail.netscape.com/
--
Brian F. G. Bidulock ¦ The reasonable man adapts himself to the ¦
***@openss7.org ¦ world; the unreasonable one persists in ¦
http://www.openss7.org/ ¦ trying to adapt the world to himself. ¦
¦ Therefore all progress depends on the ¦
¦ unreasonable man. -- George Bernard Shaw ¦
Paul Landay
2006-02-12 12:26:47 UTC
Permalink
I found a RHEL4-x86_64 system to try this one and my
memory was (mostly) correct. The change to __SID in
LiS/include/sys/gnu.stropts.h and LiS/include/sys/stropts.h
in the patches I sent 03 Feb 2006 08:25:05 does fix
this issue. The part I forgot was that you should have
the stropts.h '#define STR' match that of the __SID values.

To be specific, these are the changes:
"include/sys/stropts.h"
#define __SID (0xdc<<8) /* for GNU libc
#define STR (0xdc<<8) /* for UnixWare
"include/sys/gnu.stropts.h"
#define __SID (0xdc<< 8)

I don't recall how we selected the 0xdc base offset value,
but it has proven to work for rhel3,rhel4,sles8,sles8 on
i686,s390,s390x,ppc64,x86_64.

This change means you to have to recompile any of your LiS
dependent code, but since x86_64 is new for you that should
not be a big problem. If you need to maintain binary
compatibility with old modules on old platforms you can
#ifdef the '#define _SID' and '#define STR' to use different
values for different platforms.

Paul Landay
Brian F. G. Bidulock
2006-02-13 11:11:38 UTC
Permalink
Paul,

I too looked at this over the weekend. Here's what I
discovered:

- linux 2.6 and later linux 2.4 kernels provide 32-bit to 64-bit ioctl
conversions. Earlier linux 2.4 kernels provide some 32 to 64 bit
ioctl conversions on a architecture by architecture basis, but the
supported ioctl list is sparse.

- the legacy CDROM driver ioctl interface uses 'S' as the magic number
for its ioctls. The SCSI driver also uses 'S' as the magic number of
some of its ioctls. Some CDROM driver ioctls conflict even with SCSI
ioctls.

- register_ioctl32_conversion and unregister_ioctl32_conversion was
added somewhere between 2.4.18 and 2.4.20. CDROM ioctls were also
added somewhere between 2.4.18 and 2.4.20. All 2.6 kernel have it.
The functions refuse to register a conversion that has already been
specified and refuse to unregister a "base" definition (one specified
for the architecture in the kernel, such as the CDROM conversions).

- as of 2.6.11, a new file operation (compat_ioctl) was added to
perform device specific 32 to 64 bit conversions.

Here is a little precedent for the use of 'S':

- STR is defined as ('S'<<8) in Fourth edition of the i386 ABI.
("System V Application Binary Interface -- Intel386(TM) Architecture
Processor Supplement")

- STR is defined as ('S'<<8) in the Third edition of the MIPS ABI.
("System V Application Binary Interface -- MIPS(R) RISC Processor
Supplement").

- The ARM ABI follows i386 in this regard.

- The X86_64 ABI ("System V Application Binary Interface -- x86_64(TM)
Architecture Processor Supplement") indicates that the 32-bit CAE
must conform to the i386 ABI and regarding the stropts.h header, that
it is unchanged from the i386 ABI.

- GNU glibc header files <sys/stropts.h> conforms to these ABIs and in
fact provides ('S'<<8) for all architectures including S390.

- Original AT&T SVR4 header (of course) use 'S'.
- OSF/1 Release 1.1 headers use 'S'.
- OSF/1 Release 1.2 headers use 'S'.
- Solaris 2.6 headers use 'S'.
- Solaris 2.7 headers use 'S'.
- SUSv3/POSIX 2003 does not specify a magic number

- It is noted in the iBCS (now LinuxABI) package that 'S' is used for
all architectures, but that SCO 3.2.x (x<4) set the high bit in a
conflicting ioctl. (You say that you cannot remember why you chose
0xdc. Probably 0xd3 would have been a better choice: it is 'S'
(0x53) with the high bit set.)

With regard to the current state of S390X ifdefs in 2.18.0 (that your
patch suggests also be applied to x86_64):

- The list of registered ioctls currently includes I_SETSIG, I_SRDOPT,
I_PUSH, I_LINK, I_UNLINK, and I_STR. (head/linux-mdep.c) All but
I_STR simply call sys_ioctl (i.e. no conversion).

- 2.4 kernels without register_ioctl32_conversion will fail to build.
(But then older 2.4 kernels don't really support 32 over 64 anyway.)

- The conversion registration will always fail if STR is defined as
('S'<<8) because the CDROM/SCSI ioctls using 'S' conflict with almost
all standard STREAMS ioctls.

- 2.4 kernels with register_ioctl32_conversion and 2.6 kernels will
fail [EINVAL] on all ioctls other than the six listed above, because
the default is to fail. This means that the following ioctls will
fail (even with STR defined to 0xdc):

I_NREAD, I_POP, I_LOOK, I_FLUSH, I_GRDOPT, I_GETSIG, I_FIND,
I_ISASTREAM, I_RECVFD, I_PEEK, I_FDINSERT, I_SENDFD, I_E_RECVFD,
I_SWROPT, I_GWROPT, I_LIST, I_PLINK, I_PUNLINK, I_FLUSHBAND,
I_CKBAND, I_GETBAND, I_ATMARK, I_SETCLTIME, I_GETCLTIME, I_CANPUT,
I_SERROPT, I_GERROPT, I_ANCHOR, I_ESETSIG, I_EGETSIG, I_S_RECVFD,
I_STATS, I_BIGPIPE, I_GETTP, I_TILDE, I_GETMSG, I_PUTMSG, I_GETPMSG,
I_PUTPMSG, I_PIPE, I_FIFO, I_POLL, I_SETDELAY, I_GETDELAY,
I_RUN_QUEUES, I_AUTOPUSH, I_HEAD_REPORT, I_FATTACH, I_FDETACH,
I_LIS_PIPE, I_LIS_FATTACH, I_LIS_FDETACH, I_LIS_GETPMSG,
I_LIS_PUTPMSG, I_LIS_SEMTIME, I_LIS_LOCKS, I_LIS_SDBGMSK2,
I_LIS_QRUN_STATS, I_LIS_PRNTQUEUES, I_LIS_PRNTSPL,
I_LIS_GET_MAXMSGMEM, I_LIS_SET_MAXMSGMEM, I_LIS_GET_MAXMEM,
I_LIS_SET_MAXMEM, I_LIS_GETSTATS, I_LIS_PRNTSTRM, I_LIS_PRNTMEM,
I_LIS_SDBGMSK.

Many of these are required for standard operation as well as required
for proper operation of 32 bit applications programs using the
STREAMS ioctl(2p) interface.

Even getmsg/putmsg will break on 2.6.11+ kernels because the ioctl
interface must be used for getpmsg/putpmsg instead of the read/write
interface. isastream() will also report that a Stream is not a
Stream (because it uses I_CANPUT, which will fail).

Changing STR from ('S'<<8) to 0xdc for x86_64 has the following
consequences:

- STREAMS will no longer comply with the SVID, i386 or x86_64 ABIs.
This means that any legacy applications will fail to run. Also,
any applications compiled against standard headers <stropts.h> will
also fail.

- Any driver that passes STREAMS messages to peripheral hardware (or
directly to another system) based on a standard STREAMS
implementation will also fail.

(This was the major reason for changing the message type number
(M_PROTO, M_DATA, etc.) in 2.18.0 which I notice that your patch
LiS-2.18.0-A changes back to 2.16 LiS numbering for some reason. The
numbering of message types in 2.18.0 was placed as close to other
STREAMS implementations as possible to permit STREAMS message to be
passed directly between systems.)

- For kernels 2.6.11 and greater, there is no need to change STR
because compat_ioctl file operation can do device specific conversion
and there will be no conflict with the legacy base CDROM/SCSI ioctls.

There is just too much precedent for 'S'. Therefore, I propose the
following for the next LiS (LiS-2.18.3) and Linux Fast-STREAMS
(streams-0.7a.5) release:

- For LiS I will rip the ioctl conversion hash table and the cdrom
conversion functions from the system map and override the CDROM
ioctls with a function that checks for character or block device and
then either calls the CDROM conversion or calls the STREAMS
conversions.

- For Linux Fast-STREAMS I will take the same approach before kernel
2.6.11. For kernel 2.6.11 and beyond I will define the compat_ioctl
file operation to perform device specific conversions. (LiS cannot
handle unlocked ioctls so this approach is pointless for LiS.)

- Using either approach, I will define conversions for ALL defined
ioctls, not just the six.

How does that sound?

--brian
Post by Paul Landay
I found a RHEL4-x86_64 system to try this one and my
memory was (mostly) correct. The change to __SID in
LiS/include/sys/gnu.stropts.h and LiS/include/sys/stropts.h
in the patches I sent 03 Feb 2006 08:25:05 does fix
this issue. The part I forgot was that you should have
the stropts.h '#define STR' match that of the __SID values.
"include/sys/stropts.h"
#define __SID (0xdc<<8) /* for GNU libc
#define STR (0xdc<<8) /* for UnixWare
"include/sys/gnu.stropts.h"
#define __SID (0xdc<< 8)
I don't recall how we selected the 0xdc base offset value,
but it has proven to work for rhel3,rhel4,sles8,sles8 on
i686,s390,s390x,ppc64,x86_64.
This change means you to have to recompile any of your LiS
dependent code, but since x86_64 is new for you that should
not be a big problem. If you need to maintain binary
compatibility with old modules on old platforms you can
#ifdef the '#define _SID' and '#define STR' to use different
values for different platforms.
Paul Landay
_______________________________________________
Linux-streams mailing list
http://gsyc.escet.urjc.es/mailman/listinfo/linux-streams
--
Brian F. G. Bidulock ¦ The reasonable man adapts himself to the ¦
***@openss7.org ¦ world; the unreasonable one persists in ¦
http://www.openss7.org/ ¦ trying to adapt the world to himself. ¦
¦ Therefore all progress depends on the ¦
¦ unreasonable man. -- George Bernard Shaw ¦
Steve Schefter
2006-02-13 16:46:46 UTC
Permalink
Post by Brian F. G. Bidulock
- For LiS I will rip the ioctl conversion hash table and the cdrom
conversion functions from the system map and override the CDROM
ioctls with a function that checks for character or block device and
then either calls the CDROM conversion or calls the STREAMS
conversions.
- For Linux Fast-STREAMS I will take the same approach before kernel
2.6.11. For kernel 2.6.11 and beyond I will define the compat_ioctl
file operation to perform device specific conversions. (LiS cannot
handle unlocked ioctls so this approach is pointless for LiS.)
Why does LiS need the kernel lock for ioctls?

What about using compat_ioctl() for LiS and have the underlying function
grab the kernel lock before it does anything else?

Steve

------------------------------------------------------------------------
Steve Schefter phone: +1 705 725 9999 x26
The Software Group Limited fax: +1 705 725 9666
642 Welham Road, email: ***@wanware.com
Barrie, Ontario CANADA L4N 9A1 Web: www.wanware.com
Brian F. G. Bidulock
2006-02-13 21:07:02 UTC
Permalink
Steve,
Post by Steve Schefter
Post by Brian F. G. Bidulock
- For LiS I will rip the ioctl conversion hash table and the cdrom
conversion functions from the system map and override the CDROM
ioctls with a function that checks for character or block device and
then either calls the CDROM conversion or calls the STREAMS
conversions.
- For Linux Fast-STREAMS I will take the same approach before kernel
2.6.11. For kernel 2.6.11 and beyond I will define the compat_ioctl
file operation to perform device specific conversions. (LiS cannot
handle unlocked ioctls so this approach is pointless for LiS.)
Why does LiS need the kernel lock for ioctls?
Because it is has many races, is not thread safe, and locks on SMP
kernels. Running unlocked ioctls would like introduce an additional
set of problems in this regard that might negatively affect existing
drivers.
Post by Steve Schefter
What about using compat_ioctl() for LiS and have the underlying function
grab the kernel lock before it does anything else?
Because the locked ioctl path does not need to release the kernel lock
in the first place. Also because I don't care to do too much work on
LiS as Linux Fast-STREAMS is superior.

Besides, the RH EL4 2.6.9 kernel is here to stay for quite a while and it
does not support compat_ioctl.

Do you think it really makes that much difference?

--brian
--
Brian F. G. Bidulock ¦ The reasonable man adapts himself to the ¦
***@openss7.org ¦ world; the unreasonable one persists in ¦
http://www.openss7.org/ ¦ trying to adapt the world to himself. ¦
¦ Therefore all progress depends on the ¦
¦ unreasonable man. -- George Bernard Shaw ¦
Steve Schefter
2006-02-13 21:40:55 UTC
Permalink
Post by Brian F. G. Bidulock
Because it is has many races, is not thread safe, and locks on SMP
kernels. Running unlocked ioctls would like introduce an additional
set of problems in this regard that might negatively affect existing
drivers.
Thanks Brian. I had mis-guessed from your last e-mail that the use
of the kernel lock around the LiS ioctl was by specific design and wanted
to understand that design.
Post by Brian F. G. Bidulock
Post by Steve Schefter
What about using compat_ioctl() for LiS and have the underlying function
grab the kernel lock before it does anything else?
Because the locked ioctl path does not need to release the kernel lock
in the first place.
I don't think I follow this one. I was wondering about the idea of
adding the acquiring/releasing of the kernel lock around the
compat_ioctl(), not the locked ioctl path. Given the above, I guess
it's moot now.
Post by Brian F. G. Bidulock
Also because I don't care to do too much work on
LiS as Linux Fast-STREAMS is superior.
Just looking for information, not code.
Post by Brian F. G. Bidulock
Besides, the RH EL4 2.6.9 kernel is here to stay for quite a while and it
does not support compat_ioctl.
Ah, I didn't know that. I was aiming to use compat_ioctl() since
register_ioctl32_conversion() is deprecated and sheduled for removal
(though it's already past the scheduled date).

Steve

------------------------------------------------------------------------
Steve Schefter phone: +1 705 725 9999 x26
The Software Group Limited fax: +1 705 725 9666
642 Welham Road, email: ***@wanware.com
Barrie, Ontario CANADA L4N 9A1 Web: www.wanware.com
e***@netscape.net
2006-02-21 22:49:24 UTC
Permalink
Post by Brian F. G. Bidulock
- For LiS I will rip the ioctl conversion hash table and the cdrom
conversion functions from the system map and override the CDROM
ioctls with a function that checks for character or block device and
then either calls the CDROM conversion or calls the STREAMS
conversions.
How does that sound?
That sounds rather heavy.

I'm wondering if there is simpler way of fixing that problem.

Anyhow, did you have a chance to implement and test that fix?

Are there a lot of changes?

--
Eugene





___________________________________________________
Try the New Netscape Mail Today!
Virtually Spam-Free | More Storage | Import Your Contact List
http://mail.netscape.com
Brian F. G. Bidulock
2006-02-21 23:29:34 UTC
Permalink
Eugene,

Yes, I got an P4 630 EM64T box with HT. I have Linux Fast-STREAMS
running 64-bit clean, and the other packages compiling clean on
x86_64. I'm just fixing a problem in the testsuite for SMP and the
package will run on x86_64 full 64 bit _and_ SMP.

Here's what I've done so far, so the changes are fairly widespread:

.indent.pro | 1
.pkgrelease | 2
AUTHORS | 6
ChangeLog | 117 +++-
NEWS | 22
README | 58 --
THANKS | 11
TODO | 202 +++++--
acinclude.m4 | 6
doc/man/man9/iocblk.9.man | 12
include/Makefile.am | 6
include/sys/streams/ddi.h | 19
include/sys/streams/kmem.h | 19
include/sys/streams/sad.h | 32 -
include/sys/streams/sc.h | 48 +
include/sys/streams/stream.h | 19
include/sys/streams/strlog.h | 81 ++
include/sys/streams/stropts.h | 23
include/sys/streams/stropts32.h | 124 ++++
include/sys/streams/strsubr.h | 31 -
include/sys/stropts32.h | 79 ++
m4/dist.m4 | 20
m4/kernel.m4 | 10
src/.indent.pro | 1
src/kernel/specfs.c | 21
src/kernel/streams.c | 21
src/kernel/strprocfs.c | 156 +++--
src/kernel/strsched.c | 120 ++--
src/kernel/strsysctl.c | 89 +--
src/kernel/strsysctl.h | 56 +-
src/kernel/strutil.c | 21
src/modules/sc.c | 99 ++-
src/modules/sth.c | 1101 ++++++++++++++++++++++++++++++++--------
src/test/test-fifo.c | 35 -
src/test/test-pipe.c | 35 -
src/test/test-streams.c | 89 +--
src/util/autopush.c | 42 -
src/util/scls.c | 34 -
src/util/strace.c | 29 -
src/util/strerr.c | 29 -
streams.spec.in | 30 -
41 files changed, 2163 insertions(+), 793 deletions(-)

Once the SMP issues are done, I will package and release streams-0.7a.4
(probably tommorrow) and then I will start on the 32-bit compatibility
testing. (I noticed that LiS does not have 32-bit compatibility at all,
on any architecture. That BLD32OVER64 thing is all wrong.)

If you could test that release on your 4-way x86_64 box that would be
good.

--brian
Post by e***@netscape.net
Post by Brian F. G. Bidulock
- For LiS I will rip the ioctl conversion hash table and the cdrom
conversion functions from the system map and override the CDROM
ioctls with a function that checks for character or block device
and
Post by Brian F. G. Bidulock
then either calls the CDROM conversion or calls the STREAMS
conversions.
How does that sound?
That sounds rather heavy.
I'm wondering if there is simpler way of fixing that problem.
Anyhow, did you have a chance to implement and test that fix?
Are there a lot of changes?
--
Eugene
_________________________________________________________________
Try the New Netscape Mail Today!
Virtually Spam-Free | More Storage | Import Your Contact List
[1]http://mail.netscape.com
References
1. http://mail.netscape.com/
--
Brian F. G. Bidulock ¦ The reasonable man adapts himself to the ¦
***@openss7.org ¦ world; the unreasonable one persists in ¦
http://www.openss7.org/ ¦ trying to adapt the world to himself. ¦
¦ Therefore all progress depends on the ¦
¦ unreasonable man. -- George Bernard Shaw ¦
Brian F. G. Bidulock
2006-02-22 22:53:24 UTC
Permalink
Eugene,

Ok, I have Linux Fast-STREAMS passing all test cases on x86_64 SMP.
Changes to Linux Fast-STREAMS are available immediately to sponsors
of and subscribers to the OpenSS7 on the CVS archive.

<marketingplug>
If anyone needs the changes immediately, sponsorship of the OpenSS7
Project doesn't cost all that much. mailto:***@openss7.com
</marketingplug>

I will now finish proper 32-bit compatibility before re-releasing
Linux Fast-STREAMS.

LiS, OTOH, fails a bunch more (10 or 12 more) test cases. Some of
these appear to the 64bit issues. Added to the other 40 or so test
case lockups previously discovered on SMP, I cannot see that LiS is
usable in a 64bit SMP environment at all. (I'm sure that it might
work fine for some very narrow applications.) Coupled with the fact
that existing BLD32OVER64 and ioctl32 conversion is fundamentally
flawed, I will likely not be updating LiS unless requested by a sponsor.

Please use Linux Fast-STREAMS in such an environment. The strcompat
package includes LiS source (and some LiS binary) compatibility for
Linux Fast-STREAMS to assist with any transition issues.

--brian
Post by e***@netscape.net
Post by Brian F. G. Bidulock
- For LiS I will rip the ioctl conversion hash table and the cdrom
conversion functions from the system map and override the CDROM
ioctls with a function that checks for character or block device
and
Post by Brian F. G. Bidulock
then either calls the CDROM conversion or calls the STREAMS
conversions.
How does that sound?
That sounds rather heavy.
I'm wondering if there is simpler way of fixing that problem.
Anyhow, did you have a chance to implement and test that fix?
Are there a lot of changes?
--
Eugene
_________________________________________________________________
Try the New Netscape Mail Today!
Virtually Spam-Free | More Storage | Import Your Contact List
[1]http://mail.netscape.com
References
1. http://mail.netscape.com/
--
Brian F. G. Bidulock ¦ The reasonable man adapts himself to the ¦
***@openss7.org ¦ world; the unreasonable one persists in ¦
http://www.openss7.org/ ¦ trying to adapt the world to himself. ¦
¦ Therefore all progress depends on the ¦
¦ unreasonable man. -- George Bernard Shaw ¦
Brian F. G. Bidulock
2006-03-10 21:30:24 UTC
Permalink
Eugene,

I've been busy. I now have Linux Fast-STREAMS and all add-on
packages validated on x86_64 SMP (HT) as well as validated for
32/64-bit compatibility.

For validation I ran the test suites compiled on 32-bit over the
64-bit kernel modules. I tested the older EL4 2.6.9 kernel
(without compat_ioctl) as well as the newer FC4 2.6.15 kernel
(with compat_ioctl). I also took the Solaris approach of
passing IOC_ILP32 flag in ioc_flag and cp_flag members of iocblk
and copyresp. Drivers on pre-2.6.9 kernels need to call a new
register_ioctl32 and unregister_ioctl32 functions to register
their 32-bit ioctls with the Stream Head. Drivers do no need to
register ioctls on 2.6.11+ kernels. I also updated the
documentation for IOC_ILP32 and these two new registration
functions.

I am about to tag for release.

I thought that since I have 32/64-bit binary compatibility
working that I would put the ability to release binary STREAMS
modules and drivers into Linux Fast-STREAMS (in an strbcm
package). The beginnings of that package are on the CVS
archive. I am also attempting the ability to run older
LiS-2.18.0 binaries under Linux Fast-STREAMS! It might even be
possible to link foreign kernel objects such as SVR 4.2.

There are quite a few changes I made in a number of places.
Here's the diffstat (of Linux Fast-STREAMS) against the last
release:

.indent.pro | 1
.pkgrelease | 2
AUTHORS | 95 -
ChangeLog | 2227 +++++++++++++++-----------
Makefile.am | 17
NEWS | 48
README | 221 ++
README-LiS | 185 ++
README-alpha | 91 -
README-cvs | 120 -
README-nexusware | 26
THANKS | 140 +
TODO | 234 ++
acinclude.m4 | 38
am/archive.am | 15
am/autotest.am | 15
am/deb.am | 15
am/genksyms.am | 15
am/help.am | 22
am/info.am | 40
am/init.am | 15
am/kernel.am | 15
am/libraries.am | 15
am/lsm.am | 15
am/man.am | 15
am/openss7.am | 145 +
am/rpm.am | 15
am/sctp.am | 15
am/strconf.am | 28
debian/changelog | 13
debian/control.in | 9
debian/copyright | 5
debian/rules.in | 14
doc/Makefile.am | 58
doc/man/Makefile.am | 21
doc/man/man9/M_COPYIN.9.man | 6
doc/man/man9/M_COPYOUT.9.man | 6
doc/man/man9/M_CTL.9.man | 29
doc/man/man9/M_IOCACK.9.man | 34
doc/man/man9/M_IOCDATA.9.man | 98 +
doc/man/man9/M_IOCNAK.9.man | 34
doc/man/man9/M_IOCTL.9.man | 153 +
doc/man/man9/STREAMS.9.man | 6
doc/man/man9/copyreq.9.man | 49
doc/man/man9/copyresp.9.man | 49
doc/man/man9/iocblk.9.man | 87 -
doc/man/man9/register_ioctl32.9.man | 419 +++++
doc/man/man9/register_strdev.9.man | 14
doc/man/man9/unregister_ioctl32.9.man | 312 +++
doc/man/streams.macros | 79
doc/man/streams.refs | 8
doc/manual/Makefile.am | 17
doc/manual/STREAMS.texi | 6
doc/manual/configure.texi | 8
doc/manual/releases.texi | 313 +++
doc/manual/rpm.texi | 8
doc/manual/texi/install.texi | 12
include/Makefile.am | 17
include/sys/streams/config.h.in | 8
include/sys/streams/ddi.h | 19
include/sys/streams/kmem.h | 24
include/sys/streams/sad.h | 34
include/sys/streams/sc.h | 80
include/sys/streams/strconf.h | 20
include/sys/streams/strdebug.h | 10
include/sys/streams/stream.h | 173 +-
include/sys/streams/strlog.h | 84 -
include/sys/streams/stropts.h | 44
include/sys/streams/stropts32.h | 129 +
include/sys/streams/strsubr.h | 32
include/sys/stropts32.h | 79
m4/acx_pthread.m4 | 199 --
m4/autotest.m4 | 6
m4/dast.m4 | 240 --
m4/dist.m4 | 20
m4/inet.m4 | 6
m4/kernel.m4 | 22
m4/openss7.m4 | 6
m4/sctp.m4 | 6
m4/strconf.m4 | 175 +-
m4/xns.m4 | 6
m4/xti.m4 | 6
scripts/Makefile | 37
scripts/lis-config.in | 147 -
scripts/lis-down | 400 ----
scripts/lis-mod-cnts | 20
scripts/lis-modules | 20
scripts/lis-pids | 21
scripts/lis-status | 410 ----
scripts/lis-up | 376 ----
scripts/strconf-sh | 464 ++++-
scripts/update_conf.modules | 64
src/.indent.pro | 1
src/drivers/clone.h | 9
src/drivers/fifo.c | 21
src/drivers/log.c | 17
src/drivers/sad.c | 240 ++
src/drivers/sfx.c | 35
src/kernel/specfs.c | 21
src/kernel/streams.c | 21
src/kernel/strprocfs.c | 156 +
src/kernel/strsched.c | 123 -
src/kernel/strsysctl.c | 89 -
src/kernel/strsysctl.h | 56
src/kernel/strutil.c | 21
src/modules/nullmod.c | 81
src/modules/sc.c | 273 ++-
src/modules/sth.c | 2812 ++++++++++++++++++++++++++++------
src/modules/testmod.c | 118 +
src/test/perftest.c | 106 -
src/test/test-clone.c | 39
src/test/test-connld.c | 39
src/test/test-echo.c | 39
src/test/test-fifo.c | 49
src/test/test-log.c | 39
src/test/test-loop.c | 38
src/test/test-mux.c | 38
src/test/test-nsdev.c | 39
src/test/test-nuls.c | 39
src/test/test-pipe.c | 49
src/test/test-pipemod.c | 39
src/test/test-sad.c | 59
src/test/test-sc.c | 43
src/test/test-streams.c | 241 ++
src/util/autopush.c | 135 +
src/util/fattach.c | 23
src/util/fdetach.c | 20
src/util/scls.c | 47
src/util/strace.c | 36
src/util/strchg.c | 22
src/util/strconf.c | 29
src/util/strerr.c | 36
src/util/strinfo.c | 20
src/util/strreset.c | 20
src/util/strvf.c | 23
streams.lsm.in | 31
streams.spec.in | 170 +-
tests/Makefile.am | 76
tests/local.at | 27
tests/testsuite-clone.at | 14
tests/testsuite-connld.at | 14
tests/testsuite-echo.at | 14
tests/testsuite-fifo.at | 461 +----
tests/testsuite-log.at | 14
tests/testsuite-loop.at | 14
tests/testsuite-mux.at | 14
tests/testsuite-nsdev.at | 14
tests/testsuite-nuls.at | 14
tests/testsuite-pipe.at | 151 +
tests/testsuite-pipemod.at | 14
tests/testsuite-sad.at | 133 +
tests/testsuite-sc.at | 14
tests/testsuite-streams.at | 332 +---
153 files changed, 10054 insertions(+), 5984 deletions(-)

--brian
--
Brian F. G. Bidulock ¦ The reasonable man adapts himself to the ¦
***@openss7.org ¦ world; the unreasonable one persists in ¦
http://www.openss7.org/ ¦ trying to adapt the world to himself. ¦
¦ Therefore all progress depends on the ¦
¦ unreasonable man. -- George Bernard Shaw ¦
Loading...