Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp883350lqo; Fri, 17 May 2024 04:48:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXZYE+4HpZNzbnAqxLD+x37+3UjBrrSF/MfT4F506e9BvheE6DvzVcAb/hFunmI4/nnyIc1cXeM7cLnJJrUj1GXXtKyPgArt9/DCkMLzw== X-Google-Smtp-Source: AGHT+IEH5Ay3alFjgJxbfCbmPG3SqMUVLc96trn/nFqiRSOT2sHdn9Jo4hpPrUQSEdSYCYmW6Hfm X-Received: by 2002:a17:903:40c5:b0:1e7:b6a3:7bd9 with SMTP id d9443c01a7336-1ef43d15777mr274290275ad.16.1715946495238; Fri, 17 May 2024 04:48:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715946495; cv=pass; d=google.com; s=arc-20160816; b=xAwnWjxZ4EwWLIJ6oCl5CRtVewnVSauz0s4kRIYY2WQabDzI/bZ9h2qVBsazCWZeGk 5O/132eY6AzZoXFVCIxDIDRezTbA+rWZHhTsE9vV2/SRQh81ZHCX20Nmc98vDlV/wNQ3 7xa1PJR868Coy/s+pfTf7+5SPydJBPqG5VrRNKhfL8XPHik6tvFHxx7SG9wggrClCkiy 8OMHAFDsPxjcNRnBz7wcc5zKmWC2OS+hvegFwNJusRz7MItsppJ/0o3mUmhd02g8WdJg RKXITWQJoHnI3FJwDa+X7UXkfrFAZlSxwqXjP9/oZqC8XGxJ+jxKxXDpwmZoytz8RNRs zrXA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=UkQ7e2arnH2KoKSjS0mrzkvxxPQt9Glw3RaqeGfD0eI=; fh=5oIqPXof74fQesyArv3QYpek6D6+k8LK+7qTkJN/NYk=; b=EHYCHTV1WmsFHupJQWhVkXYJx0ySTs+NQ9+qttZ5FFVGk2ZAjlLZ0blgp+6lmOPPDx q0aEZj8SseBXrro9IcofPOOQLPMlsU0RPxCfEZB1jeG6KhTi4kV87ZQgJ+fdM3z/qBQG EMTtOvkvdn1CAClo8nPYKiNjyK/F0YtEIPEQvLttJcbR3RBZbZ5ZdsoYOKekuIiY6p2c R4iWkEw6XzcsaFzyD0nCuciVHVoSh3yiwhLjd++bTCX2dirMUwELFYu+A1mn0/X3Lr4/ SI6dVMfEEkmLUb2+c2bL27R5N1qn90Lj57MCytGXvG+FSZI9v9G4Nq1b/iqx//XchPu7 GE3A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kryf/Hid"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-182064-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182064-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0bad7af6si169668405ad.196.2024.05.17.04.48.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 May 2024 04:48:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182064-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="kryf/Hid"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-182064-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182064-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6B3B6B22B92 for ; Fri, 17 May 2024 11:47:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 76D1F3FBAE; Fri, 17 May 2024 11:47:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kryf/Hid" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 80A023BB35; Fri, 17 May 2024 11:47:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715946431; cv=none; b=NvKxcx3bNhSk1M+7T8Tum6AWzwaezx/WlZB4P2/3f+xTGvSFdMPcoKWRQzTtWt0UsCUvFnzaB1t7zKcypeptxolu4jy60oIa9MrmEHIaUOtK2wEUIQ5Ig7Amnj7CgpEHuI6y1lolOn2LXuDIBeJcjj5AfTNbH1/GBnRA5VIqhXg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715946431; c=relaxed/simple; bh=QPxik8B0uZ4chhltJzrxGabUS/wR7kyYGqGWD9+nCgc=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=TbNbuRWvoGIsBSCYXAr+RwUpUOJa5/NqxzsLoiYB0u3jm3vB7Dsw3t6Hnfowb1DT5NRlo+RODVx03S8sbu6fHq4dje1jAVnWOwzwf9kDGgpEEzj1bL5lTvQIHnuUSk5HsNDOGXc5ngGnt60pzq/+613yH7NDZgQOjDCZnSkEtS0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kryf/Hid; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A300C2BD10; Fri, 17 May 2024 11:47:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715946431; bh=QPxik8B0uZ4chhltJzrxGabUS/wR7kyYGqGWD9+nCgc=; h=From:To:Cc:Subject:Date:From; b=kryf/Hidpo82T7jbyBP0ORsBFGOksfU1ecIjD8wq256hwJ9ovWXPvozuYKc3zpXkS 9tg19TrH5cemLG5+m9ZrGglcGXhaGOK6LN205CxeJOFAc5FhIBLzyIv00FH2A/pofq QNvaw4pkwgct0oPQNGTSqdwhj3En0wKh8RJBrxqs2HlDz3xSZZo6FrKsWPGKn3L8K2 f002pLW1EY4P+hbmPuu97A2a6dydPtcSNuDOtmFEYGaJrwCCUBtgdPaTEFHsm9jaY0 nQgHVk7VT0eOzwXq/OA5+qq9SZmoj8K9Oe7nyJLLlmqE73W6Zc3Vgyx8YrABNFoK6R qlvkN6cNSebHA== From: Masahiro Yamada To: Kees Cook , Andy Lutomirski , Will Drewry , linux-kselftest@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Alexandre Belloni , Benjamin Tissoires , Christian Borntraeger , Claudio Imbrenda , David Hildenbrand , Janosch Frank , Jiri Kosina , Shuah Khan , bpf@vger.kernel.org, kvm@vger.kernel.org, linux-input@vger.kernel.org, linux-rtc@vger.kernel.org Subject: [PATCH 0/2] selftests: harness: refactor __constructor_order Date: Fri, 17 May 2024 20:45:04 +0900 Message-Id: <20240517114506.1259203-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series refactors __constructor_order because __constructor_order_last() is unneeded. BTW, the comments in kselftest_harness.h was confusing to me. As far as I tested, all arches executed constructors in the forward order. [test code] #include static int x; static void __attribute__((constructor)) increment(void) { x += 1; } static void __attribute__((constructor)) multiply(void) { x *= 2; } int main(void) { printf("foo = %d\n", x); return 0; } It should print 2 for forward order systems, 1 for reverse order systems. I executed it on some archtes by using QEMU. I always got 2. Masahiro Yamada (2): selftests: harness: remove unneeded __constructor_order_last() selftests: harness: rename __constructor_order for clarification .../drivers/s390x/uvdevice/test_uvdevice.c | 6 ------ tools/testing/selftests/hid/hid_bpf.c | 6 ------ tools/testing/selftests/kselftest_harness.h | 18 ++++-------------- tools/testing/selftests/rtc/rtctest.c | 7 ------- 4 files changed, 4 insertions(+), 33 deletions(-) -- 2.40.1