[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aLIt3bm0uxSh8I1j@google.com>
Date: Fri, 29 Aug 2025 15:46:53 -0700
From: Sean Christopherson <seanjc@...gle.com>
To: Aqib Faruqui <aqibaf@...zon.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>, Shuah Khan <shuah@...nel.org>, kvm@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
nh-open-source@...zon.com
Subject: Re: [PATCH 2/9] KVM: selftests: Add __packed attribute fallback
On Fri, Aug 29, 2025, Aqib Faruqui wrote:
> 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.
Ugh. No, this needs to be fixed in a central location, not splattered all over
random subsystem selftests. My first choice would be to copy (and keep synchronize)
all of the include/linux/compiler*.h headers to tools/include/linux/.
If for some reason that's not a viable option, we should yank the __packed and
similar #defines out of tools/include/linux/compiler-gcc.h and place them in
tools/include/linux/compiler.h. AFAICT, none of them are actually GCC-only.
> Signed-off-by: Aqib Faruqui <aqibaf@...zon.com>
> ---
> 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
>
> +#ifndef __packed
> +#define __packed __attribute__((__packed__))
> +#endif
> +
> #include "test_util.h"
>
> #include <linux/compiler.h>
> --
> 2.47.3
>
Powered by blists - more mailing lists