Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2396138ybh; Fri, 24 Jul 2020 11:39:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0PJmpJ1KjDPAP3fxjKCj0s6Vw7/3nTHZYLmRkXjtwDT5zDVN7khEHDW3bBxnTmMxSyOmh X-Received: by 2002:a50:cc8c:: with SMTP id q12mr8254088edi.313.1595615961953; Fri, 24 Jul 2020 11:39:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595615961; cv=none; d=google.com; s=arc-20160816; b=lUa+qtPRLTU05aWJ5XK1RD3hqa6v5V0AH0kMnqG4p4m+38XHqOgNPkzif94zwuMl8k aOoUQsvxuFAbH8oIAe4DI9O8ymwScLNES+fsAV0wH4eme5JYNXZAYbZVqADNG5LJ3zfo Uc08PpUASkXnzrBpFTU6KGpbBwK07/tj1/C/FRkYuFyZ02n7+gijQRPzIV2fl0RfYxPa 7U1mnoDBw2Tgv4NJXrANgt3kCJ6OW2ViBRbVRHN1FMoEnuGMzDu7h7CU8V2fMX4YjECl 8MPkSwFqMTBxS2p6cwsNdiuPqY813MGQMKanQi9ZURDlMBS9M4kruqc7m/Qfz+DsFIb7 zUNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=vseIiCUqa/HrIauu3kIdFTAVUZ8DdNN8Mgdf2s2RdGQ=; b=ddZU5PWYy/s6kFTa/7+gqiQWUHZ3H0RO5ockViww/eu4CS2OvGUE302hLJHU13SCNe WCQ/i6L56ca2mFFaKWX11XVELTCCjbF5mj0uYrDyLeLnBlDIQnkbpqjJEnMias7vh0AO DW5HmLjvijoJCwpCO7v/bNUOKp41TOcLg0PwCEZqOfimf0v7Ox6eLZQ3XR5bKdVlIWVF l/ZSYfjiCTJ1RcJtgzZq6i/lC2VikY95OHsPUL41qQ7h7Hi0+hME4Yy3v5RKrTgpFilG S9Uf6wd9JD8d9+EphNzPm2O4EFGqwbBT1NQxmWCwhpbhvRfOlZgK7kT/uPf5X8M81adw iwSw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r9si1022445ejb.103.2020.07.24.11.38.44; Fri, 24 Jul 2020 11:39:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726553AbgGXSfA (ORCPT + 99 others); Fri, 24 Jul 2020 14:35:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:36990 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726326AbgGXSfA (ORCPT ); Fri, 24 Jul 2020 14:35:00 -0400 Received: from oasis.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 EF5C8206F0; Fri, 24 Jul 2020 18:34:58 +0000 (UTC) Date: Fri, 24 Jul 2020 14:34:57 -0400 From: Steven Rostedt To: Oscar Carter Cc: Ingo Molnar , Kees Cook , linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, Jann Horn Subject: Re: [PATCH v2 2/2] kernel/trace: Remove function callback casts Message-ID: <20200724143457.27755412@oasis.local.home> In-Reply-To: <20200724175500.GD3123@ubuntu> References: <20200719155033.24201-1-oscar.carter@gmx.com> <20200719155033.24201-3-oscar.carter@gmx.com> <20200721140545.445f0258@oasis.local.home> <20200724161921.GA3123@ubuntu> <20200724123528.36ea9c9e@oasis.local.home> <20200724171418.GB3123@ubuntu> <20200724133656.76c75629@oasis.local.home> <20200724134020.3160dc7c@oasis.local.home> <20200724175500.GD3123@ubuntu> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 24 Jul 2020 19:55:00 +0200 Oscar Carter wrote: > > Which one of the above is this patch set for? > > This patch is the result of a warning obtained with the following: > > make allmodconfig ARCH=powerpc > make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnu- -j4 > > And with the -Wcast-function-type enabled in the top level makefile. Looking into powerpc I found this: arch/powerpc/include/asm/ftrace.h: #ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS #define ARCH_SUPPORTS_FTRACE_OPS 1 #endif arch/powerpc/Kconfig: select HAVE_DYNAMIC_FTRACE_WITH_REGS if MPROFILE_KERNEL [..] config MPROFILE_KERNEL depends on PPC64 && CPU_LITTLE_ENDIAN && FUNCTION_TRACER def_bool $(success,$(srctree)/arch/powerpc/tools/gcc-check-mprofile-kernel.sh $(CC) -I$(srctree)/include -D__KERNEL__) So, it looks like you need to be 64bit PowerPC, Little Endian, and gcc needs to support -mprofile. Otherwise, it falls back to the old way that does the type casting. If you are really concerned about this, I would recommend adding support to the architecture you care about, and then this will no longer be an issue. The funny part is, you can still add support for ftrace_ops, without adding support for DYNAMIC_FTRACE_WITH_REGS, if you only care about not having to do that typecast. My NAK still stands. I wont let an intrusive patch be added to the ftrace core code to deal with an unsupported feature in an architecture. I would be will to add that linker trick to remove the warning. Or we just use that warning as incentive to get architecture developers to implement this feature ;-) -- Steve