Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1646318ybl; Wed, 14 Aug 2019 21:57:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHHdqHkJCtCXNSUn0Ji5OgiMlk2ovL0mpr45ALERt3mr4rhaAJFcDHFUBqVR+7dlKMjwUu X-Received: by 2002:a63:b64:: with SMTP id a36mr2170668pgl.215.1565845050212; Wed, 14 Aug 2019 21:57:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565845050; cv=none; d=google.com; s=arc-20160816; b=RToMn1myqYQ4pOHjt7/mLeMx3JaKBSpgrMLCBP66YHM6nWriecALMHHD3CmldSnk5c aKFEDHbYC0fGwer1MDGwtKGnKmqOttj9+IXOKXsIE65fJEDIToRE7HVlVTKRXTFA+X9N B7YjAOSdYd/1TOAEN60utl2D8u9oIdpQeZ6mHuPCPgprzwMhbQZeIdMHFaY1cAD5WA37 mpx2/I9YnD83NpEhw/C23+9VHOS3xvoZuhr4dsomzdsvnIqCfeognuyyPumFuhXJTfum voi7kv+ORbSRItf1z3rCaoNHrKE79Nllpgwru0SH1+h1a0sJxxT207sxRhgb8cQX53gh i2iw== 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=lyy8EXOfw6Io9uJLe1bZIa48xeheIhf9LjS7DGhLjn0=; b=Vm+DqZgzUwIZjmG2uNucf/aqE0Fi++9HB9rXvHuw7zMHaEMoo815XJc6P9LKSoZOHP gyaJTKC1E9tvdQB1t2QwnDyiombwyIk70+y9YmBSF0USn+wugFjTyHTOdStj+f7POXoT 0TpyobqhzYQihd9yhnnNLKyeP8yZoz6+PZzW6FwnLEjoQMpq6tghUCIQF0C1H9M/XpO7 DRkNUEBFBZThCZ/GfR84PESv/397CBApaYyuDJk2/GHKniUvKN2juxFYYQEw7crcmg9P PXy/hB5wOhZaC1h9MQfxenRDZ5An+blja9CP0KXOArqXMu+NbXXAFDSi7YMPKhcQrIPm Yiyw== 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 t1si296048pjv.5.2019.08.14.21.57.14; Wed, 14 Aug 2019 21:57:30 -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 S1729937AbfHOE4T (ORCPT + 99 others); Thu, 15 Aug 2019 00:56:19 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:24564 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726317AbfHOE4T (ORCPT ); Thu, 15 Aug 2019 00:56:19 -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 x7F4ql7A083046 for ; Thu, 15 Aug 2019 00:56:18 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ucx4y4h5x-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 15 Aug 2019 00:56:17 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Aug 2019 05:56:14 +0100 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) 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) Thu, 15 Aug 2019 05:56:11 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x7F4uAvG50528284 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 15 Aug 2019 04:56:10 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 91B8D4C040; Thu, 15 Aug 2019 04:56:10 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3F72B4C044; Thu, 15 Aug 2019 04:56:10 +0000 (GMT) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 15 Aug 2019 04:56:10 +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 1F234A01BD; Thu, 15 Aug 2019 14:56:07 +1000 (AEST) From: "Alastair D'Silva" To: alastair@d-silva.org, mpe@ellerman.id.au Cc: stable@vger.kernel.org, Benjamin Herrenschmidt , Paul Mackerras , Allison Randal , Thomas Gleixner , Greg Kroah-Hartman , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] powerpc: Allow flush_(inval_)dcache_range to work across ranges >4GB Date: Thu, 15 Aug 2019 14:55:42 +1000 X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19081504-0020-0000-0000-0000035FED72 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19081504-0021-0000-0000-000021B50A83 Message-Id: <20190815045543.16325-1-alastair@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-08-15_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=843 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908150051 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alastair D'Silva Heads Up: This patch cannot be submitted to Linus's tree, as the affected assembler functions have already been converted to C. When calling flush_(inval_)dcache_range with a size >4GB, we were masking off the upper 32 bits, so we would incorrectly flush a range smaller than intended. This patch replaces the 32 bit shifts with 64 bit ones, so that the full size is accounted for. Signed-off-by: Alastair D'Silva --- arch/powerpc/kernel/misc_64.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S index 1ad4089dd110..d4d096f80f4b 100644 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S @@ -130,7 +130,7 @@ _GLOBAL_TOC(flush_dcache_range) subf r8,r6,r4 /* compute length */ add r8,r8,r5 /* ensure we get enough */ lwz r9,DCACHEL1LOGBLOCKSIZE(r10) /* Get log-2 of dcache block size */ - srw. r8,r8,r9 /* compute line count */ + srd. r8,r8,r9 /* compute line count */ beqlr /* nothing to do? */ mtctr r8 0: dcbst 0,r6 @@ -148,7 +148,7 @@ _GLOBAL(flush_inval_dcache_range) subf r8,r6,r4 /* compute length */ add r8,r8,r5 /* ensure we get enough */ lwz r9,DCACHEL1LOGBLOCKSIZE(r10)/* Get log-2 of dcache block size */ - srw. r8,r8,r9 /* compute line count */ + srd. r8,r8,r9 /* compute line count */ beqlr /* nothing to do? */ sync isync -- 2.21.0