Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1861144ybn; Thu, 26 Sep 2019 03:21:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3SgnhQzQl4fMnquxrcGXGZ9wfCMYBcOHx8YClLtpPcEe1ESoYaS3oXIMcBIkp8v+a8/h8 X-Received: by 2002:a17:906:1c03:: with SMTP id k3mr2344659ejg.32.1569493286884; Thu, 26 Sep 2019 03:21:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569493286; cv=none; d=google.com; s=arc-20160816; b=TbHgW4Ec8RQBbzm7s3hYphNMp88g3H1pKRc+QBAbMgDaPZjkA1SCsQzs12wpOAE1Vi lRpy18JDv+MvK4FoWY+gTHSqNS8HF+U/v3aXavX7nvrydvDWoj7Ce9XGRfPEJUHnd9g3 pdO+2YF2Q2s88yAq52JFXdBO+oamOUYTEg3oGmN9ZrDoaskT8M25BVb/4V2WUzACE+44 OiU+48VYu9iBofXJUKmkdGUgvEPPFv/uht3jA6pq06DBplAEQQwOZAL/ok3yxnnELJLR gtRC8ymKjjRqF9Qv/zrN6PH76gK4aZMEyvQvW487yAzZLek6rJUBAusdXc8mdFS/D9Hz yo3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :mime-version:date:subject:cc:to:from; bh=Mw57SD9N5kYlkkUQV8jgmKJ6smTrkU+R9v0v2Zi/uVI=; b=P+hHyp6jjxblUMdpTO5lb0mal98if2bnparuAWKCL+iIxbLClOfQSI+a8ZdKhL8gLl X6y6KSlCAqpzOveuElNgu4f/RvKM+rtGuokpxFkDmiX0PLCivhBU1AoShXn0AL6mErAc cO8Z+TBjEOWZbRvBMncIc35B1c0wo5kPj7lwH1EsjcZ1yIziVGnj25nyWgyUYvcwR38o yKn23PV0MUW25vZptML8y9mzapjBGpMdtoxsB7BoH0Yr7ru1/wm4qB+XJF+8nxsPeusY uVXGSwDiNoiiC4lqfaP/G3D3jRGR2yCMbokK/TQcUGPYGcVx7zO+N+IswVECLmnpAyap uAKw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9si701109ejq.164.2019.09.26.03.21.03; Thu, 26 Sep 2019 03:21:26 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391808AbfIZEyn (ORCPT + 99 others); Thu, 26 Sep 2019 00:54:43 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49882 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728905AbfIZEyn (ORCPT ); Thu, 26 Sep 2019 00:54:43 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8Q4qPHS097718 for ; Thu, 26 Sep 2019 00:54:40 -0400 Received: from e06smtp01.uk.ibm.com (e06smtp01.uk.ibm.com [195.75.94.97]) by mx0b-001b2d01.pphosted.com with ESMTP id 2v8mgxmjug-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 26 Sep 2019 00:54:40 -0400 Received: from localhost by e06smtp01.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 26 Sep 2019 05:54:38 +0100 Received: from b06avi18626390.portsmouth.uk.ibm.com (9.149.26.192) by e06smtp01.uk.ibm.com (192.168.101.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 26 Sep 2019 05:54:33 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8Q4s5U331850816 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 26 Sep 2019 04:54:05 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C10EF11C04C; Thu, 26 Sep 2019 04:54:32 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6C32411C04A; Thu, 26 Sep 2019 04:54:32 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 26 Sep 2019 04:54:32 +0000 (GMT) Received: from adsilva.ozlabs.ibm.com (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id A90D9A00D3; Thu, 26 Sep 2019 14:54:30 +1000 (AEST) From: "Alastair D'Silva" To: alastair@d-silva.org Cc: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Christophe Leroy , Qian Cai , Thomas Gleixner , Nicholas Piggin , Greg Kroah-Hartman , Allison Randal , Andrew Morton , David Hildenbrand , Mike Rapoport , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 0/6] powerpc: convert cache asm to C Date: Thu, 26 Sep 2019 14:54:06 +1000 X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19092604-4275-0000-0000-0000036B467E X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19092604-4276-0000-0000-0000387DC39E Message-Id: <20190926045419.22827-1-alastair@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-26_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909260048 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alastair D'Silva This series addresses a few issues discovered in how we flush caches: 1. Flushes were truncated at 4GB, so larger flushes were incorrect. 2. Flushing the dcache in arch_add_memory was unnecessary This series also converts much of the cache assembler to C, with the aim of making it easier to maintain. Changelog: V4: - Split out VDSO patch - Pass/cast the correct types in 'powerpc: Convert flush_icache_range & friends to C' V3: - factor out chunking loop - Replace __asm__ __volatile__ with asm volatile - Replace flush_coherent_icache_or_return macro with flush_coherent_icache function - factor our invalidate_icache_range - Replace code duplicating clean_dcache_range() in __flush_dcache_icache() with a call to clean_dcache_range() - Remove redundant #ifdef CONFIG_44x - Fix preprocessor logic: #if !defined(CONFIG_PPC_8xx) & !defined(CONFIG_PPC64) - Added loop(1|2) to earlyclobbers in flush_dcache_icache_phys - Drop "Remove extern" patch - Replace 32 bit shifts in 64 bit VDSO with 64 bit ones V2: - Replace C implementation of flush_dcache_icache_phys() with inline assembler authored by Christophe Leroy - Add memory clobbers for iccci implementation - Give __flush_dcache_icache a real implementation, it can't just be a wrapper around flush_icache_range() - Remove PPC64_CACHES from misc_64.S - Replace code duplicating clean_dcache_range() in flush_icache_range() with a call to clean_dcache_range() - Replace #ifdef CONFIG_44x with IS_ENABLED(...) in flush_icache_cange() - Use 1GB chunks instead of 16GB in arch_*_memory Alastair D'Silva (6): powerpc: Allow flush_icache_range to work across ranges >4GB powerpc: Allow 64bit VDSO __kernel_sync_dicache to work across ranges >4GB powerpc: define helpers to get L1 icache sizes powerpc: Convert flush_icache_range & friends to C powerpc: Chunk calls to flush_dcache_range in arch_*_memory powerpc: Don't flush caches when adding memory arch/powerpc/include/asm/cache.h | 55 +++++--- arch/powerpc/include/asm/cacheflush.h | 36 +++-- arch/powerpc/kernel/misc_32.S | 117 ---------------- arch/powerpc/kernel/misc_64.S | 102 -------------- arch/powerpc/kernel/vdso64/cacheflush.S | 4 +- arch/powerpc/mm/mem.c | 176 +++++++++++++++++++++++- 6 files changed, 228 insertions(+), 262 deletions(-) -- 2.21.0