Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46043
b: refs/heads/master
c: ae2c27a
h: refs/heads/master
i:
  46041: cf8c108
  46039: 5fe01c8
v: v3
  • Loading branch information
Jeff Garzik committed Feb 2, 2007
1 parent 8263781 commit 6646e1c
Show file tree
Hide file tree
Showing 31 changed files with 155 additions and 105 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a608ab9cb6a5050394498b2520c6e7c162f4e2cf
refs/heads/master: ae2c27a78f1df5b0967069cd3b916cff1eb044c8
66 changes: 35 additions & 31 deletions trunk/Documentation/sysrq.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Linux Magic System Request Key Hacks
Documentation for sysrq.c version 1.15
Last update: $Date: 2001/01/28 10:15:59 $
Documentation for sysrq.c
Last update: 2007-JAN-06

* What is the magic SysRq key?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -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
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?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand All @@ -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
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

Expand All @@ -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.

'd' - Shows all locks that are held.

'o' - Will shut your system off (if configured and supported).

's' - Will attempt to sync all mounted filesystems.
Expand All @@ -87,38 +89,43 @@ On all - write a character to /proc/sysrq-trigger. eg:

'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.

'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
will be printed to your console. ('0', for example would make
it so that only emergency messages like PANICs or OOPSes would
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.

'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
will be non-functional after this.)
'i' - Send a SIGKILL to all processes, except for init.

'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 :-)

* Okay, so what can I use them for?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
trojan program is running at console and which could grab your password
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
sa'K' (Secure Access Key) is useful when you want to be sure there is no
trojan program running at console which could grab your password
when you would try to login. It will kill all programs on given console,
thus letting you make sure that the login prompt you see is actually
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: c2 compliant system, and it should not be mistaken as :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.
(For example, X or a svgalib program.)

Expand All @@ -139,8 +146,8 @@ OK or Done message...)
Again, the unmount (remount read-only) hasn't taken place until you see the
"OK" and "Done" message appear on the screen.

The loglevel'0'-'9' is useful when your console is being flooded with
kernel messages you do not want to see. Setting '0' will prevent all but
The loglevels '0'-'9' are useful when your console is being flooded with
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
still be logged if syslogd/klogd are alive, though.)

Expand All @@ -152,7 +159,7 @@ processes.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
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.

* I hit SysRq, but nothing seems to happen, what's wrong?
Expand All @@ -174,27 +181,24 @@ 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
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
register_sysrq_key(int key, struct sysrq_key_op *op_p) that is defined in
sysrq.h, this will register the operation pointed to by 'op_p' at table
key 'key', if that slot in the table is blank. At module unload time, you must
call the macro unregister_sysrq_key(int key, struct sysrq_key_op *op_p), which
After the sysrq_key_op is created, you can call the kernel function
register_sysrq_key(int key, struct sysrq_key_op *op_p); this will
register the operation pointed to by 'op_p' at table key 'key',
if that slot in the table is blank. At module unload time, you must call
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
it is currently registered in that slot. This is in case the slot has been
overwritten since you registered it.

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
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,
__sysrq_unlock_table, __sysrq_get_key_op, and __sysrq_put_key_op. The
functions __sysrq_swap_key_ops and __sysrq_swap_key_ops_nolock are defined
in the header itself, and the REGISTER and UNREGISTER macros are built from
these. More complex (and dangerous!) manipulations of the table are possible
using these functions, but you must be careful to always lock the table before
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 :)
and 2 functions are exported for interface to it:
register_sysrq_key and unregister_sysrq_key.
Of course, never ever leave an invalid pointer in the table. I.e., when
your module that called register_sysrq_key() exits, it must call
unregister_sysrq_key() to clean up the sysrq key table entry that it used.
Null pointers in the table are always safe. :)

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
Expand Down
8 changes: 1 addition & 7 deletions trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -598,8 +598,6 @@ W: http://linux-atm.sourceforge.net
S: Maintained

ATMEL MACB ETHERNET DRIVER
P: Atmel AVR32 Support Team
M: avr32@atmel.com
P: Haavard Skinnemoen
M: hskinnemoen@atmel.com
S: Supported
Expand All @@ -620,8 +618,6 @@ T: git kernel.org:/pub/scm/linux/kernel/git/dwmw2/audit-2.6.git
S: Maintained

AVR32 ARCHITECTURE
P: Atmel AVR32 Support Team
M: avr32@atmel.com
P: Haavard Skinnemoen
M: hskinnemoen@atmel.com
W: http://www.atmel.com/products/AVR32/
Expand All @@ -630,8 +626,6 @@ W: http://avrfreaks.net/
S: Supported

AVR32/AT32AP MACHINE SUPPORT
P: Atmel AVR32 Support Team
M: avr32@atmel.com
P: Haavard Skinnemoen
M: hskinnemoen@atmel.com
S: Supported
Expand Down Expand Up @@ -2288,7 +2282,7 @@ P: Jozsef Kadlecsik
P: Patrick McHardy
M: kaber@trash.net
L: netfilter-devel@lists.netfilter.org
L: netfilter@lists.netfilter.org
L: netfilter@lists.netfilter.org (subscribers-only)
L: coreteam@netfilter.org
W: http://www.netfilter.org/
W: http://www.iptables.org/
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/i386/boot/compressed/relocs.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ static int is_safe_abs_reloc(const char* sym_name)
/* Match found */
return 1;
}
if (strncmp(sym_name, "__crc_", 6) == 0)
return 1;
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/i386/mach-default/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
* 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
* we can do to check for NMI problems, but that's all I know about
Expand Down
8 changes: 4 additions & 4 deletions trunk/arch/sparc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ int setup_profiling_timer(unsigned int multiplier)

void __init smp_prepare_cpus(unsigned int max_cpus)
{
extern void smp4m_boot_cpus(void);
extern void smp4d_boot_cpus(void);
extern void __init smp4m_boot_cpus(void);
extern void __init smp4d_boot_cpus(void);
int i, cpuid, extra;

printk("Entering SMP Mode...\n");
Expand Down Expand Up @@ -375,8 +375,8 @@ void __init smp_prepare_boot_cpu(void)

int __cpuinit __cpu_up(unsigned int cpu)
{
extern int smp4m_boot_one_cpu(int);
extern int smp4d_boot_one_cpu(int);
extern int __cpuinit smp4m_boot_one_cpu(int);
extern int __cpuinit smp4d_boot_one_cpu(int);
int ret=0;

switch(sparc_cpu_model) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sparc/kernel/sun4d_smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void __init smp4d_boot_cpus(void)
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;
unsigned long *entry = &sun4d_cpu_startup;
Expand Down
20 changes: 11 additions & 9 deletions trunk/drivers/char/sysrq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
.handler = sysrq_handle_showstate_blocked,
.help_msg = "showBlockedTasks",
.help_msg = "shoW-blocked-tasks",
.action_msg = "Show Blocked State",
.enable_mask = SYSRQ_ENABLE_DUMP,
};
Expand Down Expand Up @@ -315,15 +315,16 @@ static struct sysrq_key_op *sysrq_key_table[36] = {
&sysrq_loglevel_op, /* 9 */

/*
* Don't use for system provided sysrqs, it is handled specially on
* sparc and will never arrive
* a: Don't use for system provided sysrqs, it is handled specially on
* sparc and will never arrive.
*/
NULL, /* a */
&sysrq_reboot_op, /* b */
&sysrq_crashdump_op, /* c */
&sysrq_crashdump_op, /* c & ibm_emac driver debug */
&sysrq_showlocks_op, /* d */
&sysrq_term_op, /* e */
&sysrq_moom_op, /* f */
/* g: May be registered by ppc for kgdb */
NULL, /* g */
NULL, /* h */
&sysrq_kill_op, /* i */
Expand All @@ -332,18 +333,19 @@ static struct sysrq_key_op *sysrq_key_table[36] = {
NULL, /* l */
&sysrq_showmem_op, /* m */
&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 */
&sysrq_showregs_op, /* p */
NULL, /* q */
&sysrq_unraw_op, /* r */
&sysrq_unraw_op, /* r */
&sysrq_sync_op, /* s */
&sysrq_showstate_op, /* t */
&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, /* w */
&sysrq_showstate_blocked_op, /* x */
&sysrq_showstate_blocked_op, /* w */
/* x: May be registered on ppc/powerpc for xmon */
NULL, /* x */
NULL, /* y */
NULL /* z */
};
Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/ide/ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -1781,9 +1781,9 @@ static int __init ide_setup(char *s)
return 1;
}

extern void pnpide_init(void);
extern void pnpide_exit(void);
extern void h8300_ide_init(void);
extern void __init pnpide_init(void);
extern void __exit pnpide_exit(void);
extern void __init h8300_ide_init(void);

/*
* probe_for_hwifs() finds/initializes "known" IDE interfaces
Expand Down Expand Up @@ -2088,7 +2088,7 @@ int __init init_module (void)
return ide_init();
}

void cleanup_module (void)
void __exit cleanup_module (void)
{
int index;

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ide/pci/via82cxxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ static struct via_isa_bridge {
u8 rev_max;
u16 flags;
} 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 },
{ "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 },
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,8 @@ static int vmx_vcpu_setup(struct kvm_vcpu *vcpu)

if (rdmsr_safe(index, &data_low, &data_high) < 0)
continue;
if (wrmsr_safe(index, data_low, data_high) < 0)
continue;
data = data_low | ((u64)data_high << 32);
vcpu->host_msrs[j].index = index;
vcpu->host_msrs[j].reserved = 0;
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/net/hamradio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ config SCC_TRXECHO

config BAYCOM_SER_FDX
tristate "BAYCOM ser12 fullduplex driver for AX.25"
depends on AX25
depends on AX25 && !S390
select CRC_CCITT
---help---
This is one of two drivers for Baycom style simple amateur radio
Expand All @@ -133,7 +133,7 @@ config BAYCOM_SER_FDX

config BAYCOM_SER_HDX
tristate "BAYCOM ser12 halfduplex driver for AX.25"
depends on AX25
depends on AX25 && !S390
select CRC_CCITT
---help---
This is one of two drivers for Baycom style simple amateur radio
Expand Down Expand Up @@ -181,7 +181,7 @@ config BAYCOM_EPP

config YAM
tristate "YAM driver for AX.25"
depends on AX25
depends on AX25 && !S390
help
The YAM is a modem for packet radio which connects to the serial
port and includes some of the functions of a Terminal Node
Expand Down
8 changes: 5 additions & 3 deletions trunk/drivers/pci/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,9 +661,11 @@ static void quirk_via_bridge(struct pci_dev *dev)
/* See what bridge we have and find the device ranges */
switch (dev->device) {
case PCI_DEVICE_ID_VIA_82C686:
/* 82C686 is special */
via_vlink_dev_lo = 7;
via_vlink_dev_hi = 7;
/* The VT82C686 is special, it attaches to PCI and can have
any device number. All its subdevices are functions of
that single device. */
via_vlink_dev_lo = PCI_SLOT(dev->devfn);
via_vlink_dev_hi = PCI_SLOT(dev->devfn);
break;
case PCI_DEVICE_ID_VIA_8237:
case PCI_DEVICE_ID_VIA_8237A:
Expand Down
10 changes: 2 additions & 8 deletions trunk/drivers/pci/search.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
* situation and bail out early.
*/
if (unlikely(list_empty(&pci_devices))) {
printk(KERN_INFO "pci_find_subsys() called while pci_devices "
"is still empty\n");
if (unlikely(list_empty(&pci_devices)))
return NULL;
}
down_read(&pci_bus_sem);
n = from ? from->global_list.next : pci_devices.next;

Expand Down Expand Up @@ -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
* situation and bail out early.
*/
if (unlikely(list_empty(&pci_devices))) {
printk(KERN_NOTICE "pci_get_subsys() called while pci_devices "
"is still empty\n");
if (unlikely(list_empty(&pci_devices)))
return NULL;
}
down_read(&pci_bus_sem);
n = from ? from->global_list.next : pci_devices.next;

Expand Down
Loading

0 comments on commit 6646e1c

Please sign in to comment.