Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3340900imu; Mon, 28 Jan 2019 03:11:53 -0800 (PST) X-Google-Smtp-Source: ALg8bN4c0mjjcV2ADnktkg7iNiVVN+6Y97oj/aZnuddyuEd729Nh5I7Btzzp62XCdv8/4Y8v+sOx X-Received: by 2002:a65:6242:: with SMTP id q2mr19604053pgv.245.1548673913751; Mon, 28 Jan 2019 03:11:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548673913; cv=none; d=google.com; s=arc-20160816; b=xvsuG7iuYiVuOe9E/MtAcUUGwJNs1EUoNvtTn9QZcQ21bOzba2mvm3K+EddoWsdW8f XfevCjzMRNDXSkU8P46WO6k63cLnfxoCg0oeq8mYvAZFInN5jQN3ar2az6/T5jcPn4Kt kebvLfr8MS8Jic8SEFu+n1StQXE7rZHWz+szuSLGd/0cnNW5bD4TrHdblU6PdST6/KbO Qmq8uJ5IQxEl7ZSSRp/RypnHIsaGw447McfaICEGJ8HFGk7gmf7sko94n3u1M6jzzWOi AVO1hnC1Q1bYCh66RrgcALNqmI2pNflvPgjwooOfm9MjiU0CShXLG6DoAH+Bzmz1Bn2a AUVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=QbZgLz+KBI+o6ZgRCiv2+UEBD8YC+qJe6rkAkJpJNVk=; b=jmcXV5HkP87xSM2GY1fETOfzO0/Bk0viGZp9DM+ZEbwvVa213jLOVh1qgz8axNKmUN PZ4hVlppjcAyEZWTXXUiPlsDCfJ2KMO6VI8e3U/KjfzQ4pks/8OnrlKGMDxT7RtRRI12 eZPWGt/08CxPVNtpkr0knuRfVFOwSzoRlLOJt7vg7I+YCkWyn2DDllhfhrTrHPaz0E9x Pn5alvbpXXdvykjxzESCiQ78MScyvZfyXtHFGNxzet2MxcnWO420kqAGaFZjZVrnlLm5 u6XFjXTa86NNPDETJaubNtV9TkMJsF5ZZsxzAGZ9SbzkyeSXUZYQTQHzQD2TP+wcqqFf cLVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=QNSUVJ62; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a8si373344ple.216.2019.01.28.03.11.38; Mon, 28 Jan 2019 03:11:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=QNSUVJ62; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726967AbfA1LLV (ORCPT + 99 others); Mon, 28 Jan 2019 06:11:21 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:32089 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726944AbfA1LLT (ORCPT ); Mon, 28 Jan 2019 06:11:19 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 43p6Pp5YL3z9v1qC; Mon, 28 Jan 2019 12:11:10 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=QNSUVJ62; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id BJ7zfPWyLM80; Mon, 28 Jan 2019 12:11:10 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 43p6Pp4MXKz9v1q3; Mon, 28 Jan 2019 12:11:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1548673870; bh=QbZgLz+KBI+o6ZgRCiv2+UEBD8YC+qJe6rkAkJpJNVk=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=QNSUVJ62Gg29Gu0y8Z81cRMRVFfE+2VCVMrHAwOSKEy4owG4u4uahl4OAZPhdybSY JgzIp5fO2SdlKlbJ9Cp6749ar+odTMdmWV3aCjoa4xCqRx7R3r0/nnv7pgwdL2O7ej CZaeUNrwdepdisw79bryq0ZoVw2XCDmqg1auBOo4= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1A7178B79D; Mon, 28 Jan 2019 12:11:17 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id PTQI0kKahZtl; Mon, 28 Jan 2019 12:11:17 +0100 (CET) Received: from po16846vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 041088B796; Mon, 28 Jan 2019 12:11:17 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 06BAC72DE6; Mon, 28 Jan 2019 11:11:17 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH 03/11] powerpc/32: Add a macro for setting MSR_RI in EXCEPTION_PROLOG_2 To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Mon, 28 Jan 2019 11:11:17 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Setting MSR_RI applies to head_32 and head_8xx, but not to head_40x. So in order to refactor EXCEPTION_PROLOG for 40x too, this patch adds a macro for setting MSR_RI. In the meantime, this gives the opportunity to make it simpler on the 8xx as writing in SPRN_EID sets MSR_RI. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.S | 2 ++ arch/powerpc/kernel/head_32.h | 7 +++++-- arch/powerpc/kernel/head_8xx.S | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S index a5efcdc78e8e..edc5e78faf08 100644 --- a/arch/powerpc/kernel/head_32.S +++ b/arch/powerpc/kernel/head_32.S @@ -37,6 +37,8 @@ #include #include +#define SET_AND_STORE_MSR_RI(reg) li reg,MSR_KERNEL & ~(MSR_IR|MSR_DR); MTMSRD(reg) + #include "head_32.h" /* 601 only have IBAT; cr0.eq is set on 601 when using this macro */ diff --git a/arch/powerpc/kernel/head_32.h b/arch/powerpc/kernel/head_32.h index 7356c27d2136..9e6fb9d468f0 100644 --- a/arch/powerpc/kernel/head_32.h +++ b/arch/powerpc/kernel/head_32.h @@ -4,6 +4,10 @@ #include /* for STACK_FRAME_REGS_MARKER */ +#ifndef SET_AND_STORE_MSR_RI +#define SET_AND_STORE_MSR_RI(reg) +#endif + /* * Exception entry code. This code runs with address translation * turned off, i.e. using physical addresses. @@ -44,8 +48,7 @@ stw r1,GPR1(r11); \ stw r1,0(r11); \ tovirt(r1,r11); /* set new kernel sp */ \ - li r10,MSR_KERNEL & ~(MSR_IR|MSR_DR); /* can take exceptions */ \ - MTMSRD(r10); /* (except for mach check in rtas) */ \ + SET_AND_STORE_MSR_RI(r10); /* can take exceptions */ \ stw r0,GPR0(r11); \ lis r10,STACK_FRAME_REGS_MARKER@ha; /* exception frame marker */ \ addi r10,r10,STACK_FRAME_REGS_MARKER@l; \ diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index d9c5bc48bef0..00dacec2b0d1 100644 --- a/arch/powerpc/kernel/head_8xx.S +++ b/arch/powerpc/kernel/head_8xx.S @@ -36,6 +36,8 @@ .macro DO_KVM intno .endm +#define SET_AND_STORE_MSR_RI(reg) mtspr SPRN_EID, reg + #include "head_32.h" #if CONFIG_TASK_SIZE <= 0x80000000 && CONFIG_PAGE_OFFSET >= 0x80000000 -- 2.13.3