Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6225066ybe; Tue, 17 Sep 2019 23:18:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHKQ/sI2j9lJthvLI/Dr5XFllEUdreRuHYiW6adfj2a3orzC8c38XSyHKY6gcFpvktMivq X-Received: by 2002:a50:a666:: with SMTP id d93mr8444869edc.217.1568787499777; Tue, 17 Sep 2019 23:18:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568787499; cv=none; d=google.com; s=arc-20160816; b=f41luUOncS5mM8jrjBpsTVn5bnuWIZtUClSX2I/0Ih4wT1eIU0c2ebS5Dj9dMwXCME HfojAMRRQCPYNqWXctsha3ZVwtKJyqrqZGQv5qlXj39n/ufdhS2o9yJGB2phVZI0Xa0k lN8c/m2X2dAkMDcp1dUHUo2AfZrPMrGRSzNK9z0LbUrn9brrw8s9wI8Anyh4w8ouvRO+ /VfTrpm9rMpHN+wyUt5LlLuelVJtsIkkH0lMBF6rBz+3G5qgNr7gUJCKYQzKYXYVNZN2 dUHZzXyhPZXbqsgxlHJnhbaJv2bp5rrbND3Z/lvg/9E9VmR32rytJwre60cre02q+V/X FMHw== 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=0gYxSW6SazV4xYSPFHE5pSrnWhwCRoi8dqO+bKV+AgI=; b=KB563ksbArNr8pNL4f5sSIUZZ4UqZg/wNZjZZatcbnDwQ/uoiL4Fw3g2UAlUETiHEK HqoFjh61weI8qAjxxEKNvBqck0R+qjlcqnjdB3eT6Za87R7D0EUTEy+8Fx/z+1oza1Al kjs5D8hbFxkUcsVod7FPujRM4pp0dIOeSYmOXPItS0bnVhW8WIVYH3rEab6RMQnEjDyZ xyyf2hogGOZdrSVPaWZhmHmVx2zExIKik37ZeL6ZZWtMkZiNpoXGLjJ2SptoqoX6/9O1 oBQAttqwrBsgbq+J6ZBOgWt8iGTaIT0APCaeWtpIjWUUYbv6tfDwyn0ZslRBFVzDxkof dyVg== 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 h14si2571166edv.244.2019.09.17.23.17.57; Tue, 17 Sep 2019 23:18:19 -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 S1727540AbfIRFV1 (ORCPT + 99 others); Wed, 18 Sep 2019 01:21:27 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:46348 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725842AbfIRFV1 (ORCPT ); Wed, 18 Sep 2019 01:21:27 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x8I5HWmI124837 for ; Wed, 18 Sep 2019 01:21:26 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2v39ppg1c0-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 18 Sep 2019 01:21:26 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 18 Sep 2019 06:21:23 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 18 Sep 2019 06:21:18 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x8I5LHqN45219864 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Sep 2019 05:21:17 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D50AD52050; Wed, 18 Sep 2019 05:21:16 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 8D4A35204F; Wed, 18 Sep 2019 05:21:16 +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 3E70EA01E6; Wed, 18 Sep 2019 15:21:15 +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 , Allison Randal , Greg Kroah-Hartman , Andrew Morton , Mike Rapoport , David Hildenbrand , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/5] powerpc: convert cache asm to C Date: Wed, 18 Sep 2019 15:20:54 +1000 X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19091805-0020-0000-0000-0000036E6A74 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19091805-0021-0000-0000-000021C41172 Message-Id: <20190918052106.14113-1-alastair@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-09-18_04:,, 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-1909180056 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. Alastair D'Silva (6): powerpc: Allow flush_icache_range 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: Remove 'extern' from func prototypes in cache headers powerpc: Don't flush caches when adding memory Changelog: 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 (5): powerpc: Allow flush_icache_range 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