Received: by 10.223.164.202 with SMTP id h10csp417583wrb; Thu, 30 Nov 2017 12:32:37 -0800 (PST) X-Google-Smtp-Source: AGs4zMYYuWl622FxMGpyqDiXLPcvTNU+XKEEIOr23yzE4QvxPQk11+RGHGtCIWCjxfonTUevXusg X-Received: by 10.84.160.232 with SMTP id v37mr3904458plg.167.1512073956999; Thu, 30 Nov 2017 12:32:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512073956; cv=none; d=google.com; s=arc-20160816; b=GogZOWLW7HJIbjuVbZp2QUswhvtG5jl32Fjrll7X/nU7GQjATU0hmZriC9EkmRpS48 1jF6se7mc81vN+pnVdTxYA/048/7oQK9cRlLJxV2ax8u29Abo6P0zX3R2Br+Z0FImzTh v6gsb5giSrxFCv6HTVXBVyhbr0OtO2z5OkzKhy3ZmnDTNjCDsOTcXCxppqwxYrnCUoH3 VAsvytUKC/Gg+KF/mhdIEZLiQy7P1gds5YxAkMBXJiyusEjDgNgqbOtcPU7RP0/DgLtv Szfe+jqTg6YoB+ScOQnw7zGRYVY4NWxHrL+/IkLyiLzcEO773G+hE6iVT7SDLhCW8gd3 edNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=nTBICMiE34/D3sqdDwHm79hQqu/KFECD9z2KY9ev3yE=; b=lKhoI2yXMVMJRz+Vip+tOfBiFCwGZGQUTROUNrsKutWeF6hMl7YKQR/kTOydQDnRI2 ZHxrmxOGN74wFY9VY2FHYwbswYgpIyWXRwRn/mDV+GfY04LI/DFMjGOSc7YckS2cTfQK o3fdVdjeOHJVYyzW+hep13Ob+FiDUAY/ZWGMB2uTe+f1BfWiJaSQBiaufFf9qSAjXYM7 KyqHxbIhjXXi35nAh2NaYe6EsqgfcBdeWGIM5zXpAQ32+wRb9dtPzifziwkrYf+5OsSB 5h95PNlj1j1s00/75P1V8lcSHjUEcxUO288XgFJ8gSoM/zuWixcmrXsfVz0JOplS5+Vf KVYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=IhGXKUjZ; 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 h5si2518190pgc.410.2017.11.30.12.32.21; Thu, 30 Nov 2017 12:32:36 -0800 (PST) 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; dkim=pass header.i=@lixom-net.20150623.gappssmtp.com header.s=20150623 header.b=IhGXKUjZ; 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 S1751322AbdK3UcK (ORCPT + 99 others); Thu, 30 Nov 2017 15:32:10 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:45451 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750761AbdK3UcG (ORCPT ); Thu, 30 Nov 2017 15:32:06 -0500 Received: by mail-lf0-f65.google.com with SMTP id f13so9306462lff.12 for ; Thu, 30 Nov 2017 12:32:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lixom-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=nTBICMiE34/D3sqdDwHm79hQqu/KFECD9z2KY9ev3yE=; b=IhGXKUjZQN5t34kydMacSd/Uj28Av2lYgxT8wSFhDJxLAMLZeejYwk52DRlwqv7/E9 DOvjJwbWtjRsi2JF3PSibHw3ZtHSOVGMa39+5oMoaXFyPDcVGV+riREXJHtO9VQJGORP YXI1aGIrHcMSwUT+vQSn3dfBPoSeTBzrQR2SH1Yx2LBDAaD8llrYkZwK/0av4UBjNQKx 8dKN20s6d5kOrm21RvG1imztP0SbBFdlzQO1L6VbSXVHfJvb3kT+NTZvRxO+CiwgnCIt /mj120LfjWJy8mUsuPLSujOz5m1fR6WrA5iR7pzQTMfprnFi8QyAZ+JpqJLHaW2htATC DsAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=nTBICMiE34/D3sqdDwHm79hQqu/KFECD9z2KY9ev3yE=; b=BlPw8/v0lAhOJrFRPu7YaDh1B9r3NDwUpbHD7AMLZ0HI169gArYg4jDNtCt1hGRqkV 96BigLedN67/kc5lVVu2gJXieXLm4N1Q4qnpAV34LTpEeqDsj+UU056R2kGwIcJEJPhv p6QLzXSqzi32RpR9+g16VRtUkNSDr7zVXF9CARXDY2FjrPCB7hDjBX8TOGJa7RfHwVfI tSZANYoTr30EOlPcuGYlW11737kmUItA5WE7GEbR0wk1xyRYbLk0b+jDw2brtyUto71r j5Pcyr069dQDoLtJFuz4o4ZVTQJl0tCmawVLQkVDGVja+x13GnWVOIxNb1cE/C6oax64 L1/A== X-Gm-Message-State: AJaThX4xfe0UhiC09O9G3XUXuvUj6kxvW7Yo9fKM9Xe1nJJPK+ry268z pOnudKfT+0+LSOX8r+VjsQsFM8Mh5zdVdYGa43OPgw== X-Received: by 10.46.76.26 with SMTP id z26mr3626433lja.19.1512073925355; Thu, 30 Nov 2017 12:32:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.25.221.196 with HTTP; Thu, 30 Nov 2017 12:32:04 -0800 (PST) X-Originating-IP: [209.133.79.7] In-Reply-To: <20171120185745.30795-4-palmer@sifive.com> References: <20171120185745.30795-1-palmer@sifive.com> <20171120185745.30795-4-palmer@sifive.com> From: Olof Johansson Date: Thu, 30 Nov 2017 12:32:04 -0800 Message-ID: Subject: Re: [patches] [PATCH 3/4] RISC-V: Flush I$ when making a dirty page executable To: patches@groups.riscv.org Cc: "linux-kernel@vger.kernel.org" , Andrew Waterman , Palmer Dabbelt Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Mon, Nov 20, 2017 at 10:57 AM, Palmer Dabbelt wrote: > From: Andrew Waterman > > The RISC-V ISA allows for instruction caches that are not coherent WRT > stores, even on a single hart. As a result, we need to explicitly flush > the instruction cache whenever marking a dirty page as executable in > order to preserve the correct system behavior. > > Local instruction caches aren't that scary (our implementations actually > flush the cache, but RISC-V is defined to allow higher-performance > implementations to exist), but RISC-V defines no way to perform an > instruction cache shootdown. When explicitly asked to do so we can > shoot down remote instruction caches via an IPI, but this is a bit on > the slow side. > > Instead of requiring an IPI to all harts whenever marking a page as > executable, we simply flush the currently running harts. In order to > maintain correct behavior, we additionally mark every other hart as > needing a deferred instruction cache which will be taken before anything > runs on it. > > Signed-off-by: Andrew Waterman > Signed-off-by: Palmer Dabbelt > --- > arch/riscv/include/asm/cacheflush.h | 24 ++++++++++++--- > arch/riscv/include/asm/mmu.h | 4 +++ > arch/riscv/include/asm/mmu_context.h | 44 +++++++++++++++++++++++++++ > arch/riscv/include/asm/pgtable.h | 58 ++++++++++++++++++++---------------- > arch/riscv/include/asm/tlbflush.h | 2 ++ > arch/riscv/kernel/smp.c | 48 +++++++++++++++++++++++++++++ > arch/riscv/mm/Makefile | 2 ++ > arch/riscv/mm/cacheflush.c | 23 ++++++++++++++ > 8 files changed, 175 insertions(+), 30 deletions(-) > create mode 100644 arch/riscv/mm/cacheflush.c [...] > diff --git a/arch/riscv/mm/Makefile b/arch/riscv/mm/Makefile > index 81f7d9ce6d88..786b5fdec0fd 100644 > --- a/arch/riscv/mm/Makefile > +++ b/arch/riscv/mm/Makefile > @@ -2,3 +2,5 @@ obj-y += init.o > obj-y += fault.o > obj-y += extable.o > obj-y += ioremap.o > +obj-y += dma.o > +obj-y += cacheflush.o Looks like dma.c didn't make it into this patch (and didn't already exist), so builds fail with: make[3]: *** No rule to make target 'arch/riscv/mm/dma.o', needed by 'arch/riscv/mm/built-in.o'. -Olof From 1584794155897187380@xxx Wed Nov 22 19:04:43 +0000 2017 X-GM-THRID: 1584612605235196569 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread