Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3574739ybb; Mon, 6 Apr 2020 11:17:54 -0700 (PDT) X-Google-Smtp-Source: APiQypKdaoEzalMSBnByxMdqWpx7wt0b42gGXkBGX/Df59Z063TH72zgxz/6pRplxRevlerPQ2Pe X-Received: by 2002:aca:f4c4:: with SMTP id s187mr506703oih.83.1586197074166; Mon, 06 Apr 2020 11:17:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586197074; cv=none; d=google.com; s=arc-20160816; b=oKccP3V576DkEbm47E+O+SF5AEjx8Nk9Y+S+jdiC8Wb40RS8W/zQNf9PcrkX7kZ9Ea cp+B/XYEnWVIwXGHw7uR3MtU0HrwjLpZV+S8dcdIEeodNfGb4sDbDAzTd16Gm/hcvLY1 p7fQBB0yoXLqTQsoVtrNvtGidC90Ft1avzMFJgSz2ogRie10EblxWM7ngyodGGfjxfNL tKASsOgG+rEQvZfdw/RVEY3WKw4Hat8GwTw2hACFGtYWr1XfyIqrbykkQQqCVC3vbC1J vfQE0O/GnaB3epvyUz6TUPdchWJD3pe4/RZ+kArkigWidQBNNEfsQG51yecro9FgtQch 3wBA== 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=KhQRpPjql4iBmrVyMyR4fg1vYv3KiRovrf87iAwV4+8=; b=gRV5WYGXgmB8PBNSINHcnsZOFs9CSxvqgwqyPQ1MCsbcFzqlsFJZczjekzxHirtr7i HqSnbs1HN2GCFW3jpnknnm6/e8GtwIwWDCx9UF8+Pbfn3MzJbxMeE+JlJ+OHZZfYvOQU QOqSND2DnkYAG6NSmF8yi+/g6nX3B4TA0R+BV4dpVjq2Z7TvtPpUo9hBiTY024lI68c2 IsF9k+RBaDR4Xk9LJNRjKEvIQyfwvTiUy7OoE85adi0t6jeYMqatml6aiIHjk30fvkvh O5UkUrP/jN4ai6kU6vBB/oN5guCUq64QcGEfDESVk1bBepxBJ73C/LKlHJ7kbWZhEtlR wDsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=MEse3+vj; 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 a11si7371559oib.154.2020.04.06.11.17.40; Mon, 06 Apr 2020 11:17:54 -0700 (PDT) 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=MEse3+vj; 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 S1727322AbgDFSQy (ORCPT + 99 others); Mon, 6 Apr 2020 14:16:54 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:56219 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727191AbgDFSQu (ORCPT ); Mon, 6 Apr 2020 14:16:50 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48wzJd221lz9v0BM; Mon, 6 Apr 2020 20:16:49 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=MEse3+vj; 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 MO6WKEdwWqe7; Mon, 6 Apr 2020 20:16:49 +0200 (CEST) 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 48wzJd0xg7z9v0BL; Mon, 6 Apr 2020 20:16:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1586197009; bh=KhQRpPjql4iBmrVyMyR4fg1vYv3KiRovrf87iAwV4+8=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=MEse3+vj4xGrUBLjSfa92tk0g5o3qFrVsZP2/LAHBdO5hcBYR7T6Ab7aKT3U2309P tvnJ5/O9ewcMOUUviOOjPue2O4pBo8CknwLOUuYi54I9DXr4S/la61B8YaX2pqLEDH dzxt4HUoAQOjNs5+ggU2R56ZISNTOtXNBq7vptqQ= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id D20638B784; Mon, 6 Apr 2020 20:16:48 +0200 (CEST) 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 zolvmdBxE9TE; Mon, 6 Apr 2020 20:16:48 +0200 (CEST) Received: from pc16570vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 9B5678B775; Mon, 6 Apr 2020 20:16:48 +0200 (CEST) Received: by pc16570vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 69DE7656E9; Mon, 6 Apr 2020 18:16:48 +0000 (UTC) Message-Id: <99851590f78150820e1c21af7f6370d7b82830e9.1586196948.git.christophe.leroy@c-s.fr> In-Reply-To: <5aeaa33383e833f6eca30893fbd188b88e019eaa.1586196948.git.christophe.leroy@c-s.fr> References: <5aeaa33383e833f6eca30893fbd188b88e019eaa.1586196948.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [RFC PATCH v3 12/15] powerpc/syscall: Selectively check MSR_RI and MSR_PR on syscall entry To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , npiggin@gmail.com, msuchanek@suse.de Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Mon, 6 Apr 2020 18:16:48 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In system_call_exception(), MSR_RI needs to also be checked on 8xx. Only book3e doesn't have MSR_RI. On PPC32, MSR_PR is checked in real mode to avoid clobbering the stack, so no need to check and panic in system_call_exception(). Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/syscall.c b/arch/powerpc/kernel/syscall.c index dfd7b28239b8..f9fca9985b0f 100644 --- a/arch/powerpc/kernel/syscall.c +++ b/arch/powerpc/kernel/syscall.c @@ -34,9 +34,9 @@ notrace long system_call_exception(long r3, long r4, long r5, trace_hardirqs_off(); /* finish reconciling */ - if (IS_ENABLED(CONFIG_PPC_BOOK3S)) + if (!IS_ENABLED(CONFIG_PPC_BOOK3E)) BUG_ON(!(regs->msr & MSR_RI)); - BUG_ON(!(regs->msr & MSR_PR)); + BUG_ON(IS_ENABLED(CONFIG_PPC64) && !(regs->msr & MSR_PR)); BUG_ON(!FULL_REGS(regs)); BUG_ON(IS_ENABLED(CONFIG_PPC64) && get_softe(regs) != IRQS_ENABLED); -- 2.25.0