From nobody Fri Oct 3 14:29:31 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 6C1BB29E110; Fri, 29 Aug 2025 14:26:44 +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=1756477605; cv=none; b=G8LgcvoejVg1cKcTev3qMbt1BGsN0CIgXwkn0RN1r+3rzBdSreiinW9My+WDOajkhEyiAT1L3xpVGCd4VLVFUxmFan/ckXxUwEGd5+P3D+BHNjCRct6ShlC5qPzP1upl2oISznVo/0yvcVGnNlvw7A9LvxO9WWv7fDNTvjP3B+s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756477605; c=relaxed/simple; bh=iFPU0HmO64vVywW5BVEcQ20yR+WVfRKLA5xXSYp/Y7o=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=o/NyWw/7OcVtNaAi/BQdMgD1KE8SCdX7teBsP2mbJbX2ACRPIg3bFVAnr0qcKkWCJ1oGYMiHTXJF/vbDf1osVXANU2SeN3WaXW1y1w12JMymdHcu4eXTKW9iuv9mLY+BTLQaa4CzNpZz6YU2ISnOhzgY3MOy0/Ws7n6j0fEIDag= 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=KFEz5sdJ; 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="KFEz5sdJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1756477604; x=1788013604; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CBcd3l86glEqKVjmRZ8g6niN7tm/UMtN3UNtLRqWzXY=; b=KFEz5sdJEa7PQUXuWz2zWaFwERuUfIZrbFV4V0Tkhz+jwXmj1TIqrOqN LgMnFreuuyYXt1gU3lTRZ1q+jnhGaDllhpU3rucj44bzYQiMh/w5a0jWP A/H9rlJ8qLRAQFI/qu8t4Uuvyj0pCJcdxaPE/ZKS4CvFEmU2hKih8CEpj PSEw1ymUZ8fqkGViGkeetLnBbbFWeoB4G9gmwU3Qz6Q3zdhNsMbnI6KnR Ds2Q95gabeZKdT7L/ksOXfnKrLXz4uDovVhqfr1hOGNBsS5dgAyIZf5st OOzHN2XrUCWipLQJFKm914g36vCGnsr5APJuwmki9xptXNOn6R6Eqc5x6 g==; X-CSE-ConnectionGUID: 2V+5NFmxR/iXTWkiV0aEew== X-CSE-MsgGUID: nxv9gPoFRfG9BQkjyld3Ag== X-IronPort-AV: E=Sophos;i="6.18,221,1751241600"; d="scan'208";a="1927367" 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; 29 Aug 2025 14:26:42 +0000 Received: from EX19MTAUWC002.ant.amazon.com [10.0.38.20:4630] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.41.88:2525] with esmtp (Farcaster) id 6e300a94-20ab-4b89-9a75-b45e32f23903; Fri, 29 Aug 2025 14:26:42 +0000 (UTC) X-Farcaster-Flow-ID: 6e300a94-20ab-4b89-9a75-b45e32f23903 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; Fri, 29 Aug 2025 14:26:42 +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.17; Fri, 29 Aug 2025 14:26:40 +0000 From: Aqib Faruqui To: Kees Cook , Andy Lutomirski , "Will Drewry" , Shuah Khan , Christian Brauner , , CC: , Subject: [PATCH 1/9] KVM: selftests: Add pidfd_open syscall number fallback Date: Fri, 29 Aug 2025 14:25:45 +0000 Message-ID: <20250829142556.72577-2-aqibaf@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250829142556.72577-1-aqibaf@amazon.com> References: <20250829142556.72577-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: EX19D033UWC003.ant.amazon.com (10.13.139.217) 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 non-glibc C library headers may not define this syscall number. Add architecture-specific fallback definitions to pidfd.h, including support for Alpha (544) and other architectures (434). Update kselftest_harness.h to include pidfd.h for the syscall definitions. Signed-off-by: Aqib Faruqui --- tools/testing/selftests/kselftest_harness.h | 1 + tools/testing/selftests/pidfd/pidfd.h | 4 ++++ 2 files changed, 5 insertions(+) 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 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 14:29:31 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 79C7A32039E; Fri, 29 Aug 2025 14:27:08 +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=1756477629; cv=none; b=sVM+DDylAoHVv4en8evrQ2+XEcaSuEszamnJgiP+B8hPSqO9p1oT8H1q2aGTKKOmNj8TBcqeSslbtYMxlgYi+b2XYeG8UoENIsnu6cXtw0mT8bOCVJzaKEG+BdSYs5RgWdjrwRD9LdAdUGTtz2L5RwL9ntz6zQY66Ci0ZXr6q0I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756477629; c=relaxed/simple; bh=45c7aOoMugCT34BB86u6Wsrfo0KiaPUsDD2kYQQm1co=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MnkVU8XM858tBMtikZTJOfkGgpIiRLyHNyKb13Y3zNmzJo4rDCtHCAWx35u44rQyjJknkZWMMdxwlrItup5rrPKOpwJyr8pwlSXVmRCX7C5jmnLn4qEkyVS+1HC/ueeW/Fnmb9iFZrJpnOTXrG8gkWziT59Ty6h66TwN73l7Ps8= 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=Kgrp4vLi; 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="Kgrp4vLi" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1756477628; x=1788013628; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7ppU9t0QbYKZe/Oy8B/CUwnA5uXwTdR2UElV1XQQFH8=; b=Kgrp4vLiyDZOuT2z8RiLMJbC9pGvWrgq09MxWUpUGTlo4R1t6NR6//vJ emXI0NbXm2gzO/FIn5kb5mkFXVeLk2u6+T/G4vyRHJ8OL9xBnB739DvLJ hfcPOsySNYj4U8X5f+sH6vjw43UA1oxFWJS3znjPK9sBtSrr2NO8BQvxr ADrtQsSR/PAUryFFJfn6iE047YunjxodkdN4HDuitfV28bGcnW4XkR7cr Y5IeeBT3dt9158Lhf5idLV31uWEktAmY9bZeglgTptAhT6LwyVbvVo59i nDwUW6jPvzPpMeLOtpKm4fhZOxZRslQ9juPaUCfuzNlmfnYqbKTO3Grn/ A==; X-CSE-ConnectionGUID: Ful/5iCGRky6vhMWZjZI+w== X-CSE-MsgGUID: 5fSx+Yr4TyW/V7Oeu935CA== X-IronPort-AV: E=Sophos;i="6.18,221,1751241600"; d="scan'208";a="2035837" 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-008.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2025 14:27:06 +0000 Received: from EX19MTAUWA001.ant.amazon.com [10.0.21.151:35672] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.52.56:2525] with esmtp (Farcaster) id f2839b29-c636-47d2-8770-4aedfb1e295b; Fri, 29 Aug 2025 14:27:06 +0000 (UTC) X-Farcaster-Flow-ID: f2839b29-c636-47d2-8770-4aedfb1e295b Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWA001.ant.amazon.com (10.250.64.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.17; Fri, 29 Aug 2025 14:27:06 +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.17; Fri, 29 Aug 2025 14:27:04 +0000 From: Aqib Faruqui To: Paolo Bonzini , Shuah Khan , , , CC: , Subject: [PATCH 2/9] KVM: selftests: Add __packed attribute fallback Date: Fri, 29 Aug 2025 14:25:46 +0000 Message-ID: <20250829142556.72577-3-aqibaf@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250829142556.72577-1-aqibaf@amazon.com> References: <20250829142556.72577-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: EX19D045UWA004.ant.amazon.com (10.13.139.91) To EX19D001UWA001.ant.amazon.com (10.13.138.214) Content-Type: text/plain; charset="utf-8" Kernel UAPI headers use __packed but don't provide the definition in userspace builds. Add a fallback definition matching the kernel's implementation. This follows the same pattern used by BPF and SGX selftests. Signed-off-by: Aqib Faruqui --- tools/testing/selftests/kvm/include/kvm_util.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing= /selftests/kvm/include/kvm_util.h index 23a506d7e..7fae7f5e7 100644 --- a/tools/testing/selftests/kvm/include/kvm_util.h +++ b/tools/testing/selftests/kvm/include/kvm_util.h @@ -5,6 +5,10 @@ #ifndef SELFTEST_KVM_UTIL_H #define SELFTEST_KVM_UTIL_H =20 +#ifndef __packed +#define __packed __attribute__((__packed__)) +#endif + #include "test_util.h" =20 #include --=20 2.47.3 From nobody Fri Oct 3 14:29:31 2025 Received: from pdx-out-011.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-011.esa.us-west-2.outbound.mail-perimeter.amazon.com [52.35.192.45]) (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 2FAAE321444; Fri, 29 Aug 2025 14:27:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.35.192.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756477656; cv=none; b=nri02Tgzj5zG3RGJhbI/kKMOHmOC6UBuEg6ilPyEUF5MD56OqlVZZipWDychx5e5K/LhemKv0hynFigg4cAhAi1SQ7MK6RX46MoNx/BvhWVeblVnj8c1Tm4aQhjHYkkELn69oY7//xJD3rwjtK5sF3rfWLbHHmBPcTSP0bJwPZc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756477656; c=relaxed/simple; bh=y9gL/UGvJfVzOPZZ/KT87SlBY/VScKVrmeHHSQs3I3A=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QN2MnReAbpLCXn2eDpr4a2n4o2yTIaNV7422TdOGEPwlbKCQzf79aTdQG6gZzBoqvaqLU2lM6sh6YQt4yqr2yJ8Kuy1iWi6b0tPoY301B8HLOpZWrx53q2T7NiH/mC6uV8PkC0vTQi6NqW44K/KcnlGpIl28szb85N90oL3mrY8= 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=doxBPOWs; arc=none smtp.client-ip=52.35.192.45 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="doxBPOWs" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1756477655; x=1788013655; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0qBLhzlQ0K0cOHPaZz1B5AlYgKIDArcMpwFYu5ZedWI=; b=doxBPOWsHv2LsvnnUwlAwK6cJE9had0cfgnvi5uHH0wc1LuPYkbAXaLU VgwrSt7A/S8H9mHPWPvgANdOLb5jlhktrIu6qgDun9OX0wm5n/zjsjKI+ cJSI6TWQEy7elvW1LDN2WlSWrISNxb8fNS4quZ1KxevaZmlrbDhVWRjON W28prRbxxuDOOYw272mG0J+d6FLRgwMIHxrO+2JFR9NRFSUqzuGwprEzT iIU5O4IuMEHgaFXc9k919+LCuS5YhdY7uIUpDcFPXKzTi4BwI5qp/6qqs hwmdeySj06Fz3INP3gqqaYV1ywt0hMHylfQgPLI9SLrGhGXuXdL6yoC2N A==; X-CSE-ConnectionGUID: 5sLIGh9OT4CF7z/7qI9oNA== X-CSE-MsgGUID: vGYmQyhZRmCdw21oRGSVWw== X-IronPort-AV: E=Sophos;i="6.18,221,1751241600"; d="scan'208";a="1927937" 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-011.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2025 14:27:33 +0000 Received: from EX19MTAUWC001.ant.amazon.com [10.0.38.20:52600] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.52.56:2525] with esmtp (Farcaster) id 9bde94d1-7135-4966-972f-6c1896eb93bc; Fri, 29 Aug 2025 14:27:32 +0000 (UTC) X-Farcaster-Flow-ID: 9bde94d1-7135-4966-972f-6c1896eb93bc 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; Fri, 29 Aug 2025 14:27:32 +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.17; Fri, 29 Aug 2025 14:27:31 +0000 From: Aqib Faruqui To: Paolo Bonzini , Shuah Khan , , , CC: , Subject: [PATCH 3/9] KVM: selftests: Add pthread_attr_setaffinity_np fallback Date: Fri, 29 Aug 2025 14:25:47 +0000 Message-ID: <20250829142556.72577-4-aqibaf@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250829142556.72577-1-aqibaf@amazon.com> References: <20250829142556.72577-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: EX19D039UWA001.ant.amazon.com (10.13.139.110) To EX19D001UWA001.ant.amazon.com (10.13.138.214) Content-Type: text/plain; charset="utf-8" The pthread_attr_setaffinity_np function is a GNU extension that may not be available in non-glibc C libraries. Some KVM selftests use this function for CPU affinity control. Add a function declaration and weak stub implementation for non-glibc builds. This allows tests to build, with the affinity setting being a no-op and errno set for the caller when the actual function is not availabl= e. Signed-off-by: Aqib Faruqui Reported-by: Aqib Faruqui --- tools/testing/selftests/kvm/include/kvm_util.h | 4 ++++ tools/testing/selftests/kvm/lib/kvm_util.c | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/tools/testing/selftests/kvm/include/kvm_util.h b/tools/testing= /selftests/kvm/include/kvm_util.h index 7fae7f5e7..8177178b5 100644 --- a/tools/testing/selftests/kvm/include/kvm_util.h +++ b/tools/testing/selftests/kvm/include/kvm_util.h @@ -31,6 +31,10 @@ #include "kvm_util_types.h" #include "sparsebit.h" =20 +#ifndef __GLIBC__ +int pthread_attr_setaffinity_np(pthread_attr_t *attr, size_t cpusetsize, c= onst cpu_set_t *cpuset); +#endif /* __GLIBC__ */ + #define KVM_DEV_PATH "/dev/kvm" #define KVM_MAX_VCPUS 512 =20 diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/sel= ftests/kvm/lib/kvm_util.c index c3f5142b0..5ce80303d 100644 --- a/tools/testing/selftests/kvm/lib/kvm_util.c +++ b/tools/testing/selftests/kvm/lib/kvm_util.c @@ -20,6 +20,17 @@ =20 #define KVM_UTIL_MIN_PFN 2 =20 +#ifndef __GLIBC__ +int __attribute__((weak)) +pthread_attr_setaffinity_np(pthread_attr_t *__attr, + size_t __cpusetsize, + const cpu_set_t *__cpuset) +{ + errno =3D ENOSYS; + return -1; +} +#endif + uint32_t guest_random_seed; struct guest_random_state guest_rng; static uint32_t last_guest_seed; --=20 2.47.3 From nobody Fri Oct 3 14:29:31 2025 Received: from pdx-out-001.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-001.esa.us-west-2.outbound.mail-perimeter.amazon.com [44.245.243.92]) (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 A951729E110; Fri, 29 Aug 2025 14:28:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=44.245.243.92 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756477682; cv=none; b=NRF6y0I06tWrSw1n8ZM4qq6gU+9DoUg63ClaybHHBeX6uwQDsNCR6Es97q3BB/I46ycfe5Ydxd2a2ajbGhw03JlEpGSpYahVPqSHmuwjF8XMa2D/UJedf/H5PNkifYRZzZBU15ld9q/7gg8N7XNleooJlSEkE3bQmiI4rkCyDn0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756477682; c=relaxed/simple; bh=aSGoFnFQ0ZBKPYFtEyjLzr+DV+s1lmNOa+QCBhXKlPw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gOkNisZkMRcpdwCVQi7ND0pPa+Zewc9/USrJwquIFrp1CCVip749CYxRb/Q5Tam09hBdd7ZR8aEvm+1KNFz6CGRMAslOTx0YE2XGwh3GHML5mJTmqYsckt9XNxyKll5DzQ1x4l37v+x4rmiG3ipaUfk4VHNffooekaX/Z23Xnzk= 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=EgQ+8Ff6; arc=none smtp.client-ip=44.245.243.92 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="EgQ+8Ff6" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1756477680; x=1788013680; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SrDvul6Y20T+lfkQmfSur3fHwO9mehvp95HPlsLgOXw=; b=EgQ+8Ff6sJh3jvxW3n++VJGJGdjIThGUs7R2SoWy/IzcYn9Vnv9zWOrn z+Zjq0mM2pKEgosT0d/Iop9vG0nK63C5N0of+CYQLMFdDPZtecirGm05j sYHYoFtg46NEqxavI+SN3clu4O9Ebz9Q1ZgBmKKCsU5QvxaZOX1aqDQha g3qKoj9m9nkiIYd/q0Q1dAIVeQr3ycAL4iD/Y8O3AELSQuQk49R5kJ4hc +llVG4cXY4gNxdyKEGnZLq7kHuRVCd5I6AjWM+gaXBvhAW+I0+jiSBQZY fiz8mD4b9xCW/3rBjIDavWy2bYo3NWOSiK/leRIyJYhpVuITJLZNg6XPv Q==; X-CSE-ConnectionGUID: OUUng9rLR2Cp84oeRZ08Bw== X-CSE-MsgGUID: yFjXuJCnRW+ZGIiu7kQrxA== X-IronPort-AV: E=Sophos;i="6.18,221,1751241600"; d="scan'208";a="2045020" 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-001.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2025 14:27:58 +0000 Received: from EX19MTAUWB002.ant.amazon.com [10.0.38.20:52512] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.41.88:2525] with esmtp (Farcaster) id 0eb3ccb2-a05f-4e8e-8737-06363af62346; Fri, 29 Aug 2025 14:27:58 +0000 (UTC) X-Farcaster-Flow-ID: 0eb3ccb2-a05f-4e8e-8737-06363af62346 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; Fri, 29 Aug 2025 14:27:57 +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.17; Fri, 29 Aug 2025 14:27:55 +0000 From: Aqib Faruqui To: Shuah Khan , Paolo Bonzini , , , CC: , Subject: [PATCH 4/9] selftests: kselftest: Add memfd_create syscall compatibility Date: Fri, 29 Aug 2025 14:25:48 +0000 Message-ID: <20250829142556.72577-5-aqibaf@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250829142556.72577-1-aqibaf@amazon.com> References: <20250829142556.72577-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: EX19D042UWA002.ant.amazon.com (10.13.139.17) 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 5ce80303d..cb5209f6a 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 14:29:31 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 E0B933218B4; Fri, 29 Aug 2025 14:28:26 +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=1756477708; cv=none; b=CAXDeOxnpwJtton9Zb7hUI379OE9+cifT6dTthLlr19IiXPNtVpO6DZMCE9guvpOaJH5R6eppR9VZlDGx8ma2ECl7OoTKtb055SBLChN18UWSVE+lAZNy3L8ElKpTpbSD8LuhNAuqk3hbk5EdYjKaRnBAZKYMmXYJDYh17JbIV4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756477708; c=relaxed/simple; bh=jQoNODhJkntIRL8QQO/nmH1rbHykg6p69ISU6D3zjdA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZgUaQT3014v703RY/qlsAaIrXupCeZz9Sq5nW4SHNXvUjGSvaBdDslHVE2k1T80w3VkjqNmMrQnnlhcelT24qw4qZyRVT5/WvEHvpzryypMZ2IYc3G/l5EotfsYiGw6YjZA3PJQsclB8qevdFZBrJtYGg6VMy9uNgopWBNCofw0= 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=QAP8O/gg; 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="QAP8O/gg" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1756477706; x=1788013706; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=V3eFOFcJHvRJU2jEADvRr3ffSJ58rGA/QlP6MbKkTJw=; b=QAP8O/ggTRFwOCAuXasK5A68OpfQsUnvv4UzF5StYbbivOj2NYFrzAhg i4wSP36V6sLvTnv/dngpkffxF9/MbTyvioGYUUXHsu6epOmTgg4DxoxLj bumCUHbSddIRQ95uy9WZNnyiLiOD0RFxV76pm8VQOnI22eRYL6RBstSGr O0/vzz7vB9xOz7MnFq9+C8u+kLSXqdKdT9dRnox1lE/5VT5/zYZF98q/3 wxky4536JvOstxH/1kYrxvZSfeeArciCvY4IFtrxI4PUq2x/1dQSbnb/C AWrUcE0ch3qglYNi6s8xwfgHgUHLql25g3vgf7G8aPk1ur+BWdJ4P0Rxk g==; X-CSE-ConnectionGUID: 6Ojez+tbTFeoeJQCgKeFjg== X-CSE-MsgGUID: bdcNVm+pRsybDUWrs+g03Q== X-IronPort-AV: E=Sophos;i="6.18,221,1751241600"; d="scan'208";a="1927464" 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-009.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2025 14:28:26 +0000 Received: from EX19MTAUWB001.ant.amazon.com [10.0.38.20:42649] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.10.144:2525] with esmtp (Farcaster) id 0ede2df0-7149-4e4c-82c6-2b74806a27fc; Fri, 29 Aug 2025 14:28:26 +0000 (UTC) X-Farcaster-Flow-ID: 0ede2df0-7149-4e4c-82c6-2b74806a27fc Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWB001.ant.amazon.com (10.250.64.248) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.17; Fri, 29 Aug 2025 14:28:26 +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.17; Fri, 29 Aug 2025 14:28:24 +0000 From: Aqib Faruqui To: Sean Christopherson , Paolo Bonzini , Shuah Khan , , , CC: , Subject: [PATCH 5/9] KVM: selftests: Prevent PAGE_SIZE redefinition on x86 Date: Fri, 29 Aug 2025 14:25:49 +0000 Message-ID: <20250829142556.72577-6-aqibaf@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250829142556.72577-1-aqibaf@amazon.com> References: <20250829142556.72577-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: EX19D039UWA004.ant.amazon.com (10.13.139.68) To EX19D001UWA001.ant.amazon.com (10.13.138.214) Content-Type: text/plain; charset="utf-8" Prevent PAGE_SIZE redefinition warnings that can occur due to namespace pollution from included headers. Add an #ifndef directive before defining PAGE_SIZE to avoid redefinition conflicts. Signed-off-by: Aqib Faruqui --- tools/testing/selftests/kvm/include/x86/processor.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/kvm/include/x86/processor.h b/tools/te= sting/selftests/kvm/include/x86/processor.h index 2efb05c2f..3f93d1b4f 100644 --- a/tools/testing/selftests/kvm/include/x86/processor.h +++ b/tools/testing/selftests/kvm/include/x86/processor.h @@ -368,7 +368,9 @@ static inline unsigned int x86_model(unsigned int eax) #define PHYSICAL_PAGE_MASK GENMASK_ULL(51, 12) =20 #define PAGE_SHIFT 12 +#ifndef PAGE_SIZE #define PAGE_SIZE (1ULL << PAGE_SHIFT) +#endif #define PAGE_MASK (~(PAGE_SIZE-1) & PHYSICAL_PAGE_MASK) =20 #define HUGEPAGE_SHIFT(x) (PAGE_SHIFT + (((x) - 1) * 9)) --=20 2.47.3 From nobody Fri Oct 3 14:29:31 2025 Received: from pdx-out-001.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-001.esa.us-west-2.outbound.mail-perimeter.amazon.com [44.245.243.92]) (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 57B7B320398; Fri, 29 Aug 2025 14:28:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=44.245.243.92 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756477733; cv=none; b=BBSDgm4LIUXqh71CVcgco/kP6+TvXpCWc0Co9D72co5yDKSnYLETnWYzPWl2sRKeEzGvBqqhvzWbFop3FLHh3Tw1TC4DuEPxUl4WcwQMDy/bYyfzc+opqAumTmF2g3281l1yR8ulncq9ay9Ylmni4zMPFp+CeFT0To2Tmos2jII= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756477733; c=relaxed/simple; bh=5xYildeBtV7+wKmq5h/GNncZ59x6c36yXdu5MireVXA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Y4hljnZnBEAKTMCyxVMQkFASiILkDKDQ42ZEyZt2T1DDIBCEkNzq3cKRfC97C4zpJlLw/1WU5jF25cjcwSmB0px2QC1w3ohSOMvRkJQwa6eo/Pdrbximdta7YQuR/xaNMugyXJrj/8Nvw0c7C79fm5G3OlF/HPKJUrVg2kns4WM= 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=YZnJpRC5; arc=none smtp.client-ip=44.245.243.92 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="YZnJpRC5" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1756477732; x=1788013732; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5flslzb4sgnNMOnM+YuL8Hxh+/X8C4hiTYYv7c42G1Q=; b=YZnJpRC5f9QYfZ7PAWASqgaf87d9h1ELHA5Ln1iYi2qRHAzKVfl+dJzy OEFmTv/54VrUQspJ2DNpEDX/uN/U4nEchIqAg8dUWtKdWiRiWYF8C9jsh 4iH5C+5dxBEsuGtZI3VZRxcp2IQZKDbpXxxsYsyT5dW5tFXyAA91fhpEm q7S7EA6seuiVDZ4BFhmwg8BlqBvddrX8p0f4zuuvLMzbkXTpMwvcl+l+K 7oiND7SkkmAB0gTBO3w0hOHKDkvv5WjyHc8BXknQDw4cDX7iN4gIIwHXP 7Eql14ciBFdEr1xZ9iJPoMhS6S53mwvP5DhTh5r6RwRQg7zN6icOUPfk2 w==; X-CSE-ConnectionGUID: Rk/n2u2GS96YwiZFNeWTCg== X-CSE-MsgGUID: /8jYBUzfSYOUof5FbHkazA== X-IronPort-AV: E=Sophos;i="6.18,221,1751241600"; d="scan'208";a="2045051" 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-001.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2025 14:28:52 +0000 Received: from EX19MTAUWC002.ant.amazon.com [10.0.38.20:29827] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.36.92:2525] with esmtp (Farcaster) id 8dceb162-eff9-4e34-951c-c2310264cc4d; Fri, 29 Aug 2025 14:28:51 +0000 (UTC) X-Farcaster-Flow-ID: 8dceb162-eff9-4e34-951c-c2310264cc4d 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; Fri, 29 Aug 2025 14:28:51 +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.17; Fri, 29 Aug 2025 14:28:50 +0000 From: Aqib Faruqui To: Paolo Bonzini , Shuah Khan , , , CC: , Subject: [PATCH 6/9] KVM: selftests: Add backtrace fallback Date: Fri, 29 Aug 2025 14:25:50 +0000 Message-ID: <20250829142556.72577-7-aqibaf@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250829142556.72577-1-aqibaf@amazon.com> References: <20250829142556.72577-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: EX19D039UWA003.ant.amazon.com (10.13.139.49) 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 14:29:31 2025 Received: from pdx-out-013.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-013.esa.us-west-2.outbound.mail-perimeter.amazon.com [34.218.115.239]) (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 D55B0321445; Fri, 29 Aug 2025 14:29:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=34.218.115.239 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756477761; cv=none; b=UB+Z9UosjaVLhY2wW3nA3kjl/yUf58vJdIthC1pvAHpqBPPE0ZSx17TwxEpC00juD5KInU6YzppU5y1ytBylvJ7ZpSXHveCXrfrW0qePc7K9XqZt+hPGTNFHo/zu6D/6qFTUh8uAq/I/MjW01c1pX8AvXh8IPwzN6xZzEmFaR4o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756477761; c=relaxed/simple; bh=rU+fLxvTaRy7DwhjNz0lm5qjvvl5TYDWMqyZPyOWOb4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HGcbOmLV0Pyq38Mp6kDXCvaPT1vDLjTeJwU4f3Ica7ZdNFMRqPNAsnnswo26HwLHO5O8+aZ+wgu8PUax2NkSNnXxzEU2etH/domRRDpDwDfxfkev0wl9SrymK9hVzr7LXsSk2eFhUU3YDUv9Y0hhr+RhZknxKzNmrwe+c+IHy4s= 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=lVzyKy0h; arc=none smtp.client-ip=34.218.115.239 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="lVzyKy0h" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1756477759; x=1788013759; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EbM/0yOz9WDa95qPkBH7SGv+efQUpCt1bttW+4Uxv94=; b=lVzyKy0h+jqadhAhFYOYSNKQJP4P7vv/Zz6WqR7+iNqWVCXSAA+eIOMI jxC8xRmF7oUGTClWytykawxqPcqff4OZhmjyU1D/wO+uoKgUADOcD5SNV 5bQlJmuemz6JtVmbuCKJr0NItjkAaZpfHdOZKUWU+u5UslfiNGqhjn89J B1IO4ORaXF8VOHe9X9X7PBOGaUWraldhWKFwwsm6Tjk2BvjbvFgresv/w X85o7UC88TrcxiKcUhaSVIg5xVEYo1RGPRQ57+OOa+PPfm+UsRLFBoQeN eOL4nXQkrnjKMPlKIxVDmgKrDpWDzFUKBUOiLcpcrOJUOYBrgQ9+xAR/9 Q==; X-CSE-ConnectionGUID: B+2KgsF+SHyihENIf4zlVg== X-CSE-MsgGUID: m/x/hPVCRkCAVvHYEpnxaw== X-IronPort-AV: E=Sophos;i="6.18,221,1751241600"; d="scan'208";a="1925993" 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-013.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2025 14:29:17 +0000 Received: from EX19MTAUWA001.ant.amazon.com [10.0.21.151:63410] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.12.13:2525] with esmtp (Farcaster) id 947a7021-b2bf-4d75-9263-73008060534f; Fri, 29 Aug 2025 14:29:17 +0000 (UTC) X-Farcaster-Flow-ID: 947a7021-b2bf-4d75-9263-73008060534f Received: from EX19D001UWA001.ant.amazon.com (10.13.138.214) by EX19MTAUWA001.ant.amazon.com (10.250.64.204) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.17; Fri, 29 Aug 2025 14:29:17 +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.17; Fri, 29 Aug 2025 14:29:15 +0000 From: Aqib Faruqui To: Mathieu Desnoyers , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Shuah Khan , , CC: , Subject: [PATCH 7/9] rseq: selftests: Add non-glibc compatibility fixes Date: Fri, 29 Aug 2025 14:25:51 +0000 Message-ID: <20250829142556.72577-8-aqibaf@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250829142556.72577-1-aqibaf@amazon.com> References: <20250829142556.72577-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: EX19D041UWB002.ant.amazon.com (10.13.139.179) 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 14:29:31 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 6EAF7321F29; Fri, 29 Aug 2025 14:30:00 +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=1756477802; cv=none; b=gNu+3mAboadHyD9ZVo2oxs0/OP577YgP8bCtt0ICHmVh3dGXfCTFEv4CnZtkQ2S2L/Dyx4vWx5VFD9ILCXzUbdskL4SNJY4JoPaacSz2CaTLQYSoTU9XfunTmVn53Mv176DWfgq52qsWzDGOFrJcBdnmV9PXLsM5BIOdyfJVLyE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756477802; c=relaxed/simple; bh=hIa5NZU+ptvi1P/zFOZ5CtZWga0YAxQCOdDW4ZvuWO4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uZSXBuidVrGBKoU0FavPIcnIOYmX0Ecxj3Rbr6kdu+gxBHPDszJ+aS/zPWU1Vkt6oIAOW/GBGpLqzGiOlsWbbln+yMxCXM6vJ4eOnObKhZliwom3wJR6CBuptMHLAVdQHDiE5SkR4iA5r+axZIU2JOFe3ywdsSiqY94u5zzu4r4= 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=G8BDKPZG; 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="G8BDKPZG" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1756477800; x=1788013800; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3YpejAOHmJFdr8XoS0TAI0Co6Y45l6RAHR2x4MxMh/I=; b=G8BDKPZGvlWaZQVoipod7n4Sn94VXe40C40Egj0lF24PM5iELVJBaZTy T/0ZD1qJA1fp5l/yUVedyoglaORlHH1xBByzcQRKucC4LOJlspBnbyFD4 6npEjB0z6bUJHMDEcOu43bXTyZpwGXkRH74JedzBkrCn8Pexp2UX/bG0/ 625ai9uJk2XZ7BIMmgkFx3SiYlJN/WL8D94mjJlJWbnxQNMntqQkT3kAK cBiJRzfBfNp4KC9uqnyVTyJHAIuO3F1NYhpgYWHGGQMOYNh/N7Nfy8anj vzcBNwGaQsv3xciBEI/QDQxADLJ8l5ea5l/CmSBGDlL7s1SH3sgcO23NR w==; X-CSE-ConnectionGUID: mq27f3lJQ8WLYYMX6qKNVA== X-CSE-MsgGUID: bgOTxQIKQvu1exEDLV/O/A== X-IronPort-AV: E=Sophos;i="6.18,221,1751241600"; d="scan'208";a="1928860" 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-010.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2025 14:29:58 +0000 Received: from EX19MTAUWC001.ant.amazon.com [10.0.21.151:44908] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.12.13:2525] with esmtp (Farcaster) id 0269af9e-eb85-4812-8c6a-36db19f62e05; Fri, 29 Aug 2025 14:29:58 +0000 (UTC) X-Farcaster-Flow-ID: 0269af9e-eb85-4812-8c6a-36db19f62e05 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; Fri, 29 Aug 2025 14:29:57 +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.17; Fri, 29 Aug 2025 14:29:56 +0000 From: Aqib Faruqui To: Shuah Khan , , CC: , Subject: [PATCH 8/9] selftests: Fix stdbuf compatibility in mixed libc environments Date: Fri, 29 Aug 2025 14:25:52 +0000 Message-ID: <20250829142556.72577-9-aqibaf@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250829142556.72577-1-aqibaf@amazon.com> References: <20250829142556.72577-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: EX19D041UWB001.ant.amazon.com (10.13.139.132) 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 14:29:31 2025 Received: from pdx-out-015.esa.us-west-2.outbound.mail-perimeter.amazon.com (pdx-out-015.esa.us-west-2.outbound.mail-perimeter.amazon.com [50.112.246.219]) (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 51F1E1E2823; Fri, 29 Aug 2025 14:30:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=50.112.246.219 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756477834; cv=none; b=dXahI3mfF9T3Tios/D3dJ0OXLbEglHLTeyzaELDitpYdgDnGyzPxG5bowFoRbuLAZ6hcKK7tBu07gUFiQVVt8P+VXxQLBy8GL4BjqIJY4ek8np3ahwfuDCsxVJz9u7oJwn13sAdJNErW+oiljWPB27gahzxERbtKEUeBV+NMC3o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756477834; c=relaxed/simple; bh=QobdhLlZNjl3QjlIX3rgbdoxLs2+ODRJC7JZyFR/2jc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZNlneTmL3OQsWsPfa70zXagdXHlQM/GMLkwoucf5n0vHqbbebrRaoJ4R4b9opdSAPTjuQiAW5rzMSKzXGEeaU9B9EKcPeHb7Q+Afrp24NYb1V9yN/seFMScHOpEi+Xlb1bQJXHxqbFQa2bFVe5GDzWj2vq+is7BoHkNfG6V6JvI= 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=Wxw/cVHV; arc=none smtp.client-ip=50.112.246.219 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="Wxw/cVHV" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1756477833; x=1788013833; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=a5jwovR6cUtAAK5RNs9kUpvz4Sb+WrBMm5wfVaSNJno=; b=Wxw/cVHVl7Aiy0A7xb1CWjJgqRSN8l46ZjRizhpMtDu4PZOLQKA8XSr7 IL8hmuK2gcuOkiEDi4dcQ7Q7Z97aUmJNxygHY7DQMt6Jk8DBRjVFjaTxU FspKs5eHM01/+/wDSOdKRgiBfQRAECROnm1CdN/TGQ4tsi3R51APt1aoI M2psUG3rP5COblXbICQAgYDDiSfTaBXaEmUI9/fskPI2bgwmNZmHFrVcV dqT80lmK9g4fLru3fCdWsiWMC/oqPdku2MCjgn9Bh/0R6AZMsK1mgJR3d AzXWfS3DogXcFIlxIHVC1YG6O0GGzV56fhEGIZZ0qYMRXGNKpwUSQZxir w==; X-CSE-ConnectionGUID: ohE/63QHQKiaGt8zE6e3qA== X-CSE-MsgGUID: JY8oAtOeTwSh1DgIDWZR3A== X-IronPort-AV: E=Sophos;i="6.18,221,1751241600"; d="scan'208";a="1926273" 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-015.esa.us-west-2.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Aug 2025 14:30:30 +0000 Received: from EX19MTAUWC001.ant.amazon.com [10.0.21.151:48703] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.63.19:2525] with esmtp (Farcaster) id 013b6866-e744-4603-9cb2-3cd92c1192d2; Fri, 29 Aug 2025 14:30:29 +0000 (UTC) X-Farcaster-Flow-ID: 013b6866-e744-4603-9cb2-3cd92c1192d2 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; Fri, 29 Aug 2025 14:30:29 +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.17; Fri, 29 Aug 2025 14:30:28 +0000 From: Aqib Faruqui To: Shuah Khan , , CC: , Subject: [PATCH 9/9] selftests: kselftest: Add ulong typedef for non-glibc compatibility Date: Fri, 29 Aug 2025 14:25:53 +0000 Message-ID: <20250829142556.72577-10-aqibaf@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250829142556.72577-1-aqibaf@amazon.com> References: <20250829142556.72577-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: EX19D040UWB004.ant.amazon.com (10.13.138.91) 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