Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp817916imp; Wed, 20 Feb 2019 09:31:05 -0800 (PST) X-Google-Smtp-Source: AHgI3IZUNGawRE/MDwYxyF2HFgyjBHndTXxStSKKw3L1nNpy2GpqIux0LBP246W4gYQ4+Yx1vgMf X-Received: by 2002:a63:d64:: with SMTP id 36mr7094825pgn.360.1550683865229; Wed, 20 Feb 2019 09:31:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550683865; cv=none; d=google.com; s=arc-20160816; b=z0hVhqW6JQvpbGIzBFeqSifLBmcFb09jFrmQZYXzQ1qIWDNo8Pt+60gYCxKRCgRaMn m/Yye1zBPhheO8OxHrXYTABIU3E6b2OD6pgt1vToRoacBFiwGG85wAhyQEx39vhgrd02 LxPM+tB8MZHng1dsr+TkGcxzjagdyyihFD0X61JVlW/KQRFBaR87QF064c4Rom0AMSJ1 D77v2oN4pJ/+M6YaW0dUGTmk2XgsGGphsQam10lFhQCV1FVME4rtz8BEJMbU35epG98u M5ZUFh3d32/ta3jAwn0f3lsg9CgJtrLS12ewn4IY9AAEwRe34EFeXHe0GQIt5zqp9xRJ Ycmg== 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=m7cl8nf8mJr4FjpRgz0inRmJAla/TfF+bsPmaGRTCVM=; b=cWCRNL4JZZg4nDwyj5E26K2Gjsy6/IE2E58YI/e0in7FVB1QneiSyvyXCY+dIj1JiB hJ/ntPfmTxgpt04T/pCSlOk4wZbsbLXpUUyr2I7yfDNxGgGI2YhPTdIrSMN3Jgzbre00 6H2/dyijX7GPlLfU39LPNSO4OVM4g42JOzOglHwYOXDoM+Tj9U5GvwCwAoKbHgiBfKSh eit08NxbWVSm2NGAhsnMo1MzD/UwbnanGSSCMJEPgIyHfRFSTs5I/WxrNKS/BhjxIJIK cosdLNuUeVwsGLT5oGgnMQfkDkdGQgPzDVdnSmqeIbYn527y8S23upKj4kuuQDyrI3OU ccyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b="XUvrU/qL"; 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 b7si19266670plx.331.2019.02.20.09.30.50; Wed, 20 Feb 2019 09:31:05 -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="XUvrU/qL"; 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 S1726640AbfBTR3R (ORCPT + 99 others); Wed, 20 Feb 2019 12:29:17 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:36424 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726344AbfBTR3Q (ORCPT ); Wed, 20 Feb 2019 12:29:16 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 444PjN4d2Yz9v0gB; Wed, 20 Feb 2019 18:29:12 +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=XUvrU/qL; 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 ddefkEdmbGr2; Wed, 20 Feb 2019 18:29:12 +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 444PjN3Zv7z9v0g0; Wed, 20 Feb 2019 18:29:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1550683752; bh=m7cl8nf8mJr4FjpRgz0inRmJAla/TfF+bsPmaGRTCVM=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=XUvrU/qLlysE2BsMQU8sAi8rQoznWZIOfL8P6vkxqNTMQN/zwUPFF7FErDPAuY4YQ /HsM2Lze7M6vHylhHRGvOevva3o8k4Sm9d93O8md4fdaPMP7HzAmbCeKvEPXmGFIdH 8rVM7zSzcyOuz6HxfFNM0gupJwe7MnroqD7JoXBs= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 286A18B84F; Wed, 20 Feb 2019 18:29:14 +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 XKiao6TMxR0a; Wed, 20 Feb 2019 18:29:14 +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 0AE058B84A; Wed, 20 Feb 2019 18:29:14 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 050526E85E; Wed, 20 Feb 2019 17:29:14 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v3 07/16] powerpc/mm/32s: use _PAGE_EXEC in setbat() To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , j.neuschaefer@gmx.net Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Wed, 20 Feb 2019 17:29:14 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Do not set IBAT when setbat() is called without _PAGE_EXEC Signed-off-by: Christophe Leroy --- arch/powerpc/mm/ppc_mmu_32.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/mm/ppc_mmu_32.c b/arch/powerpc/mm/ppc_mmu_32.c index 5fc59b195fef..ff8580c6ab11 100644 --- a/arch/powerpc/mm/ppc_mmu_32.c +++ b/arch/powerpc/mm/ppc_mmu_32.c @@ -131,6 +131,7 @@ unsigned long __init mmu_mapin_ram(unsigned long base, unsigned long top) * Set up one of the I/D BAT (block address translation) register pairs. * The parameters are not checked; in particular size must be a power * of 2 between 128k and 256M. + * On 603+, only set IBAT when _PAGE_EXEC is set */ void __init setbat(int index, unsigned long virt, phys_addr_t phys, unsigned int size, pgprot_t prot) @@ -157,11 +158,12 @@ void __init setbat(int index, unsigned long virt, phys_addr_t phys, bat[1].batu |= 1; /* Vp = 1 */ if (flags & _PAGE_GUARDED) { /* G bit must be zero in IBATs */ - bat[0].batu = bat[0].batl = 0; - } else { - /* make IBAT same as DBAT */ - bat[0] = bat[1]; + flags &= ~_PAGE_EXEC; } + if (flags & _PAGE_EXEC) + bat[0] = bat[1]; + else + bat[0].batu = bat[0].batl = 0; } else { /* 601 cpu */ if (bl > BL_8M) -- 2.13.3