From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751431AbdKUQ4w convert rfc822-to-8bit (ORCPT ); Tue, 21 Nov 2017 11:56:52 -0500 Received: from smtp-out4.electric.net ([192.162.216.184]:60234 "EHLO smtp-out4.electric.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751067AbdKUQ4v (ORCPT ); Tue, 21 Nov 2017 11:56:51 -0500 From: David Laight To: "'Palmer Dabbelt'" , "linux-kernel@vger.kernel.org" CC: "patches@groups.riscv.org" , Andrew Waterman Subject: RE: [PATCH 3/4] RISC-V: Flush I$ when making a dirty page executable Thread-Topic: [PATCH 3/4] RISC-V: Flush I$ when making a dirty page executable Thread-Index: AQHTYjGS5Xv6zi7BSUWsPHixGido2aMfDgfw Date: Tue, 21 Nov 2017 16:57:07 +0000 Message-ID: <9acaf467a587413a9aa1529ab8cc904e@AcuMS.aculab.com> References: <20171120185745.30795-1-palmer@sifive.com> <20171120185745.30795-4-palmer@sifive.com> In-Reply-To: <20171120185745.30795-4-palmer@sifive.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.99.200] Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Outbound-IP: 156.67.243.126 X-Env-From: David.Laight@ACULAB.COM X-Proto: esmtps X-Revdns: X-HELO: AcuMS.aculab.com X-TLS: TLSv1.2:ECDHE-RSA-AES256-SHA384:256 X-Authenticated_ID: X-PolicySMART: 3396946, 3397078 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Palmer Dabbelt > Sent: 20 November 2017 18:58 > > 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. Isn't the I-flush only needed if there has been an unmap since the previous I-flush? Since code is rarely unmapped (exec and driver unload come to mind) the I-flush won't be needed very often. David