From patchwork Wed Jul 8 04:37:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Mendoza-Jonas X-Patchwork-Id: 492721 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id EB201140770 for ; Wed, 8 Jul 2015 14:38:56 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id D1C6D1A1E63 for ; Wed, 8 Jul 2015 14:38:56 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id A9E3A1A1D20 for ; Wed, 8 Jul 2015 14:37:59 +1000 (AEST) Received: by ozlabs.org (Postfix) id 8FF2F140B0E; Wed, 8 Jul 2015 14:37:59 +1000 (AEST) Delivered-To: linuxppc-dev@ozlabs.org Received: from e23smtp07.au.ibm.com (e23smtp07.au.ibm.com [202.81.31.140]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 747E1140B0D for ; Wed, 8 Jul 2015 14:37:59 +1000 (AEST) Received: from /spool/local by e23smtp07.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 8 Jul 2015 14:37:59 +1000 Received: from d23dlp01.au.ibm.com (202.81.31.203) by e23smtp07.au.ibm.com (202.81.31.204) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 8 Jul 2015 14:37:58 +1000 X-Helo: d23dlp01.au.ibm.com X-MailFrom: sam.mj@au1.ibm.com X-RcptTo: linuxppc-dev@ozlabs.org Received: from d23relay10.au.ibm.com (d23relay10.au.ibm.com [9.190.26.77]) by d23dlp01.au.ibm.com (Postfix) with ESMTP id AFF0D2CE8052 for ; Wed, 8 Jul 2015 14:37:57 +1000 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay10.au.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t684bnT050135094 for ; Wed, 8 Jul 2015 14:37:57 +1000 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t684bPwg007406 for ; Wed, 8 Jul 2015 14:37:25 +1000 Received: from ozlabs.au.ibm.com (ozlabs.au.ibm.com [9.192.253.14]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t684bOKr006703; Wed, 8 Jul 2015 14:37:25 +1000 Received: from skellige.ozlabs.ibm.com (unknown [9.192.254.114]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 6071DA023F; Wed, 8 Jul 2015 14:37:00 +1000 (AEST) From: Samuel Mendoza-Jonas To: linuxppc-dev@ozlabs.org Subject: [PATCH V2 2/2] powerpc/kexec: Reset HILE before kexec_sequence Date: Wed, 8 Jul 2015 14:37:13 +1000 Message-Id: <1436330233-28489-2-git-send-email-sam.mj@au1.ibm.com> X-Mailer: git-send-email 2.4.5 In-Reply-To: <1436330233-28489-1-git-send-email-sam.mj@au1.ibm.com> References: <1436330233-28489-1-git-send-email-sam.mj@au1.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15070804-0025-0000-0000-000001BF0003 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Samuel Mendoza-Jonas MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" On powernv secondary cpus are returned to OPAL, and will then enter the target kernel in big-endian. However if it is set the HILE bit will persist, causing the first exception in the target kernel to be delivered in litte-endian regardless of the kernel endianess. Make sure that the HILE bit is switched off before entering kexec_sequence. Signed-off-by: Samuel Mendoza-Jonas --- arch/powerpc/kernel/machine_kexec_64.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c index 1a74446..2266135c 100644 --- a/arch/powerpc/kernel/machine_kexec_64.c +++ b/arch/powerpc/kernel/machine_kexec_64.c @@ -22,8 +22,10 @@ #include #include #include +#include #include #include +#include #include #include /* _end */ #include @@ -356,6 +358,10 @@ void default_machine_kexec(struct kimage *image) * switched to a static version! */ + /* Reset HILE in case we kexec into an older BE kernel */ + if (firmware_has_feature(FW_FEATURE_OPALv3)) + opal_reinit_cpus(OPAL_REINIT_CPUS_HILE_BE); + /* Some things are best done in assembly. Finding globals with * a toc is easier in C, so pass in what we can. */