From patchwork Thu Nov 20 11:06:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jungseung Lee X-Patchwork-Id: 5347491 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3F25C9F387 for ; Thu, 20 Nov 2014 11:10:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58B1C201BC for ; Thu, 20 Nov 2014 11:10:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 992C620154 for ; Thu, 20 Nov 2014 11:10:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XrPbE-00010d-G1; Thu, 20 Nov 2014 11:08:32 +0000 Received: from mail-pd0-x229.google.com ([2607:f8b0:400e:c02::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XrPbA-0000lq-MN for linux-arm-kernel@lists.infradead.org; Thu, 20 Nov 2014 11:08:29 +0000 Received: by mail-pd0-f169.google.com with SMTP id fp1so2880737pdb.0 for ; Thu, 20 Nov 2014 03:08:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=mvDqNS0a3lpCujLO896wFeDZU/kdsONPWqUNU3QESo4=; b=iXx/virZY90EdMjvV6luWnaAWMRxNw8fsBqdI+cvPtPJhltXtvjNWxO2O6Df+IcKa5 m95vlqXJZ/Wwhu5dquXKcLmcpjbkTXMsQDbUMS3GnniVQ5EPRJy5KBaw2jacau5VM/N3 MIBxKRf8FNTHpGIkSdpYb4KCNFJm9aaAk3QTeLw8S/TGQmkWicEC8GRJfxooz2ebmyYc 2q5B0jfLSuvcPBbFwDruvkmvYR6VQEQWe3H6oSq4aTNFiANKw3RC6xDPJVpGG+9z0A++ oBLNcndNCFjyfHHNDhRn5soVpEE0sa+0Z9NqhTAL2dOlbFz6+LzBs5yOa4O84vEAzhBL GiDw== X-Received: by 10.68.69.78 with SMTP id c14mr42879017pbu.68.1416481682942; Thu, 20 Nov 2014 03:08:02 -0800 (PST) Received: from localhost.localdomain ([165.132.120.48]) by mx.google.com with ESMTPSA id ju4sm1754183pbc.81.2014.11.20.03.07.59 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Nov 2014 03:08:01 -0800 (PST) From: Jungseung Lee To: Russell King , Catalin Marinas , Ard Biesheuvel , Laura Abbott , Will Deacon , linux-arm-kernel@lists.infradead.org Subject: [PATCH RESEND] arm: mm: fix discard_old_kernel_data Date: Thu, 20 Nov 2014 20:06:41 +0900 Message-Id: <1416481601-23659-1-git-send-email-js07.lee@gmail.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141120_030828_757167_7BB38743 X-CRM114-Status: GOOD ( 10.82 ) X-Spam-Score: -0.8 (/) Cc: Jungseung Lee X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP L1_CACHE_BYTES could be larger value than real L1 cache line size. In that case, discard_old_kernel_data function would omit to invalidate last bytes as much as L1_CACHE_BYTES - real cache line size. So fix end address to "to + PAGE_SIZE -1". The bottom bits of the address is LINELEN. that is ignored by mcrr. Signed-off-by: Jungseung Lee --- arch/arm/mm/copypage-v6.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mm/copypage-v6.c b/arch/arm/mm/copypage-v6.c index b9bcc9d..7042334 100644 --- a/arch/arm/mm/copypage-v6.c +++ b/arch/arm/mm/copypage-v6.c @@ -62,7 +62,7 @@ static void discard_old_kernel_data(void *kto) __asm__("mcrr p15, 0, %1, %0, c6 @ 0xec401f06" : : "r" (kto), - "r" ((unsigned long)kto + PAGE_SIZE - L1_CACHE_BYTES) + "r" ((unsigned long)kto + PAGE_SIZE - 1) : "cc"); }