Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] alpha pt_regs cleanups: machine_check()

do set_irq_regs() in caller, kill pt_regs argument.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Al Viro and committed by
Linus Torvalds
4fa1970a 3dbb8c62

+61 -71
+2 -3
arch/alpha/kernel/core_apecs.c
··· 387 387 } 388 388 389 389 void 390 - apecs_machine_check(unsigned long vector, unsigned long la_ptr, 391 - struct pt_regs * regs) 390 + apecs_machine_check(unsigned long vector, unsigned long la_ptr) 392 391 { 393 392 struct el_common *mchk_header; 394 393 struct el_apecs_procdata *mchk_procdata; ··· 411 412 wrmces(0x7); /* reset machine check pending flag */ 412 413 mb(); 413 414 414 - process_mcheck_info(vector, la_ptr, regs, "APECS", 415 + process_mcheck_info(vector, la_ptr, "APECS", 415 416 (mcheck_expected(0) 416 417 && (mchk_sysdata->epic_dcsr & 0x0c00UL))); 417 418 }
+2 -3
arch/alpha/kernel/core_cia.c
··· 1192 1192 } 1193 1193 1194 1194 void 1195 - cia_machine_check(unsigned long vector, unsigned long la_ptr, 1196 - struct pt_regs * regs) 1195 + cia_machine_check(unsigned long vector, unsigned long la_ptr) 1197 1196 { 1198 1197 int expected; 1199 1198 ··· 1207 1208 expected = mcheck_expected(0); 1208 1209 if (!expected && vector == 0x660) 1209 1210 expected = cia_decode_mchk(la_ptr); 1210 - process_mcheck_info(vector, la_ptr, regs, "CIA", expected); 1211 + process_mcheck_info(vector, la_ptr, "CIA", expected); 1211 1212 }
+3 -3
arch/alpha/kernel/core_lca.c
··· 19 19 #include <linux/tty.h> 20 20 21 21 #include <asm/ptrace.h> 22 + #include <asm/irq_regs.h> 22 23 #include <asm/smp.h> 23 24 24 25 #include "proto.h" ··· 387 386 } 388 387 389 388 void 390 - lca_machine_check(unsigned long vector, unsigned long la_ptr, 391 - struct pt_regs *regs) 389 + lca_machine_check(unsigned long vector, unsigned long la_ptr) 392 390 { 393 391 const char * reason; 394 392 union el_lca el; ··· 397 397 wrmces(rdmces()); /* reset machine check pending flag */ 398 398 399 399 printk(KERN_CRIT "LCA machine check: vector=%#lx pc=%#lx code=%#x\n", 400 - vector, regs->pc, (unsigned int) el.c->code); 400 + vector, get_irq_regs()->pc, (unsigned int) el.c->code); 401 401 402 402 /* 403 403 * The first quadword after the common header always seems to
+2 -3
arch/alpha/kernel/core_mcpcia.c
··· 572 572 } 573 573 574 574 void 575 - mcpcia_machine_check(unsigned long vector, unsigned long la_ptr, 576 - struct pt_regs * regs) 575 + mcpcia_machine_check(unsigned long vector, unsigned long la_ptr) 577 576 { 578 577 struct el_common *mchk_header; 579 578 struct el_MCPCIA_uncorrected_frame_mcheck *mchk_logout; ··· 609 610 wrmces(0x7); 610 611 mb(); 611 612 612 - process_mcheck_info(vector, la_ptr, regs, "MCPCIA", expected != 0); 613 + process_mcheck_info(vector, la_ptr, "MCPCIA", expected != 0); 613 614 if (!expected && vector != 0x620 && vector != 0x630) { 614 615 mcpcia_print_uncorrectable(mchk_logout); 615 616 mcpcia_print_system_area(la_ptr);
+2 -3
arch/alpha/kernel/core_polaris.c
··· 187 187 } 188 188 189 189 void 190 - polaris_machine_check(unsigned long vector, unsigned long la_ptr, 191 - struct pt_regs * regs) 190 + polaris_machine_check(unsigned long vector, unsigned long la_ptr) 192 191 { 193 192 /* Clear the error before any reporting. */ 194 193 mb(); ··· 197 198 wrmces(0x7); 198 199 mb(); 199 200 200 - process_mcheck_info(vector, la_ptr, regs, "POLARIS", 201 + process_mcheck_info(vector, la_ptr, "POLARIS", 201 202 mcheck_expected(0)); 202 203 }
+2 -3
arch/alpha/kernel/core_t2.c
··· 551 551 * Hence all the taken/expected/any_expected/last_taken stuff... 552 552 */ 553 553 void 554 - t2_machine_check(unsigned long vector, unsigned long la_ptr, 555 - struct pt_regs * regs) 554 + t2_machine_check(unsigned long vector, unsigned long la_ptr) 556 555 { 557 556 int cpu = smp_processor_id(); 558 557 #ifdef CONFIG_VERBOSE_MCHECK ··· 617 618 } 618 619 #endif 619 620 620 - process_mcheck_info(vector, la_ptr, regs, "T2", mcheck_expected(cpu)); 621 + process_mcheck_info(vector, la_ptr, "T2", mcheck_expected(cpu)); 621 622 }
+2 -3
arch/alpha/kernel/core_tsunami.c
··· 443 443 } 444 444 445 445 void 446 - tsunami_machine_check(unsigned long vector, unsigned long la_ptr, 447 - struct pt_regs * regs) 446 + tsunami_machine_check(unsigned long vector, unsigned long la_ptr) 448 447 { 449 448 /* Clear error before any reporting. */ 450 449 mb(); ··· 453 454 wrmces(0x7); 454 455 mb(); 455 456 456 - process_mcheck_info(vector, la_ptr, regs, "TSUNAMI", 457 + process_mcheck_info(vector, la_ptr, "TSUNAMI", 457 458 mcheck_expected(smp_processor_id())); 458 459 }
+2 -3
arch/alpha/kernel/core_wildfire.c
··· 322 322 } 323 323 324 324 void 325 - wildfire_machine_check(unsigned long vector, unsigned long la_ptr, 326 - struct pt_regs * regs) 325 + wildfire_machine_check(unsigned long vector, unsigned long la_ptr) 327 326 { 328 327 mb(); 329 328 mb(); /* magic */ ··· 331 332 wrmces(0x7); 332 333 mb(); 333 334 334 - process_mcheck_info(vector, la_ptr, regs, "WILDFIRE", 335 + process_mcheck_info(vector, la_ptr, "WILDFIRE", 335 336 mcheck_expected(smp_processor_id())); 336 337 } 337 338
+3 -2
arch/alpha/kernel/err_ev6.c
··· 11 11 #include <linux/sched.h> 12 12 13 13 #include <asm/io.h> 14 + #include <asm/irq_regs.h> 14 15 #include <asm/hwrpb.h> 15 16 #include <asm/smp.h> 16 17 #include <asm/err_common.h> ··· 230 229 } 231 230 232 231 void 233 - ev6_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs) 232 + ev6_machine_check(u64 vector, u64 la_ptr) 234 233 { 235 234 struct el_common *mchk_header = (struct el_common *)la_ptr; 236 235 ··· 261 260 (unsigned int)vector, (int)smp_processor_id()); 262 261 263 262 ev6_process_logout_frame(mchk_header, 1); 264 - dik_show_regs(regs, NULL); 263 + dik_show_regs(get_irq_regs(), NULL); 265 264 266 265 err_print_prefix = saved_err_prefix; 267 266 }
+1 -1
arch/alpha/kernel/err_ev7.c
··· 118 118 } 119 119 120 120 void 121 - ev7_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs) 121 + ev7_machine_check(u64 vector, u64 la_ptr) 122 122 { 123 123 struct el_subpacket *el_ptr = (struct el_subpacket *)la_ptr; 124 124 char *saved_err_prefix = err_print_prefix;
+5 -5
arch/alpha/kernel/err_impl.h
··· 60 60 ev7_collect_logout_frame_subpackets(struct el_subpacket *, 61 61 struct ev7_lf_subpackets *); 62 62 extern void ev7_register_error_handlers(void); 63 - extern void ev7_machine_check(u64, u64, struct pt_regs *); 63 + extern void ev7_machine_check(u64, u64); 64 64 65 65 /* 66 66 * err_ev6.c 67 67 */ 68 68 extern void ev6_register_error_handlers(void); 69 69 extern int ev6_process_logout_frame(struct el_common *, int); 70 - extern void ev6_machine_check(u64, u64, struct pt_regs *); 70 + extern void ev6_machine_check(u64, u64); 71 71 72 72 /* 73 73 * err_marvel.c 74 74 */ 75 - extern void marvel_machine_check(u64, u64, struct pt_regs *); 75 + extern void marvel_machine_check(u64, u64); 76 76 extern void marvel_register_error_handlers(void); 77 77 78 78 /* 79 79 * err_titan.c 80 80 */ 81 81 extern int titan_process_logout_frame(struct el_common *, int); 82 - extern void titan_machine_check(u64, u64, struct pt_regs *); 82 + extern void titan_machine_check(u64, u64); 83 83 extern void titan_register_error_handlers(void); 84 84 extern int privateer_process_logout_frame(struct el_common *, int); 85 - extern void privateer_machine_check(u64, u64, struct pt_regs *); 85 + extern void privateer_machine_check(u64, u64);
+2 -2
arch/alpha/kernel/err_marvel.c
··· 1042 1042 } 1043 1043 1044 1044 void 1045 - marvel_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs) 1045 + marvel_machine_check(u64 vector, u64 la_ptr) 1046 1046 { 1047 1047 struct el_subpacket *el_ptr = (struct el_subpacket *)la_ptr; 1048 1048 int (*process_frame)(struct ev7_lf_subpackets *, int) = NULL; ··· 1077 1077 1078 1078 default: 1079 1079 /* Don't know it - pass it up. */ 1080 - ev7_machine_check(vector, la_ptr, regs); 1080 + ev7_machine_check(vector, la_ptr); 1081 1081 return; 1082 1082 } 1083 1083
+7 -7
arch/alpha/kernel/err_titan.c
··· 379 379 } 380 380 381 381 void 382 - titan_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs) 382 + titan_machine_check(u64 vector, u64 la_ptr) 383 383 { 384 384 struct el_common *mchk_header = (struct el_common *)la_ptr; 385 385 struct el_TITAN_sysdata_mcheck *tmchk = ··· 408 408 * Only handle system errors here 409 409 */ 410 410 if ((vector != SCB_Q_SYSMCHK) && (vector != SCB_Q_SYSERR)) { 411 - ev6_machine_check(vector, la_ptr, regs); 411 + ev6_machine_check(vector, la_ptr); 412 412 return; 413 413 } 414 414 ··· 442 442 #ifdef CONFIG_VERBOSE_MCHECK 443 443 titan_process_logout_frame(mchk_header, alpha_verbose_mcheck); 444 444 if (alpha_verbose_mcheck) 445 - dik_show_regs(regs, NULL); 445 + dik_show_regs(get_irq_regs(), NULL); 446 446 #endif /* CONFIG_VERBOSE_MCHECK */ 447 447 448 448 err_print_prefix = saved_err_prefix; ··· 452 452 * machine checks to interrupts 453 453 */ 454 454 irqmask = tmchk->c_dirx & TITAN_MCHECK_INTERRUPT_MASK; 455 - titan_dispatch_irqs(irqmask, regs); 455 + titan_dispatch_irqs(irqmask, get_irq_regs()); 456 456 } 457 457 458 458 ··· 701 701 } 702 702 703 703 void 704 - privateer_machine_check(u64 vector, u64 la_ptr, struct pt_regs *regs) 704 + privateer_machine_check(u64 vector, u64 la_ptr) 705 705 { 706 706 struct el_common *mchk_header = (struct el_common *)la_ptr; 707 707 struct el_TITAN_sysdata_mcheck *tmchk = ··· 723 723 * Only handle system events here. 724 724 */ 725 725 if (vector != SCB_Q_SYSEVENT) 726 - return titan_machine_check(vector, la_ptr, regs); 726 + return titan_machine_check(vector, la_ptr); 727 727 728 728 /* 729 729 * Report the event - System Events should be reported even if no ··· 746 746 /* 747 747 * Dispatch the interrupt(s). 748 748 */ 749 - titan_dispatch_irqs(irqmask, regs); 749 + titan_dispatch_irqs(irqmask, get_irq_regs()); 750 750 751 751 /* 752 752 * Release the logout frame.
+6 -5
arch/alpha/kernel/irq_alpha.c
··· 72 72 set_irq_regs(old_regs); 73 73 return; 74 74 case 2: 75 - alpha_mv.machine_check(vector, la_ptr, regs); 75 + old_regs = set_irq_regs(regs); 76 + alpha_mv.machine_check(vector, la_ptr); 77 + set_irq_regs(old_regs); 76 78 return; 77 79 case 3: 78 80 old_regs = set_irq_regs(regs); ··· 127 125 128 126 void 129 127 process_mcheck_info(unsigned long vector, unsigned long la_ptr, 130 - struct pt_regs *regs, const char *machine, 131 - int expected) 128 + const char *machine, int expected) 132 129 { 133 130 struct el_common *mchk_header; 134 131 const char *reason; ··· 154 153 mchk_header = (struct el_common *)la_ptr; 155 154 156 155 printk(KERN_CRIT "%s machine check: vector=0x%lx pc=0x%lx code=0x%x\n", 157 - machine, vector, regs->pc, mchk_header->code); 156 + machine, vector, get_irq_regs()->pc, mchk_header->code); 158 157 159 158 switch (mchk_header->code) { 160 159 /* Machine check reasons. Defined according to PALcode sources. */ ··· 195 194 printk(KERN_CRIT "machine check type: %s%s\n", 196 195 reason, mchk_header->retry ? " (retryable)" : ""); 197 196 198 - dik_show_regs(regs, NULL); 197 + dik_show_regs(get_irq_regs(), NULL); 199 198 200 199 #ifdef CONFIG_VERBOSE_MCHECK 201 200 if (alpha_verbose_mcheck > 1) {
+11 -12
arch/alpha/kernel/proto.h
··· 20 20 extern struct pci_ops apecs_pci_ops; 21 21 extern void apecs_init_arch(void); 22 22 extern void apecs_pci_clr_err(void); 23 - extern void apecs_machine_check(u64, u64, struct pt_regs *); 23 + extern void apecs_machine_check(u64, u64); 24 24 extern void apecs_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); 25 25 26 26 /* core_cia.c */ ··· 29 29 extern void cia_init_arch(void); 30 30 extern void pyxis_init_arch(void); 31 31 extern void cia_kill_arch(int); 32 - extern void cia_machine_check(u64, u64, struct pt_regs *); 32 + extern void cia_machine_check(u64, u64); 33 33 extern void cia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); 34 34 35 35 /* core_irongate.c */ ··· 42 42 /* core_lca.c */ 43 43 extern struct pci_ops lca_pci_ops; 44 44 extern void lca_init_arch(void); 45 - extern void lca_machine_check(u64, u64, struct pt_regs *); 45 + extern void lca_machine_check(u64, u64); 46 46 extern void lca_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); 47 47 48 48 /* core_marvel.c */ 49 49 extern struct pci_ops marvel_pci_ops; 50 50 extern void marvel_init_arch(void); 51 51 extern void marvel_kill_arch(int); 52 - extern void marvel_machine_check(u64, u64, struct pt_regs *); 52 + extern void marvel_machine_check(u64, u64); 53 53 extern void marvel_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); 54 54 extern int marvel_pa_to_nid(unsigned long); 55 55 extern int marvel_cpuid_to_nid(int); ··· 64 64 extern struct pci_ops mcpcia_pci_ops; 65 65 extern void mcpcia_init_arch(void); 66 66 extern void mcpcia_init_hoses(void); 67 - extern void mcpcia_machine_check(u64, u64, struct pt_regs *); 67 + extern void mcpcia_machine_check(u64, u64); 68 68 extern void mcpcia_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); 69 69 70 70 /* core_polaris.c */ ··· 72 72 extern int polaris_read_config_dword(struct pci_dev *, int, u32 *); 73 73 extern int polaris_write_config_dword(struct pci_dev *, int, u32); 74 74 extern void polaris_init_arch(void); 75 - extern void polaris_machine_check(u64, u64, struct pt_regs *); 75 + extern void polaris_machine_check(u64, u64); 76 76 #define polaris_pci_tbi ((void *)0) 77 77 78 78 /* core_t2.c */ 79 79 extern struct pci_ops t2_pci_ops; 80 80 extern void t2_init_arch(void); 81 81 extern void t2_kill_arch(int); 82 - extern void t2_machine_check(u64, u64, struct pt_regs *); 82 + extern void t2_machine_check(u64, u64); 83 83 extern void t2_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); 84 84 85 85 /* core_titan.c */ 86 86 extern struct pci_ops titan_pci_ops; 87 87 extern void titan_init_arch(void); 88 88 extern void titan_kill_arch(int); 89 - extern void titan_machine_check(u64, u64, struct pt_regs *); 89 + extern void titan_machine_check(u64, u64); 90 90 extern void titan_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); 91 91 extern struct _alpha_agp_info *titan_agp_info(void); 92 92 ··· 94 94 extern struct pci_ops tsunami_pci_ops; 95 95 extern void tsunami_init_arch(void); 96 96 extern void tsunami_kill_arch(int); 97 - extern void tsunami_machine_check(u64, u64, struct pt_regs *); 97 + extern void tsunami_machine_check(u64, u64); 98 98 extern void tsunami_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); 99 99 100 100 /* core_wildfire.c */ 101 101 extern struct pci_ops wildfire_pci_ops; 102 102 extern void wildfire_init_arch(void); 103 103 extern void wildfire_kill_arch(int); 104 - extern void wildfire_machine_check(u64, u64, struct pt_regs *); 104 + extern void wildfire_machine_check(u64, u64); 105 105 extern void wildfire_pci_tbi(struct pci_controller *, dma_addr_t, dma_addr_t); 106 106 extern int wildfire_pa_to_nid(unsigned long); 107 107 extern int wildfire_cpuid_to_nid(int); ··· 214 214 #endif 215 215 216 216 extern void process_mcheck_info(unsigned long vector, unsigned long la_ptr, 217 - struct pt_regs *regs, const char *machine, 218 - int expected); 217 + const char *machine, int expected);
+1 -1
arch/alpha/kernel/sys_jensen.c
··· 244 244 } 245 245 246 246 static void 247 - jensen_machine_check (u64 vector, u64 la, struct pt_regs *regs) 247 + jensen_machine_check (u64 vector, u64 la) 248 248 { 249 249 printk(KERN_CRIT "Machine check\n"); 250 250 }
+2 -3
arch/alpha/kernel/sys_mikasa.c
··· 182 182 183 183 #if defined(CONFIG_ALPHA_GENERIC) || !defined(CONFIG_ALPHA_PRIMO) 184 184 static void 185 - mikasa_apecs_machine_check(unsigned long vector, unsigned long la_ptr, 186 - struct pt_regs * regs) 185 + mikasa_apecs_machine_check(unsigned long vector, unsigned long la_ptr) 187 186 { 188 187 #define MCHK_NO_DEVSEL 0x205U 189 188 #define MCHK_NO_TABT 0x204U ··· 201 202 mb(); 202 203 203 204 code = mchk_header->code; 204 - process_mcheck_info(vector, la_ptr, regs, "MIKASA APECS", 205 + process_mcheck_info(vector, la_ptr, "MIKASA APECS", 205 206 (mcheck_expected(0) 206 207 && (code == MCHK_NO_DEVSEL 207 208 || code == MCHK_NO_TABT)));
+3 -4
arch/alpha/kernel/sys_nautilus.c
··· 124 124 in the system. They are analysed separately but all starts here. */ 125 125 126 126 void 127 - nautilus_machine_check(unsigned long vector, unsigned long la_ptr, 128 - struct pt_regs *regs) 127 + nautilus_machine_check(unsigned long vector, unsigned long la_ptr) 129 128 { 130 129 char *mchk_class; 131 130 ··· 164 165 else if (vector == SCB_Q_SYSMCHK) 165 166 mchk_class = "Fatal"; 166 167 else { 167 - ev6_machine_check(vector, la_ptr, regs); 168 + ev6_machine_check(vector, la_ptr); 168 169 return; 169 170 } 170 171 ··· 172 173 "[%s System Machine Check (NMI)]\n", 173 174 vector, mchk_class); 174 175 175 - naut_sys_machine_check(vector, la_ptr, regs); 176 + naut_sys_machine_check(vector, la_ptr, get_irq_regs()); 176 177 177 178 /* Tell the PALcode to clear the machine check */ 178 179 draina();
+2 -3
arch/alpha/kernel/sys_noritake.c
··· 264 264 265 265 #if defined(CONFIG_ALPHA_GENERIC) || !defined(CONFIG_ALPHA_PRIMO) 266 266 static void 267 - noritake_apecs_machine_check(unsigned long vector, unsigned long la_ptr, 268 - struct pt_regs * regs) 267 + noritake_apecs_machine_check(unsigned long vector, unsigned long la_ptr) 269 268 { 270 269 #define MCHK_NO_DEVSEL 0x205U 271 270 #define MCHK_NO_TABT 0x204U ··· 283 284 mb(); 284 285 285 286 code = mchk_header->code; 286 - process_mcheck_info(vector, la_ptr, regs, "NORITAKE APECS", 287 + process_mcheck_info(vector, la_ptr, "NORITAKE APECS", 287 288 (mcheck_expected(0) 288 289 && (code == MCHK_NO_DEVSEL 289 290 || code == MCHK_NO_TABT)));
+1 -2
include/asm-alpha/machvec.h
··· 15 15 16 16 struct task_struct; 17 17 struct mm_struct; 18 - struct pt_regs; 19 18 struct vm_area_struct; 20 19 struct linux_hose_info; 21 20 struct pci_dev; ··· 79 80 void (*update_irq_hw)(unsigned long, unsigned long, int); 80 81 void (*ack_irq)(unsigned long); 81 82 void (*device_interrupt)(unsigned long vector); 82 - void (*machine_check)(u64 vector, u64 la, struct pt_regs *regs); 83 + void (*machine_check)(u64 vector, u64 la); 83 84 84 85 void (*smp_callin)(void); 85 86 void (*init_arch)(void);