From 80eee19464493fb92f0fdde1b9ec4870f267c96b Mon Sep 17 00:00:00 2001 From: Mahesh Salgaonkar Date: Wed, 19 Nov 2014 10:09:11 +0530 Subject: opal: Remove machine check interrupt patching in OPAL. Now that we catch/handle machine check interrupt directly in Linux host PowerNV kernel, we are not anymore dependent on OPAL firmware to do MCE handling job for us. The MCE handling code in OPAL has exclusive stack space (4k size) reserved and remains unused with Linux host not being dependent on it anymore. Hence, this patch removes the code that allows machine check interrupt patching in OPAL and reclaims back 4k of stack space for use of normal stack. For older kernel the patching request will result into an error. The subsequent patch will remove the rest of MCE handling code from OPAL. Signed-off-by: Mahesh Salgaonkar Signed-off-by: Benjamin Herrenschmidt --- core/exceptions.c | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) (limited to 'core') diff --git a/core/exceptions.c b/core/exceptions.c index 6e0d27f..a2ef448 100644 --- a/core/exceptions.c +++ b/core/exceptions.c @@ -421,30 +421,9 @@ static int64_t patch_exception(uint64_t vector, uint64_t glue, bool hv) /* Patch-in the vector number */ *(uint32_t *)(glue + exc_secondary_patch_type) |= vector; - /* - * If machine check, patch GET_STACK to get to the MC stack - * instead of the normal stack. - * - * To simplify the arithmetic involved I make assumptions - * on the fact that the base of all CPU stacks is 64k aligned - * and that our stack size is < 32k, which means that the - * "addi" instruction used in GET_STACK() is always using a - * small (<32k) positive offset, which we can then easily - * fixup with a simple addition - */ BUILD_ASSERT(STACK_SIZE < 0x8000); BUILD_ASSERT(!(CPU_STACKS_BASE & 0xffff)); - if (vector == 0x200) { - /* - * The addi we try to patch is the 3rd instruction - * of GET_STACK(). If you change the macro, you must - * update this code - */ - iaddr = glue + exc_secondary_patch_stack + 8; - *(uint32_t *)iaddr += MC_STACK_SIZE; - } - /* Standard exception ? All done */ if (!hv) goto flush; @@ -469,13 +448,10 @@ static int64_t patch_exception(uint64_t vector, uint64_t glue, bool hv) } static int64_t opal_register_exc_handler(uint64_t opal_exception, - uint64_t handler_address, + uint64_t handler_address __unused, uint64_t glue_cache_line) { switch(opal_exception) { - case OPAL_MACHINE_CHECK_HANDLER: - client_mc_address = handler_address; - return patch_exception(0x200, glue_cache_line, false); case OPAL_HYPERVISOR_MAINTENANCE_HANDLER: return patch_exception(0xe60, glue_cache_line, true); #if 0 /* We let Linux handle softpatch */ -- cgit v1.1