Commit ae2c27a7 authored by Jeff Garzik's avatar Jeff Garzik

Merge ../linux-2.6

parents a608ab9c e34efe3b
Linux Magic System Request Key Hacks Linux Magic System Request Key Hacks
Documentation for sysrq.c version 1.15 Documentation for sysrq.c
Last update: $Date: 2001/01/28 10:15:59 $ Last update: 2007-JAN-06
* What is the magic SysRq key? * What is the magic SysRq key?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...@@ -35,7 +35,7 @@ You can set the value in the file by the following command: ...@@ -35,7 +35,7 @@ You can set the value in the file by the following command:
Note that the value of /proc/sys/kernel/sysrq influences only the invocation Note that the value of /proc/sys/kernel/sysrq influences only the invocation
via a keyboard. Invocation of any operation via /proc/sysrq-trigger is always via a keyboard. Invocation of any operation via /proc/sysrq-trigger is always
allowed. allowed (by a user with admin privileges).
* How do I use the magic SysRq key? * How do I use the magic SysRq key?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...@@ -58,7 +58,7 @@ On PowerPC - Press 'ALT - Print Screen (or F13) - <command key>, ...@@ -58,7 +58,7 @@ On PowerPC - Press 'ALT - Print Screen (or F13) - <command key>,
On other - If you know of the key combos for other architectures, please On other - If you know of the key combos for other architectures, please
let me know so I can add them to this section. let me know so I can add them to this section.
On all - write a character to /proc/sysrq-trigger. eg: On all - write a character to /proc/sysrq-trigger. e.g.:
echo t > /proc/sysrq-trigger echo t > /proc/sysrq-trigger
...@@ -74,6 +74,8 @@ On all - write a character to /proc/sysrq-trigger. eg: ...@@ -74,6 +74,8 @@ On all - write a character to /proc/sysrq-trigger. eg:
'c' - Will perform a kexec reboot in order to take a crashdump. 'c' - Will perform a kexec reboot in order to take a crashdump.
'd' - Shows all locks that are held.
'o' - Will shut your system off (if configured and supported). 'o' - Will shut your system off (if configured and supported).
's' - Will attempt to sync all mounted filesystems. 's' - Will attempt to sync all mounted filesystems.
...@@ -87,38 +89,43 @@ On all - write a character to /proc/sysrq-trigger. eg: ...@@ -87,38 +89,43 @@ On all - write a character to /proc/sysrq-trigger. eg:
'm' - Will dump current memory info to your console. 'm' - Will dump current memory info to your console.
'n' - Used to make RT tasks nice-able
'v' - Dumps Voyager SMP processor info to your console. 'v' - Dumps Voyager SMP processor info to your console.
'w' - Dumps tasks that are in uninterruptable (blocked) state.
'x' - Used by xmon interface on ppc/powerpc platforms.
'0'-'9' - Sets the console log level, controlling which kernel messages '0'-'9' - Sets the console log level, controlling which kernel messages
will be printed to your console. ('0', for example would make will be printed to your console. ('0', for example would make
it so that only emergency messages like PANICs or OOPSes would it so that only emergency messages like PANICs or OOPSes would
make it to your console.) make it to your console.)
'f' - Will call oom_kill to kill a memory hog process 'f' - Will call oom_kill to kill a memory hog process.
'e' - Send a SIGTERM to all processes, except for init. 'e' - Send a SIGTERM to all processes, except for init.
'i' - Send a SIGKILL to all processes, except for init. 'g' - Used by kgdb on ppc platforms.
'l' - Send a SIGKILL to all processes, INCLUDING init. (Your system 'i' - Send a SIGKILL to all processes, except for init.
will be non-functional after this.)
'h' - Will display help ( actually any other key than those listed 'h' - Will display help (actually any other key than those listed
above will display help. but 'h' is easy to remember :-) above will display help. but 'h' is easy to remember :-)
* Okay, so what can I use them for? * Okay, so what can I use them for?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Well, un'R'aw is very handy when your X server or a svgalib program crashes. Well, un'R'aw is very handy when your X server or a svgalib program crashes.
sa'K' (Secure Access Key) is useful when you want to be sure there are no sa'K' (Secure Access Key) is useful when you want to be sure there is no
trojan program is running at console and which could grab your password trojan program running at console which could grab your password
when you would try to login. It will kill all programs on given console when you would try to login. It will kill all programs on given console,
and thus letting you make sure that the login prompt you see is actually thus letting you make sure that the login prompt you see is actually
the one from init, not some trojan program. the one from init, not some trojan program.
IMPORTANT: In its true form it is not a true SAK like the one in a :IMPORTANT IMPORTANT: In its true form it is not a true SAK like the one in a :IMPORTANT
IMPORTANT: c2 compliant system, and it should not be mistaken as :IMPORTANT IMPORTANT: c2 compliant system, and it should not be mistaken as :IMPORTANT
IMPORTANT: such. :IMPORTANT IMPORTANT: such. :IMPORTANT
It seems other find it useful as (System Attention Key) which is It seems others find it useful as (System Attention Key) which is
useful when you want to exit a program that will not let you switch consoles. useful when you want to exit a program that will not let you switch consoles.
(For example, X or a svgalib program.) (For example, X or a svgalib program.)
...@@ -139,8 +146,8 @@ OK or Done message...) ...@@ -139,8 +146,8 @@ OK or Done message...)
Again, the unmount (remount read-only) hasn't taken place until you see the Again, the unmount (remount read-only) hasn't taken place until you see the
"OK" and "Done" message appear on the screen. "OK" and "Done" message appear on the screen.
The loglevel'0'-'9' is useful when your console is being flooded with The loglevels '0'-'9' are useful when your console is being flooded with
kernel messages you do not want to see. Setting '0' will prevent all but kernel messages you do not want to see. Selecting '0' will prevent all but
the most urgent kernel messages from reaching your console. (They will the most urgent kernel messages from reaching your console. (They will
still be logged if syslogd/klogd are alive, though.) still be logged if syslogd/klogd are alive, though.)
...@@ -152,7 +159,7 @@ processes. ...@@ -152,7 +159,7 @@ processes.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
That happens to me, also. I've found that tapping shift, alt, and control That happens to me, also. I've found that tapping shift, alt, and control
on both sides of the keyboard, and hitting an invalid sysrq sequence again on both sides of the keyboard, and hitting an invalid sysrq sequence again
will fix the problem. (ie, something like alt-sysrq-z). Switching to another will fix the problem. (i.e., something like alt-sysrq-z). Switching to another
virtual console (ALT+Fn) and then back again should also help. virtual console (ALT+Fn) and then back again should also help.
* I hit SysRq, but nothing seems to happen, what's wrong? * I hit SysRq, but nothing seems to happen, what's wrong?
...@@ -174,11 +181,11 @@ handler function you will use, B) a help_msg string, that will print when SysRQ ...@@ -174,11 +181,11 @@ handler function you will use, B) a help_msg string, that will print when SysRQ
prints help, and C) an action_msg string, that will print right before your prints help, and C) an action_msg string, that will print right before your
handler is called. Your handler must conform to the prototype in 'sysrq.h'. handler is called. Your handler must conform to the prototype in 'sysrq.h'.
After the sysrq_key_op is created, you can call the macro After the sysrq_key_op is created, you can call the kernel function
register_sysrq_key(int key, struct sysrq_key_op *op_p) that is defined in register_sysrq_key(int key, struct sysrq_key_op *op_p); this will
sysrq.h, this will register the operation pointed to by 'op_p' at table register the operation pointed to by 'op_p' at table key 'key',
key 'key', if that slot in the table is blank. At module unload time, you must if that slot in the table is blank. At module unload time, you must call
call the macro unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which the function unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which
will remove the key op pointed to by 'op_p' from the key 'key', if and only if will remove the key op pointed to by 'op_p' from the key 'key', if and only if
it is currently registered in that slot. This is in case the slot has been it is currently registered in that slot. This is in case the slot has been
overwritten since you registered it. overwritten since you registered it.
...@@ -186,15 +193,12 @@ overwritten since you registered it. ...@@ -186,15 +193,12 @@ overwritten since you registered it.
The Magic SysRQ system works by registering key operations against a key op The Magic SysRQ system works by registering key operations against a key op
lookup table, which is defined in 'drivers/char/sysrq.c'. This key table has lookup table, which is defined in 'drivers/char/sysrq.c'. This key table has
a number of operations registered into it at compile time, but is mutable, a number of operations registered into it at compile time, but is mutable,
and 4 functions are exported for interface to it: __sysrq_lock_table, and 2 functions are exported for interface to it:
__sysrq_unlock_table, __sysrq_get_key_op, and __sysrq_put_key_op. The register_sysrq_key and unregister_sysrq_key.
functions __sysrq_swap_key_ops and __sysrq_swap_key_ops_nolock are defined Of course, never ever leave an invalid pointer in the table. I.e., when
in the header itself, and the REGISTER and UNREGISTER macros are built from your module that called register_sysrq_key() exits, it must call
these. More complex (and dangerous!) manipulations of the table are possible unregister_sysrq_key() to clean up the sysrq key table entry that it used.
using these functions, but you must be careful to always lock the table before Null pointers in the table are always safe. :)
you read or write from it, and to unlock it again when you are done. (And of
course, to never ever leave an invalid pointer in the table). Null pointers in
the table are always safe :)
If for some reason you feel the need to call the handle_sysrq function from If for some reason you feel the need to call the handle_sysrq function from
within a function called by handle_sysrq, you must be aware that you are in within a function called by handle_sysrq, you must be aware that you are in
......
...@@ -598,8 +598,6 @@ W: http://linux-atm.sourceforge.net ...@@ -598,8 +598,6 @@ W: http://linux-atm.sourceforge.net
S: Maintained S: Maintained
ATMEL MACB ETHERNET DRIVER ATMEL MACB ETHERNET DRIVER
P: Atmel AVR32 Support Team
M: avr32@atmel.com
P: Haavard Skinnemoen P: Haavard Skinnemoen
M: hskinnemoen@atmel.com M: hskinnemoen@atmel.com
S: Supported S: Supported
...@@ -620,8 +618,6 @@ T: git kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6.git ...@@ -620,8 +618,6 @@ T: git kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6.git
S: Maintained S: Maintained
AVR32 ARCHITECTURE AVR32 ARCHITECTURE
P: Atmel AVR32 Support Team
M: avr32@atmel.com
P: Haavard Skinnemoen P: Haavard Skinnemoen
M: hskinnemoen@atmel.com M: hskinnemoen@atmel.com
W: http://www.atmel.com/products/AVR32/ W: http://www.atmel.com/products/AVR32/
...@@ -630,8 +626,6 @@ W: http://avrfreaks.net/ ...@@ -630,8 +626,6 @@ W: http://avrfreaks.net/
S: Supported S: Supported
AVR32/AT32AP MACHINE SUPPORT AVR32/AT32AP MACHINE SUPPORT
P: Atmel AVR32 Support Team
M: avr32@atmel.com
P: Haavard Skinnemoen P: Haavard Skinnemoen
M: hskinnemoen@atmel.com M: hskinnemoen@atmel.com
S: Supported S: Supported
...@@ -2288,7 +2282,7 @@ P: Jozsef Kadlecsik ...@@ -2288,7 +2282,7 @@ P: Jozsef Kadlecsik
P: Patrick McHardy P: Patrick McHardy
M: kaber@trash.net M: kaber@trash.net
L: netfilter-devel@lists.netfilter.org L: netfilter-devel@lists.netfilter.org
L: netfilter@lists.netfilter.org L: netfilter@lists.netfilter.org (subscribers-only)
L: coreteam@netfilter.org L: coreteam@netfilter.org
W: http://www.netfilter.org/ W: http://www.netfilter.org/
W: http://www.iptables.org/ W: http://www.iptables.org/
......
...@@ -43,6 +43,8 @@ static int is_safe_abs_reloc(const char* sym_name) ...@@ -43,6 +43,8 @@ static int is_safe_abs_reloc(const char* sym_name)
/* Match found */ /* Match found */
return 1; return 1;
} }
if (strncmp(sym_name, "__crc_", 6) == 0)
return 1;
return 0; return 0;
} }
......
...@@ -102,7 +102,7 @@ void __init time_init_hook(void) ...@@ -102,7 +102,7 @@ void __init time_init_hook(void)
* along the MCA bus. Use this to hook into that chain if you will need * along the MCA bus. Use this to hook into that chain if you will need
* it. * it.
**/ **/
void __init mca_nmi_hook(void) void mca_nmi_hook(void)
{ {
/* If I recall correctly, there's a whole bunch of other things that /* If I recall correctly, there's a whole bunch of other things that
* we can do to check for NMI problems, but that's all I know about * we can do to check for NMI problems, but that's all I know about
......
...@@ -292,8 +292,8 @@ int setup_profiling_timer(unsigned int multiplier) ...@@ -292,8 +292,8 @@ int setup_profiling_timer(unsigned int multiplier)
void __init smp_prepare_cpus(unsigned int max_cpus) void __init smp_prepare_cpus(unsigned int max_cpus)
{ {
extern void smp4m_boot_cpus(void); extern void __init smp4m_boot_cpus(void);
extern void smp4d_boot_cpus(void); extern void __init smp4d_boot_cpus(void);
int i, cpuid, extra; int i, cpuid, extra;
printk("Entering SMP Mode...\n"); printk("Entering SMP Mode...\n");
...@@ -375,8 +375,8 @@ void __init smp_prepare_boot_cpu(void) ...@@ -375,8 +375,8 @@ void __init smp_prepare_boot_cpu(void)
int __cpuinit __cpu_up(unsigned int cpu) int __cpuinit __cpu_up(unsigned int cpu)
{ {
extern int smp4m_boot_one_cpu(int); extern int __cpuinit smp4m_boot_one_cpu(int);
extern int smp4d_boot_one_cpu(int); extern int __cpuinit smp4d_boot_one_cpu(int);
int ret=0; int ret=0;
switch(sparc_cpu_model) { switch(sparc_cpu_model) {
......
...@@ -164,7 +164,7 @@ void __init smp4d_boot_cpus(void) ...@@ -164,7 +164,7 @@ void __init smp4d_boot_cpus(void)
local_flush_cache_all(); local_flush_cache_all();
} }
int smp4d_boot_one_cpu(int i) int __cpuinit smp4d_boot_one_cpu(int i)
{ {
extern unsigned long sun4d_cpu_startup; extern unsigned long sun4d_cpu_startup;
unsigned long *entry = &sun4d_cpu_startup; unsigned long *entry = &sun4d_cpu_startup;
......
...@@ -215,7 +215,7 @@ static void sysrq_handle_showstate_blocked(int key, struct tty_struct *tty) ...@@ -215,7 +215,7 @@ static void sysrq_handle_showstate_blocked(int key, struct tty_struct *tty)
} }
static struct sysrq_key_op sysrq_showstate_blocked_op = { static struct sysrq_key_op sysrq_showstate_blocked_op = {
.handler = sysrq_handle_showstate_blocked, .handler = sysrq_handle_showstate_blocked,
.help_msg = "showBlockedTasks", .help_msg = "shoW-blocked-tasks",
.action_msg = "Show Blocked State", .action_msg = "Show Blocked State",
.enable_mask = SYSRQ_ENABLE_DUMP, .enable_mask = SYSRQ_ENABLE_DUMP,
}; };
...@@ -315,15 +315,16 @@ static struct sysrq_key_op *sysrq_key_table[36] = { ...@@ -315,15 +315,16 @@ static struct sysrq_key_op *sysrq_key_table[36] = {
&sysrq_loglevel_op, /* 9 */ &sysrq_loglevel_op, /* 9 */
/* /*
* Don't use for system provided sysrqs, it is handled specially on * a: Don't use for system provided sysrqs, it is handled specially on
* sparc and will never arrive * sparc and will never arrive.
*/ */
NULL, /* a */ NULL, /* a */
&sysrq_reboot_op, /* b */ &sysrq_reboot_op, /* b */
&sysrq_crashdump_op, /* c */ &sysrq_crashdump_op, /* c & ibm_emac driver debug */
&sysrq_showlocks_op, /* d */ &sysrq_showlocks_op, /* d */
&sysrq_term_op, /* e */ &sysrq_term_op, /* e */
&sysrq_moom_op, /* f */ &sysrq_moom_op, /* f */
/* g: May be registered by ppc for kgdb */
NULL, /* g */ NULL, /* g */
NULL, /* h */ NULL, /* h */
&sysrq_kill_op, /* i */ &sysrq_kill_op, /* i */
...@@ -332,18 +333,19 @@ static struct sysrq_key_op *sysrq_key_table[36] = { ...@@ -332,18 +333,19 @@ static struct sysrq_key_op *sysrq_key_table[36] = {
NULL, /* l */ NULL, /* l */
&sysrq_showmem_op, /* m */ &sysrq_showmem_op, /* m */
&sysrq_unrt_op, /* n */ &sysrq_unrt_op, /* n */
/* This will often be registered as 'Off' at init time */ /* o: This will often be registered as 'Off' at init time */
NULL, /* o */ NULL, /* o */
&sysrq_showregs_op, /* p */ &sysrq_showregs_op, /* p */
NULL, /* q */ NULL, /* q */
&sysrq_unraw_op, /* r */ &sysrq_unraw_op, /* r */
&sysrq_sync_op, /* s */ &sysrq_sync_op, /* s */
&sysrq_showstate_op, /* t */ &sysrq_showstate_op, /* t */
&sysrq_mountro_op, /* u */ &sysrq_mountro_op, /* u */
/* May be assigned at init time by SMP VOYAGER */ /* v: May be registered at init time by SMP VOYAGER */
NULL, /* v */ NULL, /* v */
NULL, /* w */ &sysrq_showstate_blocked_op, /* w */
&sysrq_showstate_blocked_op, /* x */ /* x: May be registered on ppc/powerpc for xmon */
NULL, /* x */
NULL, /* y */ NULL, /* y */
NULL /* z */ NULL /* z */
}; };
......
...@@ -1781,9 +1781,9 @@ static int __init ide_setup(char *s) ...@@ -1781,9 +1781,9 @@ static int __init ide_setup(char *s)
return 1; return 1;
} }
extern void pnpide_init(void); extern void __init pnpide_init(void);
extern void pnpide_exit(void); extern void __exit pnpide_exit(void);
extern void h8300_ide_init(void); extern void __init h8300_ide_init(void);
/* /*
* probe_for_hwifs() finds/initializes "known" IDE interfaces * probe_for_hwifs() finds/initializes "known" IDE interfaces
...@@ -2088,7 +2088,7 @@ int __init init_module (void) ...@@ -2088,7 +2088,7 @@ int __init init_module (void)
return ide_init(); return ide_init();
} }
void cleanup_module (void) void __exit cleanup_module (void)
{ {
int index; int index;
......
...@@ -78,7 +78,7 @@ static struct via_isa_bridge { ...@@ -78,7 +78,7 @@ static struct via_isa_bridge {
u8 rev_max; u8 rev_max;
u16 flags; u16 flags;
} via_isa_bridges[] = { } via_isa_bridges[] = {
{ "cx7000", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "cx700", PCI_DEVICE_ID_VIA_CX700, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
{ "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "vt8237s", PCI_DEVICE_ID_VIA_8237S, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
{ "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "vt6410", PCI_DEVICE_ID_VIA_6410, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
{ "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST }, { "vt8251", PCI_DEVICE_ID_VIA_8251, 0x00, 0x2f, VIA_UDMA_133 | VIA_BAD_AST },
......
...@@ -1116,6 +1116,8 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu) ...@@ -1116,6 +1116,8 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu)
if (rdmsr_safe(index, &data_low, &data_high) < 0) if (rdmsr_safe(index, &data_low, &data_high) < 0)
continue; continue;
if (wrmsr_safe(index, data_low, data_high) < 0)
continue;
data = data_low | ((u64)data_high << 32); data = data_low | ((u64)data_high << 32);
vcpu->host_msrs[j].index = index; vcpu->host_msrs[j].index = index;
vcpu->host_msrs[j].reserved = 0; vcpu->host_msrs[j].reserved = 0;
......
...@@ -113,7 +113,7 @@ config SCC_TRXECHO ...@@ -113,7 +113,7 @@ config SCC_TRXECHO
config BAYCOM_SER_FDX config BAYCOM_SER_FDX
tristate "BAYCOM ser12 fullduplex driver for AX.25" tristate "BAYCOM ser12 fullduplex driver for AX.25"
depends on AX25 depends on AX25 && !S390
select CRC_CCITT select CRC_CCITT
---help--- ---help---
This is one of two drivers for Baycom style simple amateur radio This is one of two drivers for Baycom style simple amateur radio
...@@ -133,7 +133,7 @@ config BAYCOM_SER_FDX ...@@ -133,7 +133,7 @@ config BAYCOM_SER_FDX
config BAYCOM_SER_HDX config BAYCOM_SER_HDX
tristate "BAYCOM ser12 halfduplex driver for AX.25" tristate "BAYCOM ser12 halfduplex driver for AX.25"
depends on AX25 depends on AX25 && !S390
select CRC_CCITT select CRC_CCITT
---help--- ---help---
This is one of two drivers for Baycom style simple amateur radio This is one of two drivers for Baycom style simple amateur radio
...@@ -181,7 +181,7 @@ config BAYCOM_EPP ...@@ -181,7 +181,7 @@ config BAYCOM_EPP
config YAM config YAM
tristate "YAM driver for AX.25" tristate "YAM driver for AX.25"
depends on AX25 depends on AX25 && !S390
help help
The YAM is a modem for packet radio which connects to the serial The YAM is a modem for packet radio which connects to the serial
port and includes some of the functions of a Terminal Node port and includes some of the functions of a Terminal Node
......
...@@ -661,9 +661,11 @@ static void quirk_via_bridge(struct pci_dev *dev) ...@@ -661,9 +661,11 @@ static void quirk_via_bridge(struct pci_dev *dev)
/* See what bridge we have and find the device ranges */ /* See what bridge we have and find the device ranges */
switch (dev->device) { switch (dev->device) {
case PCI_DEVICE_ID_VIA_82C686: case PCI_DEVICE_ID_VIA_82C686:
/* 82C686 is special */ /* The VT82C686 is special, it attaches to PCI and can have
via_vlink_dev_lo = 7; any device number. All its subdevices are functions of
via_vlink_dev_hi = 7; that single device. */
via_vlink_dev_lo = PCI_SLOT(dev->devfn);
via_vlink_dev_hi = PCI_SLOT(dev->devfn);
break; break;
case PCI_DEVICE_ID_VIA_8237: case PCI_DEVICE_ID_VIA_8237:
case PCI_DEVICE_ID_VIA_8237A: case PCI_DEVICE_ID_VIA_8237A:
......
...@@ -200,11 +200,8 @@ static struct pci_dev * pci_find_subsys(unsigned int vendor, ...@@ -200,11 +200,8 @@ static struct pci_dev * pci_find_subsys(unsigned int vendor,
* can cause some machines to crash. So here we detect and flag that * can cause some machines to crash. So here we detect and flag that
* situation and bail out early. * situation and bail out early.
*/ */
if (unlikely(list_empty(&pci_devices))) { if (unlikely(list_empty(&pci_devices)))
printk(KERN_INFO "pci_find_subsys() called while pci_devices "
"is still empty\n");
return NULL; return NULL;
}
down_read(&pci_bus_sem); down_read(&pci_bus_sem);
n = from ? from->global_list.next : pci_devices.next; n = from ? from->global_list.next : pci_devices.next;
...@@ -278,11 +275,8 @@ pci_get_subsys(unsigned int vendor, unsigned int device, ...@@ -278,11 +275,8 @@ pci_get_subsys(unsigned int vendor, unsigned int device,
* can cause some machines to crash. So here we detect and flag that * can cause some machines to crash. So here we detect and flag that
* situation and bail out early. * situation and bail out early.
*/ */
if (unlikely(list_empty(&pci_devices))) { if (unlikely(list_empty(&pci_devices)))
printk(KERN_NOTICE "pci_get_subsys() called while pci_devices "
"is still empty\n");
return NULL; return NULL;
}
down_read(&pci_bus_sem); down_read(&pci_bus_sem);
n = from ? from->global_list.next : pci_devices.next; n = from ? from->global_list.next : pci_devices.next;
......
...@@ -269,7 +269,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access) ...@@ -269,7 +269,7 @@ fh_verify(struct svc_rqst *rqstp, struct svc_fh *fhp, int type, int access)
"acc=%x, error=%d\n", "acc=%x, error=%d\n",
dentry->d_parent->d_name.name, dentry->d_parent->d_name.name,
dentry->d_name.name, dentry->d_name.name,
access, (error >> 24)); access, ntohl(error));
} }
out: out:
if (exp && !IS_ERR(exp)) if (exp && !IS_ERR(exp))
......
...@@ -2328,13 +2328,23 @@ static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldi ...@@ -2328,13 +2328,23 @@ static int proc_task_readdir(struct file * filp, void * dirent, filldir_t filldi
{ {
struct dentry *dentry = filp->f_path.dentry; struct dentry *dentry = filp->f_path.dentry;
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
struct task_struct *leader = get_proc_task(inode); struct task_struct *leader = NULL;
struct task_struct *task; struct task_struct *task;
int retval = -ENOENT; int retval = -ENOENT;
ino_t ino; ino_t ino;
int tid; int tid;
unsigned long pos = filp->f_pos; /* avoiding "long long" filp->f_pos */ unsigned long pos = filp->f_pos; /* avoiding "long long" filp->f_pos */
task = get_proc_task(inode);
if (!task)
goto out_no_task;
rcu_read_lock();
if (pid_alive(task)) {
leader = task->group_leader;
get_task_struct(leader);
}
rcu_read_unlock();
put_task_struct(task);
if (!leader) if (!leader)
goto out_no_task; goto out_no_task;
retval = 0; retval = 0;
......
include include/asm-generic/Kbuild.asm include include/asm-generic/Kbuild.asm
header-y += registers.h
unifdef-y += termios.h
unifdef-y += ptrace.h
unifdef-y += page.h
...@@ -76,8 +76,6 @@ extern unsigned long max_pfn; ...@@ -76,8 +76,6 @@ extern unsigned long max_pfn;
#endif /* __ASSEMBLY__ */ #endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */
#ifdef CONFIG_CONTIGUOUS_PAGE_ALLOC #ifdef CONFIG_CONTIGUOUS_PAGE_ALLOC
#define WANT_PAGE_VIRTUAL 1 #define WANT_PAGE_VIRTUAL 1
#endif #endif
...@@ -85,4 +83,6 @@ extern unsigned long max_pfn; ...@@ -85,4 +83,6 @@ extern unsigned long max_pfn;
#include <asm-generic/memory_model.h> #include <asm-generic/memory_model.h>
#include <asm-generic/page.h> #include <asm-generic/page.h>
#endif /* __KERNEL__ */
#endif /* _ASM_PAGE_H */ #endif /* _ASM_PAGE_H */
...@@ -12,9 +12,11 @@ ...@@ -12,9 +12,11 @@
#define _ASM_PTRACE_H #define _ASM_PTRACE_H
#include <asm/registers.h> #include <asm/registers.h>
#ifdef __KERNEL__
#include <asm/irq_regs.h> #include <asm/irq_regs.h>
#define in_syscall(regs) (((regs)->tbr & TBR_TT) == TBR_TT_TRAP0) #define in_syscall(regs) (((regs)->tbr & TBR_TT) == TBR_TT_TRAP0)
#endif
#define PT_PSR 0 #define PT_PSR 0
...@@ -60,6 +62,7 @@ ...@@ -60,6 +62,7 @@
#define PTRACE_GETFDPIC_EXEC 0 /* [addr] request the executable loadmap */ #define PTRACE_GETFDPIC_EXEC 0 /* [addr] request the executable loadmap */
#define PTRACE_GETFDPIC_INTERP 1 /* [addr] request the interpreter loadmap */ #define PTRACE_GETFDPIC_INTERP 1 /* [addr] request the interpreter loadmap */
#ifdef __KERNEL__
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
/* /*
...@@ -74,6 +77,7 @@ register struct pt_regs *__frame asm("gr28"); ...@@ -74,6 +77,7 @@ register struct pt_regs *__frame asm("gr28");
extern unsigned long user_stack(const struct pt_regs *); extern unsigned long user_stack(const struct pt_regs *);
extern void show_regs(struct pt_regs *); extern void show_regs(struct pt_regs *);
#define profile_pc(regs) ((regs)->pc) #define profile_pc(regs) ((regs)->pc)
#endif
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
#endif /* _ASM_PTRACE_H */ #endif /* _ASM_PTRACE_H */
...@@ -69,6 +69,8 @@ struct termio { ...@@ -69,6 +69,8 @@ struct termio {
#define N_SYNC_PPP 14 #define N_SYNC_PPP 14
#define N_HCI 15 /* Bluetooth HCI UART */ #define N_HCI 15 /* Bluetooth HCI UART */
#ifdef __KERNEL__
#include <asm-generic/termios.h> #include <asm-generic/termios.h>
#endif
#endif /* _ASM_TERMIOS_H */ #endif /* _ASM_TERMIOS_H */
...@@ -408,6 +408,15 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) ...@@ -408,6 +408,15 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
#include <asm-generic/pgtable-nopud.h> #include <asm-generic/pgtable-nopud.h>
#ifdef CONFIG_HIGHMEM
/* Clear a kernel PTE and flush it from the TLB */
#define kpte_clear_flush(ptep, vaddr) \
do { \
pte_clear(&init_mm, vaddr, ptep); \
__flush_tlb_one(vaddr); \
} while (0)
#endif
#endif #endif
#endif #endif
......
...@@ -301,7 +301,7 @@ extern int __init efi_uart_console_only (void); ...@@ -301,7 +301,7 @@ extern int __init efi_uart_console_only (void);
extern void efi_initialize_iomem_resources(struct resource *code_resource, extern void efi_initialize_iomem_resources(struct resource *code_resource,
struct resource *data_resource); struct resource *data_resource);
extern unsigned long efi_get_time(void); extern unsigned long efi_get_time(void);
extern int __init efi_set_rtc_mmss(unsigned long nowtime); extern int efi_set_rtc_mmss(unsigned long nowtime);
extern int is_available_memory(efi_memory_desc_t * md); extern int is_available_memory(efi_memory_desc_t * md);
extern struct efi_memory_map memmap; extern struct efi_memory_map memmap;
......
...@@ -1313,7 +1313,7 @@ noinline struct pt_regs * __devinit __attribute__((weak)) idle_regs(struct pt_re ...@@ -1313,7 +1313,7 @@ noinline struct pt_regs * __devinit __attribute__((weak)) idle_regs(struct pt_re
return regs; return regs;
} }
struct task_struct * __devinit fork_idle(int cpu) struct task_struct * __cpuinit fork_idle(int cpu)
{ {
struct task_struct *task; struct task_struct *task;
struct pt_regs regs; struct pt_regs regs;
......
...@@ -989,8 +989,7 @@ int zone_watermark_ok(struct zone *z, int order, unsigned long mark, ...@@ -989,8 +989,7 @@ int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
int classzone_idx, int alloc_flags) int classzone_idx, int alloc_flags)
{ {
/* free_pages my go negative - that's OK */ /* free_pages my go negative - that's OK */
unsigned long min = mark; long min = mark, free_pages = z->free_pages - (1 << order) + 1;
long free_pages = z->free_pages - (1 << order) + 1;
int o; int o;
if (alloc_flags & ALLOC_HIGH) if (alloc_flags & ALLOC_HIGH)
......
...@@ -283,10 +283,16 @@ static int skp_epaddr_len(const char *dptr, const char *limit, int *shift) ...@@ -283,10 +283,16 @@ static int skp_epaddr_len(const char *dptr, const char *limit, int *shift)
{ {
int s = *shift; int s = *shift;
for (; dptr <= limit && *dptr != '@'; dptr++) /* Search for @, but stop at the end of the line.
* We are inside a sip: URI, so we don't need to worry about
* continuation lines. */
while (dptr <= limit &&
*dptr != '@' && *dptr != '\r' && *dptr != '\n') {
(*shift)++; (*shift)++;
dptr++;
}
if (*dptr == '@') { if (dptr <= limit && *dptr == '@') {
dptr++; dptr++;
(*shift)++; (*shift)++;
} else } else
......
...@@ -3393,7 +3393,7 @@ static void inline ipv6_store_devconf(struct ipv6_devconf *cnf, ...@@ -3393,7 +3393,7 @@ static void inline ipv6_store_devconf(struct ipv6_devconf *cnf,
#ifdef CONFIG_IPV6_ROUTER_PREF #ifdef CONFIG_IPV6_ROUTER_PREF
array[DEVCONF_ACCEPT_RA_RTR_PREF] = cnf->accept_ra_rtr_pref; array[DEVCONF_ACCEPT_RA_RTR_PREF] = cnf->accept_ra_rtr_pref;
array[DEVCONF_RTR_PROBE_INTERVAL] = cnf->rtr_probe_interval; array[DEVCONF_RTR_PROBE_INTERVAL] = cnf->rtr_probe_interval;
#ifdef CONFIV_IPV6_ROUTE_INFO #ifdef CONFIG_IPV6_ROUTE_INFO
array[DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN] = cnf->accept_ra_rt_info_max_plen; array[DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN] = cnf->accept_ra_rt_info_max_plen;
#endif #endif
#endif #endif
...@@ -3898,7 +3898,7 @@ static struct addrconf_sysctl_table ...@@ -3898,7 +3898,7 @@ static struct addrconf_sysctl_table
.proc_handler = &proc_dointvec_jiffies, .proc_handler = &proc_dointvec_jiffies,
.strategy = &sysctl_jiffies, .strategy = &sysctl_jiffies,
}, },
#ifdef CONFIV_IPV6_ROUTE_INFO #ifdef CONFIG_IPV6_ROUTE_INFO
{ {
.ctl_name = NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN, .ctl_name = NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN,
.procname = "accept_ra_rt_info_max_plen", .procname = "accept_ra_rt_info_max_plen",
......
...@@ -1413,6 +1413,13 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, ...@@ -1413,6 +1413,13 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
return; return;
} }
if (!ipv6_addr_equal(&skb->nh.ipv6h->daddr, target) &&
!(ipv6_addr_type(target) & IPV6_ADDR_LINKLOCAL)) {
ND_PRINTK2(KERN_WARNING
"ICMPv6 Redirect: target address is not link-local.\n");
return;
}
ndisc_flow_init(&fl, NDISC_REDIRECT, &saddr_buf, &skb->nh.ipv6h->saddr, ndisc_flow_init(&fl, NDISC_REDIRECT, &saddr_buf, &skb->nh.ipv6h->saddr,
dev->ifindex); dev->ifindex);
......
...@@ -628,7 +628,7 @@ config NETFILTER_XT_MATCH_TCPMSS ...@@ -628,7 +628,7 @@ config NETFILTER_XT_MATCH_TCPMSS
config NETFILTER_XT_MATCH_HASHLIMIT config NETFILTER_XT_MATCH_HASHLIMIT
tristate '"hashlimit" match support' tristate '"hashlimit" match support'
depends on NETFILTER_XTABLES depends on NETFILTER_XTABLES && (IP6_NF_IPTABLES || IP6_NF_IPTABLES=n)
help help
This option adds a `hashlimit' match. This option adds a `hashlimit' match.
......
...@@ -303,10 +303,16 @@ static int skp_epaddr_len(struct nf_conn *ct, const char *dptr, ...@@ -303,10 +303,16 @@ static int skp_epaddr_len(struct nf_conn *ct, const char *dptr,
{ {
int s = *shift; int s = *shift;
for (; dptr <= limit && *dptr != '@'; dptr++) /* Search for @, but stop at the end of the line.
* We are inside a sip: URI, so we don't need to worry about
* continuation lines. */
while (dptr <= limit &&
*dptr != '@' && *dptr != '\r' && *dptr != '\n') {
(*shift)++; (*shift)++;
dptr++;
}
if (*dptr == '@') { if (dptr <= limit && *dptr == '@') {
dptr++; dptr++;
(*shift)++; (*shift)++;
} else } else
......
...@@ -52,6 +52,8 @@ match(const struct sk_buff *skb, ...@@ -52,6 +52,8 @@ match(const struct sk_buff *skb,
{ {
const struct xt_connbytes_info *sinfo = matchinfo; const struct xt_connbytes_info *sinfo = matchinfo;
u_int64_t what = 0; /* initialize to make gcc happy */ u_int64_t what = 0; /* initialize to make gcc happy */
u_int64_t bytes = 0;
u_int64_t pkts = 0;
const struct ip_conntrack_counter *counters; const struct ip_conntrack_counter *counters;
if (!(counters = nf_ct_get_counters(skb))) if (!(counters = nf_ct_get_counters(skb)))
...@@ -89,29 +91,22 @@ match(const struct sk_buff *skb, ...@@ -89,29 +91,22 @@ match(const struct sk_buff *skb,
case XT_CONNBYTES_AVGPKT: case XT_CONNBYTES_AVGPKT:
switch (sinfo->direction) { switch (sinfo->direction) {
case XT_CONNBYTES_DIR_ORIGINAL: case XT_CONNBYTES_DIR_ORIGINAL:
what = div64_64(counters[IP_CT_DIR_ORIGINAL].bytes, bytes = counters[IP_CT_DIR_ORIGINAL].bytes;
counters[IP_CT_DIR_ORIGINAL].packets); pkts = counters[IP_CT_DIR_ORIGINAL].packets;
break; break;
case XT_CONNBYTES_DIR_REPLY: case XT_CONNBYTES_DIR_REPLY:
what = div64_64(counters[IP_CT_DIR_REPLY].bytes, bytes = counters[IP_CT_DIR_REPLY].bytes;
counters[IP_CT_DIR_REPLY].packets); pkts = counters[IP_CT_DIR_REPLY].packets;
break; break;
case XT_CONNBYTES_DIR_BOTH: case XT_CONNBYTES_DIR_BOTH:
{ bytes = counters[IP_CT_DIR_ORIGINAL].bytes +
u_int64_t bytes; counters[IP_CT_DIR_REPLY].bytes;
u_int64_t pkts; pkts = counters[IP_CT_DIR_ORIGINAL].packets +
bytes = counters[IP_CT_DIR_ORIGINAL].bytes + counters[IP_CT_DIR_REPLY].packets;
counters[IP_CT_DIR_REPLY].bytes;
pkts = counters[IP_CT_DIR_ORIGINAL].packets+
counters[IP_CT_DIR_REPLY].packets;
/* FIXME_THEORETICAL: what to do if sum
* overflows ? */
what = div64_64(bytes, pkts);
}
break; break;
} }
if (pkts != 0)
what = div64_64(bytes, pkts);
break; break;
} }
......
...@@ -621,7 +621,13 @@ static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds, ...@@ -621,7 +621,13 @@ static void sctp_cmd_transport_on(sctp_cmd_seq_t *cmds,
/* The receiver of the HEARTBEAT ACK should also perform an /* The receiver of the HEARTBEAT ACK should also perform an
* RTT measurement for that destination transport address * RTT measurement for that destination transport address
* using the time value carried in the HEARTBEAT ACK chunk. * using the time value carried in the HEARTBEAT ACK chunk.
* If the transport's rto_pending variable has been cleared,
* it was most likely due to a retransmit. However, we want
* to re-enable it to properly update the rto.
*/ */
if (t->rto_pending == 0)
t->rto_pending = 1;
hbinfo = (sctp_sender_hb_info_t *) chunk->skb->data; hbinfo = (sctp_sender_hb_info_t *) chunk->skb->data;
sctp_transport_update_rto(t, (jiffies - hbinfo->sent_at)); sctp_transport_update_rto(t, (jiffies - hbinfo->sent_at));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment