Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp577072pxb; Fri, 15 Oct 2021 11:22:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDB6qVaHhW8sWTkBdzGF136Joc7zjrcGbtXA6f3DzJv+mqVaYCW8/C2UmCKHkWOmOV4jbC X-Received: by 2002:a17:906:d975:: with SMTP id rp21mr8731801ejb.104.1634322141450; Fri, 15 Oct 2021 11:22:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634322141; cv=none; d=google.com; s=arc-20160816; b=EWaFJLVE9YNhB0HkwkxeQxbMj7ZA0/XjfBINYugeGYTzj4z2z/UlBx3aPqf/6wvR50 H2VPNwjKKXUDZRAPE3x/K52u7TP2+71tZmBsR4yCFzdgOApWALVS+4UujtPG7C8VXTc4 eouWAMgG1sZSOMO3geEVhPJHaUt8x0UnwZ6r+ll5G9pl7PEamn+I8dzbL0ccJgA4kW4l YDZQbWAlmHbczYxELuEu8NmVJ1DVBDAKFpwfzT1CvJtM848z9aqlqwCKdFSec/v0dwNg wSmFvk/nU6A43Uj0REX0Gb1OcwN00tnR+AGaSnU1Vurlr1F5xSIfUdpdL4tH8SkAD7oW fjaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=d8jZ5WA30I+Ejihyhwb69Dwo/3CDxEE08rf9LKld59k=; b=cBwbRpRHiYfkAuYMC3mVxBRDvSkNb1MTfpp/ExSIsllcM6JlCqa2TltuXQ4SyOuv2w n+/LvQD14iHZGVlO/LQJJwfA/2CyWxhHqoZAZZlpYlKEcIN1TwOJ3LoKMqiC5gHJGzGO FzfTcfE/s8kbhy8kKf/g3uXCteUlni5qa/odVtn4eH5WbWbgscpi0rJhJhIe0pCvBv/1 rZl8FsSzq+qc0TyOxzbRJPaAU6KZiRh+9Jun3+IRvC9v96L7pBolbd/gKuK5CsgOADwf bEiAnADTCKUXwJA+9x/UMl73fcAPKZMxdXOAtVVHscMv91aSYKFobDWM+O1Rv5kWofmy hjkA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 26si9746312eji.590.2021.10.15.11.21.35; Fri, 15 Oct 2021 11:22:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237712AbhJOKFZ (ORCPT + 99 others); Fri, 15 Oct 2021 06:05:25 -0400 Received: from pegase2.c-s.fr ([93.17.235.10]:50767 "EHLO pegase2.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237572AbhJOKFS (ORCPT ); Fri, 15 Oct 2021 06:05:18 -0400 Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4HW1zs0bdmz9sSF; Fri, 15 Oct 2021 12:03:05 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E0ZK-zE5vIsx; Fri, 15 Oct 2021 12:03:05 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4HW1zp641Vz9sSH; Fri, 15 Oct 2021 12:03:02 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id B58FB8B799; Fri, 15 Oct 2021 12:03:02 +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 HUrL_P9iqOzM; Fri, 15 Oct 2021 12:03:02 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (unknown [192.168.202.255]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 5401D8B790; Fri, 15 Oct 2021 12:03:02 +0200 (CEST) Received: from PO20335.IDSI0.si.c-s.fr (localhost [127.0.0.1]) by PO20335.IDSI0.si.c-s.fr (8.16.1/8.16.1) with ESMTPS id 19FA2r5R2627035 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 15 Oct 2021 12:02:53 +0200 Received: (from chleroy@localhost) by PO20335.IDSI0.si.c-s.fr (8.16.1/8.16.1/Submit) id 19FA2rRI2627034; Fri, 15 Oct 2021 12:02:53 +0200 X-Authentication-Warning: PO20335.IDSI0.si.c-s.fr: chleroy set sender to christophe.leroy@csgroup.eu using -f From: Christophe Leroy To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: Christophe Leroy , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v1 4/8] powerpc/fsl_booke: Enable reloading of TLBCAM without switching to AS1 Date: Fri, 15 Oct 2021 12:02:45 +0200 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1634292165; l=1767; s=20211009; h=from:subject:message-id; bh=B8r0vE6ZUiWl1za29TlPeLwngGx9iult/yrmTG7s7ic=; b=XVmXDcA/sppH+eAfCm6+oQN6vf8GtwExhQ09O/mkmZ9Bh+hev6xu/rZYjySHkkBNIio9gL+lGPaI 81btHHndDAj9wu3fAqgM0etp7tYLBfMd8Bjc1rnzTUyFmliQcLR9 X-Developer-Key: i=christophe.leroy@csgroup.eu; a=ed25519; pk=HIzTzUj91asvincQGOFx6+ZF5AoUuP9GdOtQChs7Mm0= Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Avoid switching to AS1 when reloading TLBCAM after init for STRICT_KERNEL_RWX. When we setup AS1 we expect the entire accessible memory to be mapped through one entry, this is not the case anymore at the end of init. We are not changing the size of TLBCAMs, only flags, so no need to switch to AS1. So change loadcam_multi() to not switch to AS1 when the given temporary tlb entry in 0. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/nohash/tlb_low.S | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/mm/nohash/tlb_low.S b/arch/powerpc/mm/nohash/tlb_low.S index 5add4a51e51f..dd39074de9af 100644 --- a/arch/powerpc/mm/nohash/tlb_low.S +++ b/arch/powerpc/mm/nohash/tlb_low.S @@ -369,7 +369,7 @@ _GLOBAL(_tlbivax_bcast) * extern void loadcam_entry(unsigned int index) * * Load TLBCAM[index] entry in to the L2 CAM MMU - * Must preserve r7, r8, r9, r10 and r11 + * Must preserve r7, r8, r9, r10, r11, r12 */ _GLOBAL(loadcam_entry) mflr r5 @@ -401,7 +401,7 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_BIG_PHYS) * * r3 = first entry to write * r4 = number of entries to write - * r5 = temporary tlb entry + * r5 = temporary tlb entry (0 means no switch to AS1) */ _GLOBAL(loadcam_multi) mflr r8 @@ -409,6 +409,8 @@ _GLOBAL(loadcam_multi) mfmsr r11 andi. r11,r11,MSR_IS bne 10f + mr. r12, r5 + beq 10f /* * Set up temporary TLB entry that is the same as what we're @@ -446,6 +448,8 @@ _GLOBAL(loadcam_multi) /* Don't return to AS=0 if we were in AS=1 at function start */ andi. r11,r11,MSR_IS bne 3f + cmpwi r12, 0 + beq 3f /* Return to AS=0 and clear the temporary entry */ mfmsr r6 -- 2.31.1