Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp312474imm; Tue, 15 May 2018 01:59:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo3kF1croqT7Y50gFz9kXFJ7j4KwgLSBuere8ZAjDs8UKwtYVSYgx8fT7fLhbcF9zPwx4Vx X-Received: by 2002:a62:8dc9:: with SMTP id p70-v6mr14201090pfk.72.1526374774261; Tue, 15 May 2018 01:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526374774; cv=none; d=google.com; s=arc-20160816; b=JyvBXmShjs3Wq39u+QstsajW/RwvNw3wyPM9BAg9RqHwFbdUNU+Jm1RySnNWOUhrEO gvWt0vAGns9I3xhq0YKiLPkvs0NzLHCemRFF5M+fVb4s1V+04Fpt2Iz4jQCalUbyUswq cJg1j3LFJ0BSMZSQ9rDh5gBV3GWycGg7sBJSchuicXDzGO1sklMwe/wE/KCH5AZtAuOU O+PQBNVdY/2PM2mqzuohAhcHvV+fTZgGYth7MPLS2Xs2Bg9QChJ5s24UByMUHIQDwDAu olammxAViSPPWHCOro0LNF3zwcYwfYdmo8c18U3juvFfjA0uPfTO78LEJXK/BYvKia3q e7qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=rMRpfI+2ebvbaxS7kgA4FEAHedhamG/U1EBOzOw2U0w=; b=t4ETCQ3ejAtLAbUxEYmGL6MLRdLNgnP5dndLJIMLlePz/usrenV/CwWZSKvTe15vQD r+p/btWUxnnPWCOuwl9V9o7lGawEaJSgQnAFyuLP4QODsx7NW3u94OGdDOISRpDVrGwO wWHUV4o3Eoa+jadKx/0Q1lAeYpXK69GcOqrpskSOgBQp+jFo5B9E34VWBAKF2VUeVmML igas01YLwr7IAGMe4gbVMgm3ABNAyRMgLiuK3pEnlvckM9SidhAAh2yS4swmQaaZGc4h 6Er5NiVCpZCePjQfs3lo+671ZkvJbUkEfKj9Syu3MPOTRH8EwEdNN4W/b8TRGz50HIqE 8DEA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1-v6si1318279pgc.388.2018.05.15.01.59.20; Tue, 15 May 2018 01:59:34 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752696AbeEOI63 (ORCPT + 99 others); Tue, 15 May 2018 04:58:29 -0400 Received: from exmail.andestech.com ([59.124.169.137]:34540 "EHLO ATCSQR.andestech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752595AbeEOI61 (ORCPT ); Tue, 15 May 2018 04:58:27 -0400 Received: from ATCSQR.andestech.com (localhost [127.0.0.2] (may be forged)) by ATCSQR.andestech.com with ESMTP id w4F8n3cR015420 for ; Tue, 15 May 2018 16:49:03 +0800 (GMT-8) (envelope-from vincentc@andestech.com) Received: from mail.andestech.com (atcpcs16.andestech.com [10.0.1.222]) by ATCSQR.andestech.com with ESMTP id w4F8mke4015355; Tue, 15 May 2018 16:48:46 +0800 (GMT-8) (envelope-from vincentc@andestech.com) Received: from atcsqa06.andestech.com (10.0.1.85) by ATCPCS16.andestech.com (10.0.1.222) with Microsoft SMTP Server id 14.3.123.3; Tue, 15 May 2018 16:46:09 +0800 From: Vincent Chen To: , , , CC: , Subject: [PATCH 0/3]nds32: Correct the cache operation for catch aliasing case Date: Tue, 15 May 2018 16:46:00 +0800 Message-ID: <1526373963-12417-1-git-send-email-vincentc@andestech.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.0.1.85] X-DNSRBL: X-MAIL: ATCSQR.andestech.com w4F8mke4015355 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following 3 issues are fixed in this patchset 1. In function flush_dacache_page and copy_user_highpage, the local irq is enabled when the cache of the page at address page_address(page) is written back to memory. It possibly causes data corruption. To fix this problem, the local irq is disabled before executing d-cache write-back and invalidate in this patchset. 2. According to Documentation/cachetlb.txt, the cache of the page at vmaddr shall be flushed in flush_anon_page instead of the cache of the page at page_address(page). We correct it and add the modification to this patchset. 3. Removing unneeded cache invalidation in copy_user_highpage function. Vincent Chen (3): nds32: Correct flush_dcache_page function nds32: Flush the cache of the page at vmaddr instead of kaddr in flush_anon_page nds32: Disable local irq before calling cpu_dcache_wb_page in copy_user_highpage arch/nds32/mm/cacheflush.c | 34 ++++++++++++++++++++-------------- 1 files changed, 20 insertions(+), 14 deletions(-)