From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757419AbcLTNI1 (ORCPT ); Tue, 20 Dec 2016 08:08:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34532 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752837AbcLTNIZ (ORCPT ); Tue, 20 Dec 2016 08:08:25 -0500 Date: Tue, 20 Dec 2016 14:08:20 +0100 From: Oleg Nesterov To: tip-bot for Marcin Nowakowski Cc: linux-tip-commits@vger.kernel.org, linux-kernel@vger.kernel.org, peterz@infradead.org, alexander.shishkin@linux.intel.com, acme@kernel.org, marcin.nowakowski@imgtec.com, acme@redhat.com, mingo@kernel.org, victor.kamensky@linaro.org, jolsa@redhat.com, hpa@zytor.com, torvalds@linux-foundation.org, tglx@linutronix.de Subject: Re: [tip:perf/urgent] uprobes: Fix uprobes on MIPS, allow for a cache flush after ixol breakpoint creation Message-ID: <20161220130820.GA24822@redhat.com> References: <1481625657-22850-1-git-send-email-marcin.nowakowski@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 20 Dec 2016 13:08:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/19, tip-bot for Marcin Nowakowski wrote: > > uprobes: Fix uprobes on MIPS, allow for a cache flush after ixol breakpoint creation > > Commit: > > 72e6ae285a1d ('ARM: 8043/1: uprobes need icache flush after xol write' > > ... has introduced an arch-specific method to ensure all caches are > flushed appropriately after an instruction is written to an XOL page. when this page is already mmaped, > However, when the XOL area is created and the out-of-line breakpoint > instruction is copied, caches are not flushed at all and stale data may > be found in icache. but in this case the page is not mmaped yet, the probed application will take a page fault if it tries to execute this insn, > Replace a simple copy_to_page() with arch_uprobe_copy_ixol() to allow > the arch to ensure all caches are updated accordingly. > > This change fixes uprobes on MIPS InterAptiv (tested on Creator Ci40). OK, I know nothing about MIPS, but could you help me understand this change? See above. If we really need flush_icache_range() here then perhaps we should modify install_special_mapping() and/or __do_fault/special_mapping_fault paths instead? Oleg.