Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp807709imm; Mon, 21 May 2018 14:53:16 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrQW6E3QkLFVZh9ibT3HQil8pwLe1jG2RJn3G3JRmK4dprrQfxkLpX0mWZ/+LdiOXdKD8eu X-Received: by 2002:a17:902:ab93:: with SMTP id f19-v6mr22443429plr.392.1526939596320; Mon, 21 May 2018 14:53:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526939596; cv=none; d=google.com; s=arc-20160816; b=V45+hCBCBExJrp4LDi4pXUFfubZBQckTjf1bw8ZS61IbfTLaIdewBJQpAW4z18yNxV BJxDakcMQHwp5ltMuJheGgHIcytW5824u0kQqngOLqnW8R5+X2mbbA6akIQAnMb7cJ73 rdtKthCwqtergHVw6MnN+GnkYWZAhCeH0D+5dcUjsAtxeqmFREQLaiU/7K/tJWRvN/41 tMUcnPgVi9sVCFFOpculTQOuIdeDRL00bCsEL6+z4zx1qKmSMMZe3UY2wrTzenOOxol/ laWtt6eYnrrzE/KJkfydwVHG1VmAhoUSFNo8kiek5PG3EJ7RFvTtLGnSgGfKx9hGsmND WlOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=HU2M2JbZ3VzASzUqEkr17pnRTRGot2kf40bviCU2MAM=; b=n7Hz5QAI7a5+ABY0YbUWogLdKWJcPOBhe5DkU7aj4IFmGaX/DiqMfamAR2nTSXfggL 7FYp68aP7kRoKq5XkOCZ2uZFH9MDLWRK8EP1hXLBQ0mlSSImXfcn3ok1HkWOP50VP0pa GrahkBxLrOywPnAP8xGgrqbcSJHAVG7NyC+qirl01L14aZzvOfTMihez9zy3ruBA+gbG vajoQOPkobsO8tExAzY67Eh9DUnQ/PSrBvBUltIMqvL+J+iMESfpIiEXcy0izm0G0peO FWyxGDbo5zKm33uaLjQ87Pzt+dty0zSjLySsW5hzpXg1UDUOf+uCSmLNYTTRw3ahASXr CWhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T1wtziou; 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 j4-v6si14222221plt.430.2018.05.21.14.53.01; Mon, 21 May 2018 14:53:16 -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; dkim=pass header.i=@kernel.org header.s=default header.b=T1wtziou; 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 S932167AbeEUVvU (ORCPT + 99 others); Mon, 21 May 2018 17:51:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:37846 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932067AbeEUVW7 (ORCPT ); Mon, 21 May 2018 17:22:59 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3D91420871; Mon, 21 May 2018 21:22:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1526937778; bh=LaBudocWRAKVZyGhkhCpx9oPC5dNo25P+L8HbMN+mEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T1wtziouy5iQkcvAncu5BminJlSZmpVF8kLhWjl4KJxrMSTaxLPTSROJ89V4XduPV xSJikurnbLOZvhz7vZXbpK+KRdDFXCcP89wqYerIJyDiWTJH3uFr9/S61iRiesXJCq mm2Z0MUqprk8s0c+LFm8hd6D1Xb9gSZGPLidk44E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Juergen Gross , "Steven Rostedt (VMware)" Subject: [PATCH 4.16 022/110] tracing/x86/xen: Remove zero data size trace events trace_xen_mmu_flush_tlb{_all} Date: Mon, 21 May 2018 23:11:19 +0200 Message-Id: <20180521210505.832255089@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180521210503.823249477@linuxfoundation.org> References: <20180521210503.823249477@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 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 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Steven Rostedt (VMware) commit 45dd9b0666a162f8e4be76096716670cf1741f0e upstream. Doing an audit of trace events, I discovered two trace events in the xen subsystem that use a hack to create zero data size trace events. This is not what trace events are for. Trace events add memory footprint overhead, and if all you need to do is see if a function is hit or not, simply make that function noinline and use function tracer filtering. Worse yet, the hack used was: __array(char, x, 0) Which creates a static string of zero in length. There's assumptions about such constructs in ftrace that this is a dynamic string that is nul terminated. This is not the case with these tracepoints and can cause problems in various parts of ftrace. Nuke the trace events! Link: http://lkml.kernel.org/r/20180509144605.5a220327@gandalf.local.home Cc: stable@vger.kernel.org Fixes: 95a7d76897c1e ("xen/mmu: Use Xen specific TLB flush instead of the generic one.") Reviewed-by: Juergen Gross Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Greg Kroah-Hartman --- arch/x86/xen/mmu.c | 4 +--- arch/x86/xen/mmu_pv.c | 4 +--- include/trace/events/xen.h | 16 ---------------- 3 files changed, 2 insertions(+), 22 deletions(-) --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -42,13 +42,11 @@ xmaddr_t arbitrary_virt_to_machine(void } EXPORT_SYMBOL_GPL(arbitrary_virt_to_machine); -static void xen_flush_tlb_all(void) +static noinline void xen_flush_tlb_all(void) { struct mmuext_op *op; struct multicall_space mcs; - trace_xen_mmu_flush_tlb_all(0); - preempt_disable(); mcs = xen_mc_entry(sizeof(*op)); --- a/arch/x86/xen/mmu_pv.c +++ b/arch/x86/xen/mmu_pv.c @@ -1280,13 +1280,11 @@ unsigned long xen_read_cr2_direct(void) return this_cpu_read(xen_vcpu_info.arch.cr2); } -static void xen_flush_tlb(void) +static noinline void xen_flush_tlb(void) { struct mmuext_op *op; struct multicall_space mcs; - trace_xen_mmu_flush_tlb(0); - preempt_disable(); mcs = xen_mc_entry(sizeof(*op)); --- a/include/trace/events/xen.h +++ b/include/trace/events/xen.h @@ -352,22 +352,6 @@ DECLARE_EVENT_CLASS(xen_mmu_pgd, DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_pin); DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_unpin); -TRACE_EVENT(xen_mmu_flush_tlb_all, - TP_PROTO(int x), - TP_ARGS(x), - TP_STRUCT__entry(__array(char, x, 0)), - TP_fast_assign((void)x), - TP_printk("%s", "") - ); - -TRACE_EVENT(xen_mmu_flush_tlb, - TP_PROTO(int x), - TP_ARGS(x), - TP_STRUCT__entry(__array(char, x, 0)), - TP_fast_assign((void)x), - TP_printk("%s", "") - ); - TRACE_EVENT(xen_mmu_flush_tlb_one_user, TP_PROTO(unsigned long addr), TP_ARGS(addr),