From patchwork Fri May 18 01:58:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Neuling X-Patchwork-Id: 915932 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40nBD40FtFz9s1w for ; Fri, 18 May 2018 11:58:44 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=neuling.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40nBD365ZGzF294 for ; Fri, 18 May 2018 11:58:43 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=neuling.org X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40nBCy1kr3zF28y for ; Fri, 18 May 2018 11:58:38 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=neuling.org Received: from localhost.localdomain (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 40nBCx6vcCz9s1w; Fri, 18 May 2018 11:58:37 +1000 (AEST) Received: by localhost.localdomain (Postfix, from userid 1000) id 8A1D5EE7919; Fri, 18 May 2018 11:58:37 +1000 (AEST) From: Michael Neuling To: stewart@linux.vnet.ibm.com Date: Fri, 18 May 2018 11:58:27 +1000 Message-Id: <20180518015827.1631-1-mikey@neuling.org> X-Mailer: git-send-email 2.14.1 Subject: [Skiboot] [PATCH] cpu: Clear PCR SPR in opal_reinit_cpus() X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: skiboot@lists.ozlabs.org, Michael Neuling MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Currently if Linux boots with a non-zero PCR, things can go bad where some early userspace programs can take illegal instructions. This is being fixed in Linux, but in the mean time, we should cleanup in skiboot also. Signed-off-by: Michael Neuling Reviewed-by: Vaidyanathan Srinivasan --- core/cpu.c | 1 + include/processor.h | 1 + 2 files changed, 2 insertions(+) diff --git a/core/cpu.c b/core/cpu.c index 1569c9f6c7..0077103d1a 100644 --- a/core/cpu.c +++ b/core/cpu.c @@ -1333,6 +1333,7 @@ static void cpu_cleanup_one(void *param __unused) { mtspr(SPR_AMR, 0); mtspr(SPR_IAMR, 0); + mtspr(SPR_PCR, 0); } static int64_t cpu_cleanup_all(void) diff --git a/include/processor.h b/include/processor.h index 27cc1aa394..6b262b45e0 100644 --- a/include/processor.h +++ b/include/processor.h @@ -77,6 +77,7 @@ #define SPR_LPCR 0x13e #define SPR_HMER 0x150 /* Hypervisor Maintenance Exception */ #define SPR_HMEER 0x151 /* HMER interrupt enable mask */ +#define SPR_PCR 0x152 #define SPR_AMOR 0x15d #define SPR_PSSCR 0x357 /* RW: Stop status and control (ISA 3) */ #define SPR_TSCR 0x399