sys_pciconfig_{read,write}
Subsystems (2)
I bet most people don't even know we have these syscalls. But they're built into every arch except X86, and only hooked up on alpha, arm, ia64, ppc32, sparc and sparc64.
Given the existence of sysfs and the inability of the syscalls to handle domains, I don't see any point in hooking them up on new architectures. I suspect they could even be deleted since any software trying them must fall back to other methods to be portable.
The syscalls also take the BKL, as pointed out by Carlos on kernel janitors. This is unnecessary as they're already spinlocked at a lower level.
So I propose the following three patches:
1/ New Kconfig symbol CONFIG_PCI_SYSCALLS to be defined by the above architectures. Makefile altered accordingly.
2/ Removal of BKL from syscall implementation.
3/ Removal of !CONFIG_PCI pciconfig stubs from alpha, ia64 and sparc64 (we already have cond_syscalls for them).
I don't quite understand why we need compat_sys_pciconfig_{read,write,iobase} on ppc64. Can't these just call the normal versions?
Subject: [PATCH] powerpc: remove compat_sys_pciconfig_*
Matthew Wilcox wondered why we need these functions. We don't. Remove them and just use the "normnal" versions.
---
arch/powerpc/kernel/sys_ppc32.c | 24 ------------------------ arch/powerpc/kernel/systbl.S | 6 +++--- 2 files changed, 3 insertions(+), 27 deletions(-)
Signature · 5 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/ a588565777a0563a1997e2d515db43f9882cb628
arch/powerpc/kernel/sys_ppc32.c +0 -24
@@ -552,30 +552,6 @@ asmlinkage long compat_sys_sched_rr_get_return ret; } -asmlinkage int compat_sys_pciconfig_read(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf) -{ -return sys_pciconfig_read ((unsigned long ) bus, - (unsigned long ) dfn, - (unsigned long ) off, - (unsigned long ) len, -compat_ptr (ubuf)); -} - -asmlinkage int compat_sys_pciconfig_write(u32 bus, u32 dfn, u32 off, u32 len, u32 ubuf) -{ -return sys_pciconfig_write ((unsigned long ) bus, - (unsigned long ) dfn, - (unsigned long ) off, - (unsigned long ) len, -compat_ptr (ubuf)); -} - -asmlinkage int compat_sys_pciconfig_iobase(u32 which, u32 in_bus, u32 in_devfn) -{ -return sys_pciconfig_iobase (which, in_bus, in_devfn); -} - -/* Note: it is necessary to treat mode as an unsigned int, * with the corresponding cast to a signed int to insure that the * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
arch/powerpc/kernel/systbl.S +3 -3
@@ -239,9 +239,9 @@ SYS32ONLY(ftruncate64) SYSX(sys_ni_syscall,sys_stat64,sys_stat64) SYSX(sys_ni_syscall,sys_lstat64,sys_lstat64) SYSX(sys_ni_syscall,sys_fstat64,sys_fstat64) -COMPAT_SYS(pciconfig_read) -COMPAT_SYS(pciconfig_write) -COMPAT_SYS(pciconfig_iobase) +SYSCALL(pciconfig_read) +SYSCALL(pciconfig_write) +SYSCALL(pciconfig_iobase) SYSCALL(ni_syscall) SYSCALL(getdents64) SYSCALL(pivot_root)
Signature · 1 line
1.0.6
Quoted 4 lines · On Mon, 9 Jan 2006 09:27:18 -0700 Matthew Wilcox <[email protected]> wrote:
I bet most people don't even know we have these syscalls. But they're built into every arch except X86, and only hooked up on alpha, arm, ia64, ppc32, sparc and sparc64.
and ppc64 ...
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
From: Matthew Wilcox <[email protected]>
Date: Mon, 9 Jan 2006 09:27:18 -0700
[ Going through some old emails I intended to get to before
heading off to linux.conf.au :-) ]
Quoted 9 lines
So I propose the following three patches:
1/ New
KconfigsymbolCONFIG_PCI_SYSCALLSto be defined by the above architectures.Makefilealtered accordingly.2/ Removal of BKL from syscall implementation.
3/ Removal of !CONFIG_PCI pciconfig stubs from alpha, ia64 and sparc64 (we already have
cond_syscallsfor them).
Sounds fine to me.
Quoted 3 lines
I don't quite understand why we need compat_sys_pciconfig_{read,write,iobase} on ppc64. Can't these just call the normal versions?
I don't see this in the current tree, were they removed as a result of this observation?
Quoted 16 lines · David S. Miller
From: Matthew Wilcox <[email protected]>
Date: Mon, 9 Jan 2006 09:27:18 -0700[ Going through some old emails I intended to get to before
heading off to linux.conf.au :-) ]Quoted 9 lines
So I propose the following three patches:
1/ New
KconfigsymbolCONFIG_PCI_SYSCALLSto be defined by the above architectures.Makefilealtered accordingly.2/ Removal of BKL from syscall implementation.
3/ Removal of !CONFIG_PCI pciconfig stubs from alpha, ia64 and sparc64 (we already have
cond_syscallsfor them).
Quoted 8 lines
Sounds fine to me.
Quoted 3 lines
I don't quite understand why we need compat_sys_pciconfig_{read,write,iobase} on ppc64. Can't these just call the normal versions?
I don't see this in the current tree, were they removed as a result of this observation?
IIRC, yes they were removed a few days later.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds