From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757204AbcLTH7D (ORCPT ); Tue, 20 Dec 2016 02:59:03 -0500 Received: from terminus.zytor.com ([198.137.202.10]:39094 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751245AbcLTH7A (ORCPT ); Tue, 20 Dec 2016 02:59:00 -0500 Date: Mon, 19 Dec 2016 23:58:00 -0800 From: tip-bot for Marcin Nowakowski Message-ID: Cc: 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, oleg@redhat.com, tglx@linutronix.de Reply-To: alexander.shishkin@linux.intel.com, peterz@infradead.org, linux-kernel@vger.kernel.org, acme@kernel.org, marcin.nowakowski@imgtec.com, mingo@kernel.org, acme@redhat.com, victor.kamensky@linaro.org, jolsa@redhat.com, hpa@zytor.com, torvalds@linux-foundation.org, tglx@linutronix.de, oleg@redhat.com In-Reply-To: <1481625657-22850-1-git-send-email-marcin.nowakowski@imgtec.com> References: <1481625657-22850-1-git-send-email-marcin.nowakowski@imgtec.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] uprobes: Fix uprobes on MIPS, allow for a cache flush after ixol breakpoint creation Git-Commit-ID: 297e765e390a2ac996000b5f7228cbd84d995174 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 297e765e390a2ac996000b5f7228cbd84d995174 Gitweb: http://git.kernel.org/tip/297e765e390a2ac996000b5f7228cbd84d995174 Author: Marcin Nowakowski AuthorDate: Tue, 13 Dec 2016 11:40:57 +0100 Committer: Ingo Molnar CommitDate: Sun, 18 Dec 2016 09:42:11 +0100 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. 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. 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). Signed-off-by: Marcin Nowakowski Cc: Alexander Shishkin Cc: Arnaldo Carvalho de Melo Cc: Arnaldo Carvalho de Melo Cc: Jiri Olsa Cc: Linus Torvalds Cc: Oleg Nesterov Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Victor Kamensky Cc: linux-mips@linux-mips.org Link: http://lkml.kernel.org/r/1481625657-22850-1-git-send-email-marcin.nowakowski@imgtec.com Signed-off-by: Ingo Molnar --- kernel/events/uprobes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c index f9ec9ad..b5916b4 100644 --- a/kernel/events/uprobes.c +++ b/kernel/events/uprobes.c @@ -1194,7 +1194,7 @@ static struct xol_area *__create_xol_area(unsigned long vaddr) /* Reserve the 1st slot for get_trampoline_vaddr() */ set_bit(0, area->bitmap); atomic_set(&area->slot_count, 1); - copy_to_page(area->pages[0], 0, &insn, UPROBE_SWBP_INSN_SIZE); + arch_uprobe_copy_ixol(area->pages[0], 0, &insn, UPROBE_SWBP_INSN_SIZE); if (!xol_add_vma(mm, area)) return area;