From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6E4E2C5AC75 for ; Wed, 26 Jan 2022 00:35:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235320AbiAZAfn (ORCPT ); Tue, 25 Jan 2022 19:35:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232754AbiAZAfn (ORCPT ); Tue, 25 Jan 2022 19:35:43 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEF20C06161C; Tue, 25 Jan 2022 16:35:42 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8AB2E614D6; Wed, 26 Jan 2022 00:35:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4AB6AC340E0; Wed, 26 Jan 2022 00:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643157342; bh=tQVezuZkX3J4Tsw6a5hn1BLIry1tdM+HWG/m/i0/4ek=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=X3+GbHtJWxnk9bfaHzQpsjadL7uwNfL/+yo1C2e8o7psvHKI1guL7u1naLeWoDgrU UOk1vfzN37N9SsT7+g3YyQKePgw9u6EdZGB8cX5eV9EAS0NlziUlGWZ5e/aJ0k1yzP nnhDOeguna8Nr3WEf2fAyyxbp6JKVbzvwyUqYu3/MRtq/OH6NVMx5Foy2S7TyUCBM6 5gci5sVqDMc8sUqRyyk0QTj15QGHpU3fa1vD93dXyPU+cUmkbGwZQFXFNgUSWbLZuN QpMhY+NhXsQGPiEc91EAak7/lIo6B8rWVaOEfU8MDmcUGGwdAwTRXwqsDiq5qbtXNK dyBtV+Ua9KMZg== Date: Wed, 26 Jan 2022 09:35:38 +0900 From: Masami Hiramatsu To: Steven Rostedt Cc: Kees Cook , Masami Hiramatsu , Stephen Rothwell , Linux Kernel Mailing List , Linux Next Mailing List , Beau Belgrave Subject: Re: linux-next: build failure after merge of the kspp tree Message-Id: <20220126093538.893fb44a7cb0a7cd840c7fdb@kernel.org> In-Reply-To: <20220125172114.6807ed8f@gandalf.local.home> References: <20220125145006.677e3709@canb.auug.org.au> <202201242230.C54A6BCDFE@keescook> <20220125222732.98ce2e445726e773f40e122e@kernel.org> <20220125233154.dac280ed36944c0c2fe6f3ac@kernel.org> <202201251256.CCCBE9851E@keescook> <20220125162326.3d1ca960@gandalf.local.home> <20220125162859.2b3cc8a0@gandalf.local.home> <202201251402.0FB08DB@keescook> <20220125172114.6807ed8f@gandalf.local.home> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-next@vger.kernel.org Hi Steve, (Ccing Beau) On Tue, 25 Jan 2022 17:21:14 -0500 Steven Rostedt wrote: > On Tue, 25 Jan 2022 14:07:14 -0800 > Kees Cook wrote: > > > > The tstruct is the TP_STRUCT__entry() and for each __rel_dynamic_array() or > > > __dynamic_array(), the __data_size gets updated and saved into the > > > __data_offsets that holds where each item is. > > > > > > The rel versions sets the offset from its location to the data, where as > > > the non rel versions sets the offset from the beginning of the event to the > > > data. > > > > Could this just be > > > > #define __get_rel_dynamic_array(field) \ > > ((void *)(&__entry->data[__entry->__rel_loc_##field & 0xffff]) > > > > ? > > This is currently user space defined. But since the only user of the rel_* > version hasn't been upstreamed yet, we could change it. But it also > requires changing libtraceevent as it depends on this code too. I think Kees' idea seems better. If you and Beau are good, I will update the macros for __rel_loc. (This requires to change some user-space application which Beau is making too.) > > I'm surprised that it doesn't break with the __get_dynamic_array() > versions, or is that because it's based off of __entry? I think so. Gcc seems to check the size of the data structure where the original base address points. Thank you, > > -- Steve -- Masami Hiramatsu