From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Chancellor Subject: Re: [PATCH] inet/connection_sock: prefer _THIS_IP_ to current_text_addr Date: Wed, 1 Aug 2018 21:58:25 -0700 Message-ID: <20180802045825.GA16769@flashbox> References: <20180801215759.103758-1-ndesaulniers@google.com> <20180801.184208.776886134692058469.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: ndesaulniers@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org To: David Miller Return-path: Content-Disposition: inline In-Reply-To: <20180801.184208.776886134692058469.davem@davemloft.net> Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Wed, Aug 01, 2018 at 06:42:08PM -0700, David Miller wrote: > From: Nick Desaulniers > Date: Wed, 1 Aug 2018 14:57:59 -0700 > > > - sk, what, when, current_text_addr()); > > + sk, what, when, (void *)_THIS_IP_); > > Is a fugly macro in all caps really better than a function()? > > I'm really surprised that _THIS_IP_ is being chosen over > current_text_addr(), seriously. Hi Dave, current_text_addr is only used in five places in the entire kernel and this is the only non-architecture specific use. include/net/inet_connection_sock.h:227: sk, what, when, current_text_addr()); arch/sh/include/asm/kexec.h:64: newregs->pc = (unsigned long)current_text_addr(); arch/sh/kernel/dwarf.c:602: pc = (unsigned long)current_text_addr(); arch/x86/include/asm/kexec.h:135: newregs->ip = (unsigned long)current_text_addr(); arch/parisc/kernel/unwind.c:442: r.iaoq[0] = (unsigned long) current_text_addr(); We're trying to merge it with _THIS_IP_ before for most architectures, it is defined nearly identically to _THIS_IP_: #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) #define current_text_addr() ({ __label__ _l; _l: &&_l; }) * arc * arm * arm64 * h8300 * hexagon * m68k * mips * nds32 * nios2 * openrisc * powerpc * riscv * unicore32 * xtensa Ultimately, we're trying to turn off a new Clang warning in _THIS_IP_ which requires some changes to work around what is believed to be a GCC bug (see https://lore.kernel.org/patchwork/patch/969101/). I guess the alternative to this patch is to just define current_text_addr as _THIS_IP_ for all of those architectures, I am not sure how that filters into Nick's plan (I think the goal of this was to try and avoid getting all of the architecture folks involved). Thanks for your time! Nathan