Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163289
b: refs/heads/master
c: 07a6a4a
h: refs/heads/master
i:
  163287: 2cf79bf
v: v3
  • Loading branch information
Hidetoshi Seto authored and Tony Luck committed Sep 14, 2009
1 parent 6fdd685 commit e76ae46
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4295ab34883d2070b1145e14f4619478e9788807
refs/heads/master: 07a6a4ae827b54cec4c1b1d92bed1cc9176b45ec
1 change: 1 addition & 0 deletions trunk/arch/ia64/include/asm/mca.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ extern void ia64_mca_ucmc_handler(struct pt_regs *, struct ia64_sal_os_state *);
extern void ia64_init_handler(struct pt_regs *,
struct switch_stack *,
struct ia64_sal_os_state *);
extern void ia64_os_init_on_kdump(void);
extern void ia64_monarch_init_handler(void);
extern void ia64_slave_init_handler(void);
extern void ia64_mca_cmc_vector_setup(void);
Expand Down
12 changes: 12 additions & 0 deletions trunk/arch/ia64/kernel/machine_kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
#include <asm/delay.h>
#include <asm/meminit.h>
#include <asm/processor.h>
#include <asm/sal.h>
#include <asm/mca.h>

typedef NORET_TYPE void (*relocate_new_kernel_t)(
unsigned long indirection_page,
Expand Down Expand Up @@ -85,11 +87,21 @@ static void ia64_machine_kexec(struct unw_frame_info *info, void *arg)
void *pal_addr = efi_get_pal_addr();
unsigned long code_addr = (unsigned long)page_address(image->control_code_page);
int ii;
u64 fp, gp;
ia64_fptr_t *init_handler = (ia64_fptr_t *)ia64_os_init_on_kdump;

BUG_ON(!image);
if (image->type == KEXEC_TYPE_CRASH) {
crash_save_this_cpu();
current->thread.ksp = (__u64)info->sw - 16;

/* Register noop init handler */
fp = ia64_tpa(init_handler->fp);
gp = ia64_tpa(ia64_getreg(_IA64_REG_GP));
ia64_sal_set_vectors(SAL_VECTOR_OS_INIT, fp, gp, 0, fp, gp, 0);
} else {
/* Unregister init handlers of current kernel */
ia64_sal_set_vectors(SAL_VECTOR_OS_INIT, 0, 0, 0, 0, 0, 0);
}

/* Interrupts aren't acceptable while we reboot */
Expand Down
20 changes: 20 additions & 0 deletions trunk/arch/ia64/kernel/mca_asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

.global ia64_do_tlb_purge
.global ia64_os_mca_dispatch
.global ia64_os_init_on_kdump
.global ia64_os_init_dispatch_monarch
.global ia64_os_init_dispatch_slave

Expand Down Expand Up @@ -298,6 +299,25 @@ END(ia64_os_mca_virtual_begin)

//StartMain////////////////////////////////////////////////////////////////////

//
// NOP init handler for kdump. In panic situation, we may receive INIT
// while kernel transition. Since we initialize registers on leave from
// current kernel, no longer monarch/slave handlers of current kernel in
// virtual mode are called safely.
// We can unregister these init handlers from SAL, however then the INIT
// will result in warmboot by SAL and we cannot retrieve the crashdump.
// Therefore register this NOP function to SAL, to prevent entering virtual
// mode and resulting warmboot by SAL.
//
ia64_os_init_on_kdump:
mov r8=r0 // IA64_INIT_RESUME
mov r9=r10 // SAL_GP
mov r22=r17 // *minstate
;;
mov r10=r0 // return to same context
mov b0=r12 // SAL_CHECK return address
br b0

//
// SAL to OS entry point for INIT on all processors. This has been defined for
// registration purposes with SAL as a part of ia64_mca_init. Monarch and
Expand Down

0 comments on commit e76ae46

Please sign in to comment.