From nobody Fri Oct 3 10:11:14 2025 Received: from pdx-out-009.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-009.esa.us-west-2.outbound.mail-perimeter.amazon.com [35.155.198.111]) (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 BE79718DB02; Tue, 2 Sep 2025 17:02:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=35.155.198.111 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756832547; cv=none; b=SETGDSqjUPRGe0g6eKLUfNcIWmeLvQ6549Q/CtznH3nWEUc+CK9VUVx5HeH17+MESeWmbhJ98vliEUmuTPimOjWxRRqLwZyNqgC2Q77DPfleGZZcgLC/Ojc/ayvaLSr1rJNyI1mzeIiuxLY8m03QlFIGd3xbtmXvdn+3F8HrjBY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756832547; c=relaxed/simple; bh=ugkcA7r6kNBQjmtE83xEiGCVJ9e8AnYbjt9BMUnM9Ro=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YfocGWmE4UP5/+ixSp8te2kYZwr8DbKP2Uj/M47Il0UpWYI7DQGA2P5p0U7SVlow9qV6llQRqYRebHYBsE0WIoKeGZ2x3DVgWSPCCKD2WKz511KX711VNCP6roSESiSVfWYWfI6i6JfwRiVMPQVntnJO/oVanMyFrIcSSlamJLM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.co.uk; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b=XCBW60TS; arc=none smtp.client-ip=35.155.198.111 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.co.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b="XCBW60TS" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1756832545; x=1788368545; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4eN3H4gUTxiDGL0gbX6jPnbdGToINp5ex5FqH9wcFdw=; b=XCBW60TS7f2CfD6/S5dn2MZjzc1oxcz70RNz65p0sw0zGAZYXwXRs7Lz xRnbioltwWyK7tcgVoDCONHhMZ82RCTnWJJRYrqI8d5SnGScXY4EYTN+p pssYwjoHI5wAh4Pgz7IKmd1waEXiPpOFkEWxbS2CaJZppPouQRYv+xShN yNmlnA/zWnW//oEqs7RU4UToFoKmFi2962zo2t9sa8H39bynIafmm4POl B+SjyjYNkbz9jpJ4Ylokpre2BzgSCHaao/urXq2XnRQUjqYXagoAKQbin DcZWwRRnWxHYwlRH30OcILbgMHKMd+Lmst8pWw6kzRVKGQdw/ZRr7RYcY A==; X-CSE-ConnectionGUID: dSkxISX+Sdilzx77kjCyDQ== X-CSE-MsgGUID: L7iqPandRPqSLDZqEh+Itw== X-IronPort-AV: E=Sophos;i="6.18,233,1751241600"; d="scan'208";a="2115778" Received: from ip-10-5-12-219.us-west-2.compute.internal (HELO smtpout.naws.us-west-2.prod.farcaster.email.amazon.dev) ([10.5.12.219]) by internal-pdx-out-009.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2025 17:02:23 +0000 Received: from EX19MTAUWC001.ant.amazon.com [10.0.21.151:33092] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.29.106:2525] with esmtp (Farcaster) id 070b649c-b5b4-4584-8a0a-426c4fca832f; Tue, 2 Sep 2025 17:02:23 +0000 (UTC) X-Farcaster-Flow-ID: 070b649c-b5b4-4584-8a0a-426c4fca832f Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWC001.ant.amazon.com (10.250.64.174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.17; Tue, 2 Sep 2025 17:02:22 +0000 Received: from dev-dsk-aqibaf-1b-17060f52.eu-west-1.amazon.com (10.253.72.42) by EX19D001UWA001.ant.amazon.com (10.13.138.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.20; Tue, 2 Sep 2025 17:02:21 +0000 From: Aqib Faruqui To: Christian Brauner , Shuah Khan , , CC: , Subject: [PATCH v2 1/7] selftests/pidfd: Add architecture-specific fallback definitions for pidfd_open Date: Tue, 2 Sep 2025 17:01:38 +0000 Message-ID: <20250902170147.55583-2-aqibaf@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250902170147.55583-1-aqibaf@amazon.com> References: <20250902170147.55583-1-aqibaf@amazon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: EX19D036UWC003.ant.amazon.com (10.13.139.214) To EX19D001UWA001.ant.amazon.com (10.13.138.214) Content-Type: text/plain; charset="utf-8" The pidfd_open syscall number varies by architecture. Add fallback definitions for Alpha (544) and other architectures (434) to ensure compatibility with non-glibc C libraries that may not define these syscall numbers. Signed-off-by: Aqib Faruqui --- tools/testing/selftests/pidfd/pidfd.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/pidfd/pidfd.h b/tools/testing/selftest= s/pidfd/pidfd.h index f87993def..c373ff18e 100644 --- a/tools/testing/selftests/pidfd/pidfd.h +++ b/tools/testing/selftests/pidfd/pidfd.h @@ -45,8 +45,12 @@ #endif =20 #ifndef __NR_pidfd_open +#ifdef __alpha__ +#define __NR_pidfd_open 544 +#else #define __NR_pidfd_open 434 #endif +#endif =20 #ifndef __NR_pidfd_send_signal #define __NR_pidfd_send_signal 424 --=20 2.47.3 From nobody Fri Oct 3 10:11:14 2025 Received: from pdx-out-003.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-003.esa.us-west-2.outbound.mail-perimeter.amazon.com [44.246.68.102]) (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 55B5B2E2846; Tue, 2 Sep 2025 17:02:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=44.246.68.102 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756832576; cv=none; b=pXKDJHMIJrB9+J18Vvw8+4vYGAOIK9WUrc7zu9CTXL/QJBLpnjxQCL01+ZJ6W0kk2pJvAWB+kXQRgQ8pIEVQzb08DhzU580GchZ+sf+iTRzV2mOuqfClU++b17g1rBT8pz95BL3u2+HUMzjc56zKPDSvLayPIxQQw+XZJrUtobM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756832576; c=relaxed/simple; bh=/lPcINznypLsIR+LicOLSRXHwcVbhsz8Cxkle4+8hLg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=am+CB2MG128tUaavcLEj+EMCpE6pH9V5C4vNsh5YIf0rh+aLh7Ns428+Pl3iorpnWlyJ0HQPbo2fprEzs3q8nl1tpiAIVqq/nUa4/7QYykeqxCzTAAewR9WkfaFPuSRXuf0bLDweWcdJP6GDnK16Esu7G2fGxQvpiDOG8kwv6zo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.co.uk; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b=APL2fXEJ; arc=none smtp.client-ip=44.246.68.102 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.co.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b="APL2fXEJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1756832575; x=1788368575; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XPeyg5ReUvA2UikBQ6V/HxX84Yk81qnsGCyL1gycA0E=; b=APL2fXEJ7OD3pH8v8jKekb5Yb3I+PHa2TXjIG/9+1Cz9aCVDaQop0LSO FRie7YLJSu52elf+WgR257Fkibim4agCVfNsPW1rvTwmR8Pa5zQsTO9Eh jlcBdfRqec6wBPijBKzYwvrQSeNj33pTXyEQt3/IBXKl5LTYCqjIyDQN+ m9J87eM8/vkHvrSN3GMptbX5IUuCbBfMO7l8nfG6Uy3RP8pOLxOowpGdq 07IQ5p2BjIjnnejL0HhlPPPSaElEsDfwSPr38OekUC/Qxiog8y6fRUttP oCSOvCbiUdnPcP1pGYUiaShFiEe00NuOmn2ITVkvtxRqEzekHcfEL6saA g==; X-CSE-ConnectionGUID: 3Lv04L/iTOWmiBce61yBbA== X-CSE-MsgGUID: oTvyL7cNTQa0mDo5NOcdpw== X-IronPort-AV: E=Sophos;i="6.16,229,1744070400"; d="scan'208";a="2234174" Received: from ip-10-5-0-115.us-west-2.compute.internal (HELO smtpout.naws.us-west-2.prod.farcaster.email.amazon.dev) ([10.5.0.115]) by internal-pdx-out-003.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2025 17:02:53 +0000 Received: from EX19MTAUWB002.ant.amazon.com [10.0.7.35:8561] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.28.48:2525] with esmtp (Farcaster) id d7657a8d-c934-493d-a8ca-e1a001f7e449; Tue, 2 Sep 2025 17:02:53 +0000 (UTC) X-Farcaster-Flow-ID: d7657a8d-c934-493d-a8ca-e1a001f7e449 Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWB002.ant.amazon.com (10.250.64.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.17; Tue, 2 Sep 2025 17:02:50 +0000 Received: from dev-dsk-aqibaf-1b-17060f52.eu-west-1.amazon.com (10.253.72.42) by EX19D001UWA001.ant.amazon.com (10.13.138.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.20; Tue, 2 Sep 2025 17:02:48 +0000 From: Aqib Faruqui To: Kees Cook , Andy Lutomirski , "Will Drewry" , Shuah Khan , Christian Brauner , , CC: , Subject: [PATCH v2 2/7] selftests: harness: Include pidfd.h to get syscall definitions from tools/ Date: Tue, 2 Sep 2025 17:01:39 +0000 Message-ID: <20250902170147.55583-3-aqibaf@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250902170147.55583-1-aqibaf@amazon.com> References: <20250902170147.55583-1-aqibaf@amazon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: EX19D043UWA003.ant.amazon.com (10.13.139.31) To EX19D001UWA001.ant.amazon.com (10.13.138.214) Content-Type: text/plain; charset="utf-8" The kselftest harness uses pidfd_open() for test timeout handling but may not have access to the syscall definitions in non-glibc environments. Include pidfd.h to ensure the syscall numbers are available. Signed-off-by: Aqib Faruqui --- tools/testing/selftests/kselftest_harness.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/se= lftests/kselftest_harness.h index 2925e47db..1dd3e5a1b 100644 --- a/tools/testing/selftests/kselftest_harness.h +++ b/tools/testing/selftests/kselftest_harness.h @@ -69,6 +69,7 @@ #include =20 #include "kselftest.h" +#include "pidfd/pidfd.h" =20 #define TEST_TIMEOUT_DEFAULT 30 =20 --=20 2.47.3 From nobody Fri Oct 3 10:11:14 2025 Received: from pdx-out-010.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-010.esa.us-west-2.outbound.mail-perimeter.amazon.com [52.12.53.23]) (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 718F32DE1E3; Tue, 2 Sep 2025 17:03:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.12.53.23 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756832601; cv=none; b=tUUWlb5yd2aJQDtyMpNe21Zdv/C3S/Y+yLC7AScpHA0P4beBN9xGg0wo1ETvs8fTnvqcVB/aTgNIYkVxLAvrJA0RcxdiwHo1ARgwBIg9+/Qn7WLkY3ejbaK3errx2t33gkm5gZjEQo4TKFnslhqDkmPVaJrU+5cmlT8sk9lV+Os= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756832601; c=relaxed/simple; bh=GAzUTkg2t0FKlEtMspkbfVsM9F/3ShzZcYlzXEpJ3Aw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=pxZWWh40BjZhuhs5PcZgRSmqTYGpYRVuPLIVmg0Nw4DqrC2dyunIyi10CmfwTszkCYscdWimNypRkotTCVBRHgUOj6SJy/ZMbqrDt70VNWbDd5IifQT410FP5hL+3URqKFEUKdtAqbckfsaZL3Ey3cZBtpiSOu+B6N3atBMGbi8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.co.uk; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b=s2i64Gvm; arc=none smtp.client-ip=52.12.53.23 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.co.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b="s2i64Gvm" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1756832599; x=1788368599; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hnWWntazb36HQ0Hxk/LBzvzq1USYr0PJXvk2r6jX0Og=; b=s2i64Gvm/vyhERRv/0CycJ+7HNT4ohSBGhdKva70qI9R+vJMP9SNljfz QjKWlVKwq/VR32nAyM02lBfLh88xFtB8B+lQeM/PGHcBxy7aLMcHCFTJu wlFZ5vWxOenVR9vbVXTa9kvT/YyIXv6kTHPLDx/pHIKiEwsV7+u2rqwqJ AuJPsOoaO2+4e6yWy+5+XiDdfrtW9jeucKlCSdexwkWJ0S41aDMIyFJIv hV5fdvxcZ40UpIMhpOUO/Bjjp+kGQDAEmn3MKytvvdswsjTtRovxMe/Wa avqv/PE1ccvkpf4wNtxSOLCHDER9tzhbRuyj3wYMp+0wCiLvEZy+ms+ob Q==; X-CSE-ConnectionGUID: Oe/kozayQSy9Gb6A2612xA== X-CSE-MsgGUID: +0sjVJkNTIW4zFgCbtTChg== X-IronPort-AV: E=Sophos;i="6.18,233,1751241600"; d="scan'208";a="2116380" Received: from ip-10-5-12-219.us-west-2.compute.internal (HELO smtpout.naws.us-west-2.prod.farcaster.email.amazon.dev) ([10.5.12.219]) by internal-pdx-out-010.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2025 17:03:17 +0000 Received: from EX19MTAUWA002.ant.amazon.com [10.0.21.151:17666] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.28.48:2525] with esmtp (Farcaster) id 9e68ad25-9ae0-4f99-93ee-e38e2e170ca3; Tue, 2 Sep 2025 17:03:17 +0000 (UTC) X-Farcaster-Flow-ID: 9e68ad25-9ae0-4f99-93ee-e38e2e170ca3 Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWA002.ant.amazon.com (10.250.64.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.17; Tue, 2 Sep 2025 17:03:16 +0000 Received: from dev-dsk-aqibaf-1b-17060f52.eu-west-1.amazon.com (10.253.72.42) by EX19D001UWA001.ant.amazon.com (10.13.138.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.20; Tue, 2 Sep 2025 17:03:14 +0000 From: Aqib Faruqui To: Shuah Khan , Paolo Bonzini , , , CC: , Subject: [PATCH v2 3/7] selftests: kselftest: Add memfd_create syscall compatibility Date: Tue, 2 Sep 2025 17:01:40 +0000 Message-ID: <20250902170147.55583-4-aqibaf@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250902170147.55583-1-aqibaf@amazon.com> References: <20250902170147.55583-1-aqibaf@amazon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: EX19D045UWA003.ant.amazon.com (10.13.139.46) To EX19D001UWA001.ant.amazon.com (10.13.138.214) Content-Type: text/plain; charset="utf-8" The memfd_create function and related MFD_* flags may not be available in non-glibc C libraries. Some selftests use memfd_create for memory backing operations. Add fallback definitions for MFD_CLOEXEC and MFD_HUGETLB flags, and provide a memfd_create wrapper. Signed-off-by: Aqib Faruqui --- tools/testing/selftests/kselftest.h | 19 +++++++++++++++++++ tools/testing/selftests/kvm/lib/kvm_util.c | 1 + 2 files changed, 20 insertions(+) diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/= kselftest.h index c3b6d2604..f362c6766 100644 --- a/tools/testing/selftests/kselftest.h +++ b/tools/testing/selftests/kselftest.h @@ -57,6 +57,7 @@ #include #include #include +#include #endif =20 #ifndef ARRAY_SIZE @@ -80,6 +81,24 @@ #endif #endif /* end arch */ =20 +#ifndef MFD_CLOEXEC +#define MFD_CLOEXEC 0x0001U +#endif + +#ifndef MFD_HUGETLB +#define MFD_HUGETLB 0x0004U +#endif + +static inline int memfd_create(const char *name, unsigned int flags) +{ +#ifdef __NR_memfd_create + return syscall(__NR_memfd_create, name, flags); +#else + errno =3D ENOSYS; + return -1; +#endif +} + /* define kselftest exit codes */ #define KSFT_PASS 0 #define KSFT_FAIL 1 diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/sel= ftests/kvm/lib/kvm_util.c index c3f5142b0..a78b64117 100644 --- a/tools/testing/selftests/kvm/lib/kvm_util.c +++ b/tools/testing/selftests/kvm/lib/kvm_util.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include =20 --=20 2.47.3 From nobody Fri Oct 3 10:11:14 2025 Received: from pdx-out-002.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-002.esa.us-west-2.outbound.mail-perimeter.amazon.com [44.246.1.125]) (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 49F662DE1E3; Tue, 2 Sep 2025 17:03:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=44.246.1.125 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756832631; cv=none; b=tb3Vmu+15jGx6QKoGtQYyANSeVuHLXN/gJZjNfD69jWLfvcVdoTPdcnKVE5ZfuBJ23C9O5O7YRnwO7k5GWisyBfTZ7OBhoBTp95EqoCoG0UN4azzWoTqF7C87ZqtDg593sc2Bo4U8/kvRtKol0QJLLsFjiS1QvjKXDRNc41q50A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756832631; c=relaxed/simple; bh=5xYildeBtV7+wKmq5h/GNncZ59x6c36yXdu5MireVXA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QsljVMcI/U4qLLyGe7Di97shdl3ASLQxGWsijb9jlAOLie3P++W06lOofJIM5L8gOe7/L+ALKsuaxBsWUwuGjyyKiBM4g8YckzXEUcNn0m22ki3Ma0IrDn+ehy5KSHrT6wD9m+e3TenRNBDCjCm/gjim0c5IB3aY+zvZJtpWLV8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.co.uk; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b=Bs4V7bDJ; arc=none smtp.client-ip=44.246.1.125 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.co.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b="Bs4V7bDJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1756832630; x=1788368630; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5flslzb4sgnNMOnM+YuL8Hxh+/X8C4hiTYYv7c42G1Q=; b=Bs4V7bDJufL/xK1p8PmxppMf5djWCEzZ+5NYGPG0CjErY2043an5hcaA XcuK7CMcPmo32l1YYGwXcdmNtHbUnj8+ieEtx4hPXF7PAYcVFC2scXl+E ecxIZdFcYftb+LeXbZN9d3b0TdFbBnvrvLeEXUt631h9HiPRaFAeEZOla /CICNHrI7Y/fE/LhsFqW2I4ADBlqXuKkcZn7KhNVE6CFvABE15WVmx2t1 2bY8LdQeNlq90xYpSGLPeaXIcAZxbizOTwn3X/diG2w/wYcyyuXdXW1fT N+T1EW5IXgWhSXoS415BQ5LXZ1Kb9gkMpoR6XlfApvKL3ate87zvlYZKl g==; X-CSE-ConnectionGUID: HEmmOvOURGiGFeqw7N/Jzw== X-CSE-MsgGUID: kx5pj1avQlC6oZw7G8ScZw== X-IronPort-AV: E=Sophos;i="6.16,202,1744070400"; d="scan'208";a="2232791" Received: from ip-10-5-0-115.us-west-2.compute.internal (HELO smtpout.naws.us-west-2.prod.farcaster.email.amazon.dev) ([10.5.0.115]) by internal-pdx-out-002.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2025 17:03:48 +0000 Received: from EX19MTAUWC002.ant.amazon.com [10.0.7.35:50833] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.36.92:2525] with esmtp (Farcaster) id e3aa4250-a948-4106-93f6-960edee2c2b0; Tue, 2 Sep 2025 17:03:47 +0000 (UTC) X-Farcaster-Flow-ID: e3aa4250-a948-4106-93f6-960edee2c2b0 Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWC002.ant.amazon.com (10.250.64.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.17; Tue, 2 Sep 2025 17:03:47 +0000 Received: from dev-dsk-aqibaf-1b-17060f52.eu-west-1.amazon.com (10.253.72.42) by EX19D001UWA001.ant.amazon.com (10.13.138.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.20; Tue, 2 Sep 2025 17:03:46 +0000 From: Aqib Faruqui To: Paolo Bonzini , Shuah Khan , , , CC: , Subject: [PATCH v2 4/7] KVM: selftests: Add backtrace fallback Date: Tue, 2 Sep 2025 17:01:41 +0000 Message-ID: <20250902170147.55583-5-aqibaf@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250902170147.55583-1-aqibaf@amazon.com> References: <20250902170147.55583-1-aqibaf@amazon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: EX19D037UWC002.ant.amazon.com (10.13.139.250) To EX19D001UWA001.ant.amazon.com (10.13.138.214) Content-Type: text/plain; charset="utf-8" The backtrace() function is a GNU extension available in glibc but may not be present in non-glibc libraries. KVM selftests use backtrace() for error reporting and debugging. Add conditional inclusion of execinfo.h only for glibc builds and provide a weak stub implementation of backtrace() that returns 0 (stack trace empty) for non-glibc systems. Signed-off-by: Aqib Faruqui --- tools/testing/selftests/kvm/lib/assert.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/lib/assert.c b/tools/testing/selft= ests/kvm/lib/assert.c index b49690658..c9778dc6c 100644 --- a/tools/testing/selftests/kvm/lib/assert.c +++ b/tools/testing/selftests/kvm/lib/assert.c @@ -6,11 +6,19 @@ */ #include "test_util.h" =20 -#include #include =20 +#ifdef __GLIBC__ +#include /* backtrace */ +#endif + #include "kselftest.h" =20 +int __attribute__((weak)) backtrace(void **buffer, int size) +{ + return 0; +} + /* Dumps the current stack trace to stderr. */ static void __attribute__((noinline)) test_dump_stack(void); static void test_dump_stack(void) --=20 2.47.3 From nobody Fri Oct 3 10:11:14 2025 Received: from pdx-out-005.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-005.esa.us-west-2.outbound.mail-perimeter.amazon.com [52.13.214.179]) (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 01F712DE1E3; Tue, 2 Sep 2025 17:04:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.13.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756832671; cv=none; b=PPEPlpuKOvSpOkKUYxMLkAtP4e6ykTSr1OOyYCOlNX0n5W2eaByTBsrew3RMETDr7bfo2+nKQ/ILImKiEpX1uP+rd4VKmCRGFVPIK534K8tXLvvbgST3zdsvRrX9/6LbD50fIeRD9ityubcHL3Yykc7WlLjEpCBk4HOlfNGVSrI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756832671; c=relaxed/simple; bh=rU+fLxvTaRy7DwhjNz0lm5qjvvl5TYDWMqyZPyOWOb4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IIt4nRMlwbf4vyRBYqxFdX9mzNkAoRqktAokYIqC+Dek/J1ZBwb+QqOGC0iRqDebF48lk7EMuNZeXPq9HY4aQoiViKRRQNOeGhfKp4V66YZVzpd9Z8VDipPEPDIF+ykHxoz2gOd81MD5B5bNxml/Zv/CarHkrodh0S86r3g58c8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.co.uk; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b=fW11kl93; arc=none smtp.client-ip=52.13.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.co.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b="fW11kl93" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1756832670; x=1788368670; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EbM/0yOz9WDa95qPkBH7SGv+efQUpCt1bttW+4Uxv94=; b=fW11kl93qJgWESeNJCEqV4+iTFiSAuUiePdiKroNHQTANVRsvkKaQ8Ms cxBw8CUlz0DNjFT010/2TbrHw8HWvSwGEd8qQyRzafIL8lRR5U+/9r9+n HhEiN1APNrWPXoVHVvLfJQlkrWFd2prwhE5QQPFp/c0k7eJCVSFwelXma dae6XbvYMcsSU4Hi84kruqvy0sEyckYHnyOIzVVN0U2/z2JggeCrq4Il7 GpSS5lP49uKFVmCpjf3C9lHT6c//klhIcEzDH03B9xvtJvSX8ay77DMTo G8+2Dd1N8tvgJAH8n+f97edYR2OOG/reAq8gcgp491CcHOf105rJlZ5TW w==; X-CSE-ConnectionGUID: 7fU8GG6uQB6+JVmgZOY2iA== X-CSE-MsgGUID: rsTY48ZdRVWSSkQ7KbWwNQ== X-IronPort-AV: E=Sophos;i="6.18,233,1751241600"; d="scan'208";a="2231007" Received: from ip-10-5-9-48.us-west-2.compute.internal (HELO smtpout.naws.us-west-2.prod.farcaster.email.amazon.dev) ([10.5.9.48]) by internal-pdx-out-005.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2025 17:04:27 +0000 Received: from EX19MTAUWB002.ant.amazon.com [10.0.7.35:33529] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.36.92:2525] with esmtp (Farcaster) id 160f2fe7-b49e-4ec3-bfa4-8df325412cf5; Tue, 2 Sep 2025 17:04:27 +0000 (UTC) X-Farcaster-Flow-ID: 160f2fe7-b49e-4ec3-bfa4-8df325412cf5 Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWB002.ant.amazon.com (10.250.64.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.17; Tue, 2 Sep 2025 17:04:27 +0000 Received: from dev-dsk-aqibaf-1b-17060f52.eu-west-1.amazon.com (10.253.72.42) by EX19D001UWA001.ant.amazon.com (10.13.138.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.20; Tue, 2 Sep 2025 17:04:25 +0000 From: Aqib Faruqui To: Mathieu Desnoyers , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Shuah Khan , , CC: , Subject: [PATCH v2 5/7] rseq: selftests: Add non-glibc compatibility fixes Date: Tue, 2 Sep 2025 17:01:42 +0000 Message-ID: <20250902170147.55583-6-aqibaf@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250902170147.55583-1-aqibaf@amazon.com> References: <20250902170147.55583-1-aqibaf@amazon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: EX19D040UWA003.ant.amazon.com (10.13.139.6) To EX19D001UWA001.ant.amazon.com (10.13.138.214) Content-Type: text/plain; charset="utf-8" The rseq selftests rely on features provided by glibc that may not be available in non-glibc C libraries: 1. The __GNU_PREREQ macro and glibc's thread pointer implementation are not available in non-glibc libraries 2. The __NR_rseq syscall number may not be defined in non-glibc headers Add a fallback thread pointer implementation for non-glibc systems using the pre-existing inline assembly to access thread-local storage directly via %fs/%gs registers. Also provide a fallback definition for __NR_rseq when not already defined by the C library headers: 527 for alpha and 293 for other architectures. Signed-off-by: Aqib Faruqui --- .../selftests/rseq/rseq-x86-thread-pointer.h | 14 ++++++++++++++ tools/testing/selftests/rseq/rseq.c | 8 ++++++++ 2 files changed, 22 insertions(+) diff --git a/tools/testing/selftests/rseq/rseq-x86-thread-pointer.h b/tools= /testing/selftests/rseq/rseq-x86-thread-pointer.h index d3133587d..a7c402926 100644 --- a/tools/testing/selftests/rseq/rseq-x86-thread-pointer.h +++ b/tools/testing/selftests/rseq/rseq-x86-thread-pointer.h @@ -14,6 +14,7 @@ extern "C" { #endif =20 +#ifdef __GLIBC__ #if __GNUC_PREREQ (11, 1) static inline void *rseq_thread_pointer(void) { @@ -32,6 +33,19 @@ static inline void *rseq_thread_pointer(void) return __result; } #endif /* !GCC 11 */ +#else +static inline void *rseq_thread_pointer(void) +{ + void *__result; + +# ifdef __x86_64__ + __asm__ ("mov %%fs:0, %0" : "=3Dr" (__result)); +# else + __asm__ ("mov %%gs:0, %0" : "=3Dr" (__result)); +# endif + return __result; +} +#endif /* !__GLIBC__ */ =20 #ifdef __cplusplus } diff --git a/tools/testing/selftests/rseq/rseq.c b/tools/testing/selftests/= rseq/rseq.c index 663a9cef1..1a6f73c98 100644 --- a/tools/testing/selftests/rseq/rseq.c +++ b/tools/testing/selftests/rseq/rseq.c @@ -36,6 +36,14 @@ #include "../kselftest.h" #include "rseq.h" =20 +#ifndef __NR_rseq +#ifdef __alpha__ +#define __NR_rseq 527 +#else +#define __NR_rseq 293 +#endif +#endif + /* * Define weak versions to play nice with binaries that are statically lin= ked * against a libc that doesn't support registering its own rseq. --=20 2.47.3 From nobody Fri Oct 3 10:11:14 2025 Received: from pdx-out-008.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-008.esa.us-west-2.outbound.mail-perimeter.amazon.com [52.42.203.116]) (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 B37592DE1E3; Tue, 2 Sep 2025 17:04:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.42.203.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756832697; cv=none; b=LGDizI5tbtyKKhQAlKgmUBi4D8v6PL9jAPauols3SzH9xFbWZJW4ATZe579Yo55AsbdvFP9ZgTytyxXymHzRvVw/3XwcxVrJj7JYlWlBnC9lAtF1Mn8teTMSG26V+/YGcQ3Gryu0uAt1MML+Noo8pASEP2KCxZLk1meKNf6/lao= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756832697; c=relaxed/simple; bh=hIa5NZU+ptvi1P/zFOZ5CtZWga0YAxQCOdDW4ZvuWO4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uRcgoy6dTYfNqHx1h0Zj6zuc26tMoaTiIlb4Fc19CT11bVBSHG69r2PoeFuOcdRlYEVa3buDFC3xK/XFPrZ1wPp7wNNHqWArRrgrHM04OuHN7Rjxh+2ZSBnEZKeJ2mmO+n4CjHrxPck24ks6QAgxWxHdvVhbvCZ+GYDBTCZRvmU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.co.uk; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b=TGOm3OvV; arc=none smtp.client-ip=52.42.203.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.co.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b="TGOm3OvV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1756832695; x=1788368695; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3YpejAOHmJFdr8XoS0TAI0Co6Y45l6RAHR2x4MxMh/I=; b=TGOm3OvV5LUmFvDDnJUOft3aq5u69jgkjMRaffeIRTgFZ0GH709yNrBH Shf9B5VFC2zrQCCXS0TIRkMUt5vDDezVjVjcdYI21Wu0u2+rPB+AsdUf4 7P7q2G2Nj0cVvL1zSAF5xws1MIYEdyz0UriaD8U4Lkj73vYwMPn0NdmIv BbfXM4jEK9oduI0Fwrvr5qay9DB6flr3BR0JjMxlZ/NUOeyCG2jaVpj99 S+FrKjsztbgFuEUvf4SntllO2Q1H+FyYjl8AbJ8IPYf1kSPnpQbZa1X5J 8BhGqf2LrI2TiVuE29DG7rKqNmE9J5DjiMsM5ZyDpP/Q4Zk0IiIjcgB5p w==; X-CSE-ConnectionGUID: Wm/VFL6HTsqTcrh2RwgdDA== X-CSE-MsgGUID: WADrx+muS0iYVnVMj6Q0iw== X-IronPort-AV: E=Sophos;i="6.18,233,1751241600"; d="scan'208";a="2223440" Received: from ip-10-5-12-219.us-west-2.compute.internal (HELO smtpout.naws.us-west-2.prod.farcaster.email.amazon.dev) ([10.5.12.219]) by internal-pdx-out-008.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2025 17:04:53 +0000 Received: from EX19MTAUWA002.ant.amazon.com [10.0.21.151:40839] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.12.13:2525] with esmtp (Farcaster) id 8df697c8-0fcb-4285-bcae-7ff823771482; Tue, 2 Sep 2025 17:04:53 +0000 (UTC) X-Farcaster-Flow-ID: 8df697c8-0fcb-4285-bcae-7ff823771482 Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWA002.ant.amazon.com (10.250.64.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.17; Tue, 2 Sep 2025 17:04:52 +0000 Received: from dev-dsk-aqibaf-1b-17060f52.eu-west-1.amazon.com (10.253.72.42) by EX19D001UWA001.ant.amazon.com (10.13.138.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.20; Tue, 2 Sep 2025 17:04:51 +0000 From: Aqib Faruqui To: Shuah Khan , , CC: , Subject: [PATCH v2 6/7] selftests: Fix stdbuf compatibility in mixed libc environments Date: Tue, 2 Sep 2025 17:01:43 +0000 Message-ID: <20250902170147.55583-7-aqibaf@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250902170147.55583-1-aqibaf@amazon.com> References: <20250902170147.55583-1-aqibaf@amazon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: EX19D045UWA003.ant.amazon.com (10.13.139.46) To EX19D001UWA001.ant.amazon.com (10.13.138.214) Content-Type: text/plain; charset="utf-8" The original stdbuf use only checked if /usr/bin/stdbuf exists in the host's system but failed to verify compatibility between stdbuf and the target test binary. The issue occurs when: - Host system has glibc-based stdbuf from coreutils - Selftest binaries are compiled with a non-glibc toolchain (cross compilation) The fix adds a runtime compatibility test against the target test binary before enabling stdbuf, enabling cross-compiled selftests to run successfully. Signed-off-by: Aqib Faruqui --- tools/testing/selftests/kselftest/runner.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/kselftest/runner.sh b/tools/testing/se= lftests/kselftest/runner.sh index 2c3c58e65..8d4e33bd5 100644 --- a/tools/testing/selftests/kselftest/runner.sh +++ b/tools/testing/selftests/kselftest/runner.sh @@ -107,7 +107,7 @@ run_one() echo "# Warning: file $TEST is missing!" echo "not ok $test_num $TEST_HDR_MSG" else - if [ -x /usr/bin/stdbuf ]; then + if [ -x /usr/bin/stdbuf ] && [ -x "$TEST" ] && /usr/bin/stdbuf --output= =3DL ldd "$TEST" >/dev/null 2>&1; then stdbuf=3D"/usr/bin/stdbuf --output=3DL " fi eval kselftest_cmd_args=3D"\$${kselftest_cmd_args_ref:-}" --=20 2.47.3 From nobody Fri Oct 3 10:11:14 2025 Received: from pdx-out-014.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-014.esa.us-west-2.outbound.mail-perimeter.amazon.com [35.83.148.184]) (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 E87B32DE1E3; Tue, 2 Sep 2025 17:05:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=35.83.148.184 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756832724; cv=none; b=SSP5CS3aGpVWZ526fE/vdpKNra6b58+j8LeARNsQ8ED/AjD8aGU+hrSI98HAzBznbddQrx7wfqtjt4x0JF22D3zlIxRzQwTGuDaOHOn/FZwGSAt7sxlK93NVcglSyA1wkNJP3cSiU0DmXEzttS5iinF1N6shEY/did6U6edCoLM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756832724; c=relaxed/simple; bh=QobdhLlZNjl3QjlIX3rgbdoxLs2+ODRJC7JZyFR/2jc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=k0CyJzSuftzLEgVwYCQrnwK5UQHLJdCqbYrOSX03ZdGmh8tkcTIYTiIGnMdSPTxpwsdbukpq4rP7V78YvZro33SeigTbylNix+VGE7yX/oBAX+OMcoYeBg7hOiSZ0Z/oE136adlKZHFb18Nkked09KdFxY21TiyYFeVMOuQnbw4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.co.uk; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b=VPVbG860; arc=none smtp.client-ip=35.83.148.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.co.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b="VPVbG860" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1756832722; x=1788368722; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=a5jwovR6cUtAAK5RNs9kUpvz4Sb+WrBMm5wfVaSNJno=; b=VPVbG860vnMmyiCmjLjrOZq87cuNHsrpdiIQhMOJ62X/GB3Dnob42xOe DW3u6J6jI4r5HirDj9vxbQgU9k1+HL2HOI4moLetA9Y1IHE2TJAO+zoEc uOmASGyqQT3zb5TebVUYkvHqgkCUusxPLzQZ1S+m300P+jcCh7G8Mwcud D5s7ckASVQXb+sYWFnVRG1xY0Pj0RAraNWDb3CRbVHdZ0yY53yJWyqhrE gS1gr8UxzSObZ1SIgQf2xISJh978MwUvUeApRtUbTyYZ+A8MkGESqnxQW OtMD9hM3aGztdTBkwaNwXEwjgYLDhNj6/Hdsnt1RY8IBLX1t1DOj2q2qH w==; X-CSE-ConnectionGUID: pnDePsbvSK6OC0I0WSEpxw== X-CSE-MsgGUID: NLYW+MRJTMug8FKYZzA/bQ== X-IronPort-AV: E=Sophos;i="6.16,315,1744070400"; d="scan'208";a="2115095" Received: from ip-10-5-6-203.us-west-2.compute.internal (HELO smtpout.naws.us-west-2.prod.farcaster.email.amazon.dev) ([10.5.6.203]) by internal-pdx-out-014.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2025 17:05:20 +0000 Received: from EX19MTAUWC002.ant.amazon.com [10.0.21.151:28339] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.52.56:2525] with esmtp (Farcaster) id 9c41e06e-3703-4d71-a932-d8327fe12c9c; Tue, 2 Sep 2025 17:05:20 +0000 (UTC) X-Farcaster-Flow-ID: 9c41e06e-3703-4d71-a932-d8327fe12c9c Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWC002.ant.amazon.com (10.250.64.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.17; Tue, 2 Sep 2025 17:05:18 +0000 Received: from dev-dsk-aqibaf-1b-17060f52.eu-west-1.amazon.com (10.253.72.42) by EX19D001UWA001.ant.amazon.com (10.13.138.214) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.20; Tue, 2 Sep 2025 17:05:17 +0000 From: Aqib Faruqui To: Shuah Khan , , CC: , Subject: [PATCH v2 7/7] selftests: kselftest: Add ulong typedef for non-glibc compatibility Date: Tue, 2 Sep 2025 17:01:44 +0000 Message-ID: <20250902170147.55583-8-aqibaf@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250902170147.55583-1-aqibaf@amazon.com> References: <20250902170147.55583-1-aqibaf@amazon.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: EX19D043UWA004.ant.amazon.com (10.13.139.41) To EX19D001UWA001.ant.amazon.com (10.13.138.214) Content-Type: text/plain; charset="utf-8" Some C libraries may not define the ulong typedef that is commonly available as a BSD/GNU extension. Add a fallback typedef to ensure ulong is available across all selftest environments. Signed-off-by: Aqib Faruqui --- tools/testing/selftests/kselftest.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/testing/selftests/kselftest.h b/tools/testing/selftests/= kselftest.h index f362c6766..a1088a2af 100644 --- a/tools/testing/selftests/kselftest.h +++ b/tools/testing/selftests/kselftest.h @@ -58,6 +58,11 @@ #include #include #include +#include +#endif + +#ifndef ulong +typedef unsigned long ulong; #endif =20 #ifndef ARRAY_SIZE --=20 2.47.3