Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp787683imp; Thu, 21 Feb 2019 11:10:38 -0800 (PST) X-Google-Smtp-Source: AHgI3IZebrvydHCyUWLrZGwB4+/ODaSOLWW3HVmDMklArX2otZYZb6MoztZ7cilmQQPoSq3/968Q X-Received: by 2002:a63:f544:: with SMTP id e4mr52512pgk.145.1550776238651; Thu, 21 Feb 2019 11:10:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550776238; cv=none; d=google.com; s=arc-20160816; b=eyDZ+z80hnnbi74cW75bygMJGfW1mC92LUUHuP7beVsJ22Il7VaTugEs9l5upuwVQH 5Q8xAvorD2XkpYJsXRZDiYuHSGHDG3nro9ivZWc8UTIAdPqy5e3M7ntFaJfVeMWmnamu wknUH3rAnExDD6N5Y09icd7ORLrSgcwuukywEVChxiLTnRlsGvP0vcnFrXChTHC7Qdc5 YgMhByMNw/aXic3RhyA1cVg++rqpS9zeAiVP+jGtXIKze6T2s7M6QH3dyctG1L7fious zPhgsGtmbAvODQk6OK122lDbxI2TyWMdl/oqljlDa8MdeRBfTjzVW+Cs/31LnL3v1NnQ JpDg== 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=D4otNjSH+hMxxzZtesImp2ZnDl56Jaqy+6iovKGpTHqIxJDUJ5Wq7TSKSZkfJnkTJd MgxgetrA9gb7wobJKfV5KV923wf5j5lQNb3dRoqHIGu7VYY7x+DUYkN17PYRTMadZTl1 h+yaKc/ofaCd4TcLFQlo1zxZ921td0MmDeo8UeOoCIuk7ZLVMFGL9cJFYjcSbnyVnp9P 7yP8tXzGyul4om1JZVn1iAj+FMhmGOw99pjRUrYWAGwgibSz65fNgf/pJeyQjf9/lD+F nnib6mtxd0HZKu18pkFSkf7Kc93+roKQWNo+BN3S1R9MrI2IHGTz/6U8biZgphtf97bt MFSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=DrJ5vbLJ; 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 x5si5796052plv.26.2019.02.21.11.10.22; Thu, 21 Feb 2019 11:10:38 -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=DrJ5vbLJ; 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 S1726573AbfBUTIp (ORCPT + 99 others); Thu, 21 Feb 2019 14:08:45 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:38527 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726488AbfBUTIp (ORCPT ); Thu, 21 Feb 2019 14:08:45 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4453sm01SLz9v6jt; Thu, 21 Feb 2019 20:08:44 +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=DrJ5vbLJ; 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 KLqB2Pz0WJ5G; Thu, 21 Feb 2019 20:08:43 +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 4453sl65PRz9v6l6; Thu, 21 Feb 2019 20:08:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1550776123; bh=m7cl8nf8mJr4FjpRgz0inRmJAla/TfF+bsPmaGRTCVM=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=DrJ5vbLJnYMCvsJ2zVsISO7NxRazSjWlnfQe0c2RfydMtfDXDmp7Hk/qXb1RLoj+j x+ureRZerLXxUAt4OEO7Xs4vMKaTpC7umCKvACROf9/TOZgnyaW/YbI8OdiSOhA6yq W2BC9ejyE2NMwXpUUv/n1rxZmjwMhqaA/1Ehl/40= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id D50D38B86A; Thu, 21 Feb 2019 20:08:43 +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 VN-grW7dsT6n; Thu, 21 Feb 2019 20:08:43 +0100 (CET) Received: from po16846vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A80BF8B852; Thu, 21 Feb 2019 20:08:43 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 82E636EF61; Thu, 21 Feb 2019 19:08:43 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v5 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: Thu, 21 Feb 2019 19:08:43 +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