Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4028202ybl; Mon, 3 Feb 2020 11:08:13 -0800 (PST) X-Google-Smtp-Source: APXvYqwLwEc/WB9VcqOf8TcdpNqx6/wX0iuGWtU7Nz/93F7dbP4Y8A19Bu2xed/qv5J7h8noFr3C X-Received: by 2002:a9d:664a:: with SMTP id q10mr17923057otm.298.1580756893489; Mon, 03 Feb 2020 11:08:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580756893; cv=none; d=google.com; s=arc-20160816; b=lFuzIhV8TEBLiMmVWBg52a6jDl7pHn5o7+SbEeNXGN2fLgxzwA7Vhcwv0+GyJfHNjF FhmGQu4wWECVEgcSqLR8oXVIUVH4WSChHChBx5kZ4eGADv2+UhbEnuEJDI4CVThBO4VI PgCokXEcQHj5+jONzmFhAhtWiEGsi+EGJMbKSpwBZ8s0bhS/W0Y6OiNxld1kGdkMJFaq whIXMH0Y2EU8bEmbQWAjX8BF9eIapvvynmt61CtlT85RrcmbaQo0UugIoWRGy9l/1zvZ TDd9Sl2m2WhEkHIzExfCKpwzlpHqwgV5Rnqenb5+klkiBXfGnka/1/WEvRF8L3NrqX/T SO4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=CbGM+lhkMhDFeqH22kN9rGKdr+DO5kF57vrZYdUevkk=; b=xcxsW1EXorzNFPLtMHIWmGE2UOeNSKyZ8qnjk/ewqNkesTC9JXAT8vCRWkrVAmnb/q mtpCEI4DQRAxcsGrQBvYFXIVUK3PcLI91kZtZToCj2RZ1ZJ5nHDcAnzynqeTsEynxeB5 hBXrh3/SQ0/1RAZpHahZhTHYZyBZk19zVgcaEIq7Y4kaVii6lo4nG7t8r7t0Dq6gCHo5 yFsr+LHpbaLlIuahlf1pdUGgRkYF1CfPXbnRECaU33grd/CP3c4q2pudeWZ6SAWrxl11 sszdSJ9krF/STbloSyhQtcaDAoSH/Xdqmwno6ZtypRq59HBjnI8TXO8EgKU6UkPbibPO Lr+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=TBfGDlMp; 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 z1si9750501otp.70.2020.02.03.11.08.01; Mon, 03 Feb 2020 11:08:13 -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=TBfGDlMp; 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 S1729338AbgBCRQu (ORCPT + 98 others); Mon, 3 Feb 2020 12:16:50 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:13247 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726192AbgBCRQu (ORCPT ); Mon, 3 Feb 2020 12:16:50 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48BDyM0Gd0z9vC0j; Mon, 3 Feb 2020 18:16:43 +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=TBfGDlMp; 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 L2EgvSc5tJns; Mon, 3 Feb 2020 18:16:42 +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 48BDyL5k3bz9vC0h; Mon, 3 Feb 2020 18:16:42 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1580750202; bh=CbGM+lhkMhDFeqH22kN9rGKdr+DO5kF57vrZYdUevkk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=TBfGDlMpIs3iBnu1efmB/bvuM3U13ivka5Z4Mm2uZgaA1D0UVGDvJV0N5HTaaM+JN QBGASI28LFCqKPYZ5HGxOyKfb42DgiIxn0G+TFQx9n9IR+CT9iaWKsVDl0y8lNiplc pBDzIisDVtmnHs4n6EKOXL7Msf97rs+MltEXZ/wE= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 21B988B7B5; Mon, 3 Feb 2020 18:16:48 +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 ZylV4ap6PF-H; Mon, 3 Feb 2020 18:16:48 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A3BFA8B7AC; Mon, 3 Feb 2020 18:16:47 +0100 (CET) Subject: Re: [PATCH] powerpc/32s: Slenderize _tlbia() for powerpc 603/603e To: Joakim Tjernlund , "mpe@ellerman.id.au" , "paulus@samba.org" , "benh@kernel.crashing.org" Cc: "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" References: <12f4f4f0ff89aeab3b937fc96c84fb35e1b2517e.1580748445.git.christophe.leroy@c-s.fr> From: Christophe Leroy Message-ID: <5771d787-67f5-f29c-2a9e-0ea7194cffa1@c-s.fr> Date: Mon, 3 Feb 2020 18:16:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 03/02/2020 à 17:57, Joakim Tjernlund a écrit : > On Mon, 2020-02-03 at 16:47 +0000, Christophe Leroy wrote: >> CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. >> >> >> _tlbia() is a function used only on 603/603e core, ie on CPUs which >> don't have a hash table. >> >> _tlbia() uses the tlbia macro which implements a loop of 1024 tlbie. >> >> On the 603/603e core, flushing the entire TLB requires no more than >> 32 tlbie. >> >> Replace tlbia by a loop of 32 tlbie. >> >> Signed-off-by: Christophe Leroy >> --- >> arch/powerpc/mm/book3s32/hash_low.S | 13 ++++++++----- >> 1 file changed, 8 insertions(+), 5 deletions(-) >> >> diff --git a/arch/powerpc/mm/book3s32/hash_low.S b/arch/powerpc/mm/book3s32/hash_low.S >> index c11b0a005196..a5039ad10429 100644 >> --- a/arch/powerpc/mm/book3s32/hash_low.S >> +++ b/arch/powerpc/mm/book3s32/hash_low.S >> @@ -696,18 +696,21 @@ _GLOBAL(_tlbia) >> bne- 10b >> stwcx. r8,0,r9 >> bne- 10b >> +#endif /* CONFIG_SMP */ >> + li r5, 32 >> + lis r4, KERNELBASE@h >> + mtctr r5 >> sync >> - tlbia >> +0: tlbie r4 >> + addi r4, r4, 0x1000 > > Is page size always 4096 here or does it not matter ? 603 and its derivatives (G2, e300, ...) only support 4k pages. And regardless, the reference manual says: The tlbia instruction is not implemented on the MPC603e and when its opcode is encountered, an illegal instruction program exception is generated. To invalidate all entries of both TLBs, 32 tlbie instructions must be executed, incrementing the value in EA[15–19] by 1 each time Christophe