Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp895103ybt; Fri, 26 Jun 2020 14:21:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzytnF1k3sIOwN2DlrS+zeaB7A9FpMkU7k/4HeSiS7i0wHxWt70NYBEQsVTMu5Tcbtd4m3C X-Received: by 2002:a50:8fa1:: with SMTP id y30mr5217787edy.86.1593206471870; Fri, 26 Jun 2020 14:21:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593206471; cv=none; d=google.com; s=arc-20160816; b=usHrQuUUx/Ibtt51SSlh2JEHAqhAka6jRGcuScUiTZybPLDgspOULJx7mHWkBR9riH Uj3k7e6eoLLjOPw5UUN5vWzv7Qg+IeQuV4QB+JG1C7vq67iVB1MIM0P8o7yCEU/WIa9v 4lz4bErdQH976OyNV1puD4161sCXszL4MTkAme1l7EKApPIHx4fhtXtKlGWxSFDlwN2A x2S5dnxrjIIj0RIMCW21TKIdBveldzN8e9EBN6HnDMwQnMeys1777zNHSesF3yT1rv9p DB3m0n1INlIHk4kbdY3B/voefi44tW9BoShG8mESKZY4aRhaNAtZ7fMZmh8sRrWCF7Za OvGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=fRqRadojwuG0TG7LIG7vreVHmh8dDyxVABNeNVIB/fI=; b=vzJW1noYpAoOaESO1HuQpopI6zUTyoMZs3jdIGR39hrDWwfBA9ytYwwqJCGjlcQ/iO EMTWVOZS2XTeH3iDqZNZMN3PfKF7i1PZ4UbPgkZ+R79/qS2XFBGQ090z+OihS/XjGgkH AI20sQVkvvPjngXxjy/FGUZav7Bpt2dKMUlMYAj8Na30V+KrXjk6ePYqxDQej5xdUdwe pZckKnfqP2UcE7K0ncL16BwiJWLJ83aSOsJ1lBdNKkJs573tDVh/I6vY18o5YTb/DGlB 5lOSq/ofFrgyHLqfO8iBFsz/WT7WOQms6kZ+q7BztG+lrg/lHHXUfGS5cyU+t+wUisI9 KFow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=fTouV6ua; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hh4si17754458ejb.549.2020.06.26.14.20.47; Fri, 26 Jun 2020 14:21:11 -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; dkim=pass header.i=@chromium.org header.s=google header.b=fTouV6ua; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725883AbgFZVUR (ORCPT + 99 others); Fri, 26 Jun 2020 17:20:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725832AbgFZVUQ (ORCPT ); Fri, 26 Jun 2020 17:20:16 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0724C03E97E for ; Fri, 26 Jun 2020 14:20:15 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id k71so1985357pje.0 for ; Fri, 26 Jun 2020 14:20:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=fRqRadojwuG0TG7LIG7vreVHmh8dDyxVABNeNVIB/fI=; b=fTouV6uau5MrWNpKLBIlplSK4yTsQr8vqkatlxEFGVAIO5/btu/+Y99/2O5JB2z2XB 0kip19LO2KxaHV2afumDNH48XY2qSD9F6oCsUOcLORAd/9N7qTzU9HoDp25R4vEa6OPQ jxl5SwiNpmF8rxPqXZdgmxh0OqDpkM/65iCs0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=fRqRadojwuG0TG7LIG7vreVHmh8dDyxVABNeNVIB/fI=; b=aFxkAaW0c3yQAE21d1Y7MEmpKIGUVJmSCFwelb5MVoa72VEv4ZasVOMsdroFUCCI7P JPli7EvNL19U8AKy42bKbvsiLu9pTAkV0J74OJdu1nYoagU9P1V8y/prjGV/WvRJTcwx Ld3qH+M2avkhdWHZcYXFZX2eI9du5i8+oluZjHrUwCJJbZ8fy4MHxkuEjmA0yXgbMTC8 WmPCzrKU72Uhyd7pKH4sh/aKIjzkMvjhy2Mk9t8bmwy58pNqafRTB7DtWWvBfQDLjTp0 qs/+J5+LR0osUlO5qAZMyaJMjjTpiSP06brN6HKJMM9m1rjVoNBzuQVILZPPP8Y6Jlh7 Bx/w== X-Gm-Message-State: AOAM531esy+jyeaz5Z1LJxhPf/RJLCghPTwYOApQbd7cFtyjHA5pLLr3 mAQPoaGc+iRtY+HYzdCpW+5dhg== X-Received: by 2002:a17:90a:2b8f:: with SMTP id u15mr3731333pjd.98.1593206415418; Fri, 26 Jun 2020 14:20:15 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id o22sm26668076pfd.114.2020.06.26.14.20.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 14:20:14 -0700 (PDT) Date: Fri, 26 Jun 2020 14:20:13 -0700 From: Kees Cook To: Brendan Higgins Cc: jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com, arnd@arndb.de, skhan@linuxfoundation.org, alan.maguire@oracle.com, yzaikin@google.com, davidgow@google.com, akpm@linux-foundation.org, rppt@linux.ibm.com, frowand.list@gmail.com, catalin.marinas@arm.com, will@kernel.org, monstr@monstr.eu, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, chris@zankel.net, jcmvbkbc@gmail.com, gregkh@linuxfoundation.org, sboyd@kernel.org, logang@deltatee.com, mcgrof@kernel.org, linux-um@lists.infradead.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-xtensa@linux-xtensa.org Subject: Re: [PATCH v5 01/12] vmlinux.lds.h: add linker section for KUnit test suites Message-ID: <202006261416.F4EAAE47E3@keescook> References: <20200626210917.358969-1-brendanhiggins@google.com> <20200626210917.358969-2-brendanhiggins@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200626210917.358969-2-brendanhiggins@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 26, 2020 at 02:09:06PM -0700, Brendan Higgins wrote: > Add a linker section where KUnit can put references to its test suites. > This patch is the first step in transitioning to dispatching all KUnit > tests from a centralized executor rather than having each as its own > separate late_initcall. > > Co-developed-by: Iurii Zaikin > Signed-off-by: Iurii Zaikin > Signed-off-by: Brendan Higgins > Reviewed-by: Stephen Boyd > --- > include/asm-generic/vmlinux.lds.h | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h > index db600ef218d7d..4f9b036fc9616 100644 > --- a/include/asm-generic/vmlinux.lds.h > +++ b/include/asm-generic/vmlinux.lds.h > @@ -881,6 +881,13 @@ > KEEP(*(.con_initcall.init)) \ > __con_initcall_end = .; > > +/* Alignment must be consistent with (kunit_suite *) in include/kunit/test.h */ Nit on naming: > +#define KUNIT_TEST_SUITES \ I would call this KUNIT_TABLE to maintain the same names as other things of this nature. > + . = ALIGN(8); \ > + __kunit_suites_start = .; \ > + KEEP(*(.kunit_test_suites)) \ > + __kunit_suites_end = .; > + > #ifdef CONFIG_BLK_DEV_INITRD > #define INIT_RAM_FS \ > . = ALIGN(4); \ > @@ -1056,6 +1063,7 @@ > INIT_CALLS \ > CON_INITCALL \ > INIT_RAM_FS \ > + KUNIT_TEST_SUITES \ > } Nack: this must be in INIT_DATA, not in INIT_DATA_SECTION. Not all architectures use the INIT_DATA_SECTION macro (e.g. arm64), but everything uses INIT_DATA. -- Kees Cook