* [PATCH v2] KVM: selftests: Replace ulong with unsigned long
@ 2026-08-03 17:08 Hisam Mehboob
2026-08-17 22:04 ` Hisam Mehboob
0 siblings, 1 reply; 7+ messages in thread
From: Hisam Mehboob @ 2026-08-03 17:08 UTC (permalink / raw)
To: seanjc, pbonzini
Cc: maz, oupton, tabba, joey.gouly, seiden, suzuki.poulose, yuzenghui,
shuah, aqibaf, linux-arm-kernel, kvmarm, kvm, linux-kselftest,
linux-kernel, Hisam Mehboob
KVM selftests use the non-standard ulong alias in several files. glibc
exposes the alias transitively through its headers, whereas musl does not,
causing musl builds to fail with ulong undeclared.
Use unsigned long directly instead of depending on a libc-specific typedef.
This also avoids adding a duplicate typedef to a shared tools header.
Reported-by: Aqib Faruqui <aqibaf@amazon.com>
Closes: https://lore.kernel.org/r/20250829142556.72577-10-aqibaf@amazon.com
Signed-off-by: Hisam Mehboob <hisamshar@gmail.com>
---
Changes in v2:
- Replaced KVM selftest uses directly instead of adding a shared typedef.
- Dropped the tools/include/linux/types.h change.
- Added Reported-by and Closes tags.
Tested on x86_64 with:
- make -C tools/testing/selftests/kvm
- make -C tools/testing/selftests/kvm CC=musl-gcc
v1: https://lore.kernel.org/r/20260531144934.403888-3-hisamshar@gmail.com/
.../testing/selftests/kvm/arm64/hypercalls.c | 2 +-
.../testing/selftests/kvm/memslot_perf_test.c | 2 +-
tools/testing/selftests/kvm/steal_time.c | 20 +++++++++----------
tools/testing/selftests/kvm/x86/amx_test.c | 2 +-
tools/testing/selftests/kvm/x86/cpuid_test.c | 2 +-
.../testing/selftests/kvm/x86/hyperv_clock.c | 2 +-
.../testing/selftests/kvm/x86/hyperv_evmcs.c | 4 ++--
.../selftests/kvm/x86/hyperv_svm_test.c | 2 +-
.../selftests/kvm/x86/set_boot_cpu_id.c | 2 +-
tools/testing/selftests/kvm/x86/state_test.c | 4 ++--
.../testing/selftests/kvm/x86/tsc_msrs_test.c | 2 +-
.../kvm/x86/vmx_nested_la57_state_test.c | 2 +-
.../kvm/x86/vmx_preemption_timer_test.c | 4 ++--
13 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/tools/testing/selftests/kvm/arm64/hypercalls.c b/tools/testing/selftests/kvm/arm64/hypercalls.c
index 5d96cdf382c4..90d22b2cb6cc 100644
--- a/tools/testing/selftests/kvm/arm64/hypercalls.c
+++ b/tools/testing/selftests/kvm/arm64/hypercalls.c
@@ -162,7 +162,7 @@ struct st_time {
static void steal_time_init(struct kvm_vcpu *vcpu)
{
- u64 st_ipa = (ulong)ST_GPA_BASE;
+ u64 st_ipa = (unsigned long)ST_GPA_BASE;
unsigned int gpages;
gpages = vm_calc_num_guest_pages(VM_MODE_DEFAULT, STEAL_TIME_SIZE);
diff --git a/tools/testing/selftests/kvm/memslot_perf_test.c b/tools/testing/selftests/kvm/memslot_perf_test.c
index 4d9ad6104a6e..8f26b1cee0cd 100644
--- a/tools/testing/selftests/kvm/memslot_perf_test.c
+++ b/tools/testing/selftests/kvm/memslot_perf_test.c
@@ -152,7 +152,7 @@ static void *vcpu_worker(void *__data)
case UCALL_SYNC:
TEST_ASSERT(uc.args[1] == 0,
"Unexpected sync ucall, got %lx",
- (ulong)uc.args[1]);
+ (unsigned long)uc.args[1]);
sem_post(&vcpu_ready);
continue;
case UCALL_NONE:
diff --git a/tools/testing/selftests/kvm/steal_time.c b/tools/testing/selftests/kvm/steal_time.c
index 19a97d6a3607..b8e78b430669 100644
--- a/tools/testing/selftests/kvm/steal_time.c
+++ b/tools/testing/selftests/kvm/steal_time.c
@@ -73,12 +73,12 @@ static void steal_time_init(struct kvm_vcpu *vcpu, u32 i)
st_gva[i] = (void *)(ST_GPA_BASE + i * STEAL_TIME_SIZE);
sync_global_to_guest(vcpu->vm, st_gva[i]);
- vcpu_set_msr(vcpu, MSR_KVM_STEAL_TIME, (ulong)st_gva[i] | KVM_MSR_ENABLED);
+ vcpu_set_msr(vcpu, MSR_KVM_STEAL_TIME, (unsigned long)st_gva[i] | KVM_MSR_ENABLED);
}
static void steal_time_dump(struct kvm_vm *vm, u32 vcpu_idx)
{
- struct kvm_steal_time *st = addr_gva2hva(vm, (ulong)st_gva[vcpu_idx]);
+ struct kvm_steal_time *st = addr_gva2hva(vm, (unsigned long)st_gva[vcpu_idx]);
ksft_print_msg("VCPU%d:\n", vcpu_idx);
ksft_print_msg(" steal: %lld\n", st->steal);
@@ -102,7 +102,7 @@ static void check_steal_time_uapi(void)
vm = vm_create_with_one_vcpu(&vcpu, NULL);
ret = _vcpu_set_msr(vcpu, MSR_KVM_STEAL_TIME,
- (ulong)ST_GPA_BASE | KVM_STEAL_RESERVED_MASK);
+ (unsigned long)ST_GPA_BASE | KVM_STEAL_RESERVED_MASK);
TEST_ASSERT(ret == 0, "Bad GPA didn't fail");
kvm_vm_free(vm);
@@ -151,7 +151,7 @@ static void guest_code(int cpu)
status = smccc(PV_TIME_ST, 0);
GUEST_ASSERT_NE(status, -1);
- GUEST_ASSERT_EQ(status, (ulong)st_gva[cpu]);
+ GUEST_ASSERT_EQ(status, (unsigned long)st_gva[cpu]);
st = (struct st_time *)status;
GUEST_SYNC(0);
@@ -190,13 +190,13 @@ static void steal_time_init(struct kvm_vcpu *vcpu, u32 i)
st_gva[i] = (void *)(ST_GPA_BASE + i * STEAL_TIME_SIZE);
sync_global_to_guest(vm, st_gva[i]);
- st_ipa = (ulong)st_gva[i];
+ st_ipa = (unsigned long)st_gva[i];
vcpu_ioctl(vcpu, KVM_SET_DEVICE_ATTR, &dev);
}
static void steal_time_dump(struct kvm_vm *vm, u32 vcpu_idx)
{
- struct st_time *st = addr_gva2hva(vm, (ulong)st_gva[vcpu_idx]);
+ struct st_time *st = addr_gva2hva(vm, (unsigned long)st_gva[vcpu_idx]);
ksft_print_msg("VCPU%d:\n", vcpu_idx);
ksft_print_msg(" rev: %d\n", st->rev);
@@ -223,11 +223,11 @@ static void check_steal_time_uapi(void)
vm_userspace_mem_region_add(vm, VM_MEM_SRC_ANONYMOUS, ST_GPA_BASE, 1, 1, 0);
virt_map(vm, ST_GPA_BASE, ST_GPA_BASE, 1);
- st_ipa = (ulong)ST_GPA_BASE | 1;
+ st_ipa = (unsigned long)ST_GPA_BASE | 1;
ret = __vcpu_ioctl(vcpu, KVM_SET_DEVICE_ATTR, &dev);
TEST_ASSERT(ret == -1 && errno == EINVAL, "Bad IPA didn't report EINVAL");
- st_ipa = (ulong)ST_GPA_BASE;
+ st_ipa = (unsigned long)ST_GPA_BASE;
vcpu_ioctl(vcpu, KVM_SET_DEVICE_ATTR, &dev);
ret = __vcpu_ioctl(vcpu, KVM_SET_DEVICE_ATTR, &dev);
@@ -318,7 +318,7 @@ static void steal_time_init(struct kvm_vcpu *vcpu, u32 i)
static void steal_time_dump(struct kvm_vm *vm, u32 vcpu_idx)
{
- struct sta_struct *st = addr_gva2hva(vm, (ulong)st_gva[vcpu_idx]);
+ struct sta_struct *st = addr_gva2hva(vm, (unsigned long)st_gva[vcpu_idx]);
int i;
pr_info("VCPU%d:\n", vcpu_idx);
@@ -455,7 +455,7 @@ static void steal_time_init(struct kvm_vcpu *vcpu, u32 i)
static void steal_time_dump(struct kvm_vm *vm, u32 vcpu_idx)
{
- struct kvm_steal_time *st = addr_gva2hva(vm, (ulong)st_gva[vcpu_idx]);
+ struct kvm_steal_time *st = addr_gva2hva(vm, (unsigned long)st_gva[vcpu_idx]);
ksft_print_msg("VCPU%d:\n", vcpu_idx);
ksft_print_msg(" steal: %lld\n", st->steal);
diff --git a/tools/testing/selftests/kvm/x86/amx_test.c b/tools/testing/selftests/kvm/x86/amx_test.c
index 4e63da2b1889..66b6e442c41c 100644
--- a/tools/testing/selftests/kvm/x86/amx_test.c
+++ b/tools/testing/selftests/kvm/x86/amx_test.c
@@ -325,7 +325,7 @@ int main(int argc, char *argv[])
vcpu_regs_get(vcpu, ®s2);
TEST_ASSERT(!memcmp(®s1, ®s2, sizeof(regs2)),
"Unexpected register values after vcpu_load_state; rdi: %lx rsi: %lx",
- (ulong) regs2.rdi, (ulong) regs2.rsi);
+ (unsigned long)regs2.rdi, (unsigned long)regs2.rsi);
}
break;
case UCALL_DONE:
diff --git a/tools/testing/selftests/kvm/x86/cpuid_test.c b/tools/testing/selftests/kvm/x86/cpuid_test.c
index ef0ddd240887..dcd99a0501ee 100644
--- a/tools/testing/selftests/kvm/x86/cpuid_test.c
+++ b/tools/testing/selftests/kvm/x86/cpuid_test.c
@@ -128,7 +128,7 @@ static void run_vcpu(struct kvm_vcpu *vcpu, int stage)
TEST_ASSERT(!strcmp((const char *)uc.args[0], "hello") &&
uc.args[1] == stage + 1,
"Stage %d: Unexpected register values vmexit, got %lx",
- stage + 1, (ulong)uc.args[1]);
+ stage + 1, (unsigned long)uc.args[1]);
return;
case UCALL_DONE:
return;
diff --git a/tools/testing/selftests/kvm/x86/hyperv_clock.c b/tools/testing/selftests/kvm/x86/hyperv_clock.c
index c083cea546dc..3dc9a9c2aa54 100644
--- a/tools/testing/selftests/kvm/x86/hyperv_clock.c
+++ b/tools/testing/selftests/kvm/x86/hyperv_clock.c
@@ -248,7 +248,7 @@ int main(void)
TEST_ASSERT(!strcmp((const char *)uc.args[0], "hello") &&
uc.args[1] == stage,
"Stage %d: Unexpected register values vmexit, got %lx",
- stage, (ulong)uc.args[1]);
+ stage, (unsigned long)uc.args[1]);
/* Reset kvmclock triggering TSC page update */
if (stage == 7 || stage == 8 || stage == 10) {
diff --git a/tools/testing/selftests/kvm/x86/hyperv_evmcs.c b/tools/testing/selftests/kvm/x86/hyperv_evmcs.c
index 1bda2cd3f739..6bca5afccef0 100644
--- a/tools/testing/selftests/kvm/x86/hyperv_evmcs.c
+++ b/tools/testing/selftests/kvm/x86/hyperv_evmcs.c
@@ -221,7 +221,7 @@ static struct kvm_vcpu *save_restore_vm(struct kvm_vm *vm,
vcpu_regs_get(vcpu, ®s2);
TEST_ASSERT(!memcmp(®s1, ®s2, sizeof(regs2)),
"Unexpected register values after vcpu_load_state; rdi: %lx rsi: %lx",
- (ulong) regs2.rdi, (ulong) regs2.rsi);
+ (unsigned long)regs2.rdi, (unsigned long)regs2.rsi);
return vcpu;
}
@@ -277,7 +277,7 @@ int main(int argc, char *argv[])
/* UCALL_SYNC is handled here. */
TEST_ASSERT(!strcmp((const char *)uc.args[0], "hello") &&
uc.args[1] == stage, "Stage %d: Unexpected register values vmexit, got %lx",
- stage, (ulong)uc.args[1]);
+ stage, (unsigned long)uc.args[1]);
vcpu = save_restore_vm(vm, vcpu);
diff --git a/tools/testing/selftests/kvm/x86/hyperv_svm_test.c b/tools/testing/selftests/kvm/x86/hyperv_svm_test.c
index 1f74b0fa9b83..3a3dc31072e8 100644
--- a/tools/testing/selftests/kvm/x86/hyperv_svm_test.c
+++ b/tools/testing/selftests/kvm/x86/hyperv_svm_test.c
@@ -186,7 +186,7 @@ int main(int argc, char *argv[])
/* UCALL_SYNC is handled here. */
TEST_ASSERT(!strcmp((const char *)uc.args[0], "hello") &&
uc.args[1] == stage, "Stage %d: Unexpected register values vmexit, got %lx",
- stage, (ulong)uc.args[1]);
+ stage, (unsigned long)uc.args[1]);
}
diff --git a/tools/testing/selftests/kvm/x86/set_boot_cpu_id.c b/tools/testing/selftests/kvm/x86/set_boot_cpu_id.c
index 8e3898646c69..909cd9e83fda 100644
--- a/tools/testing/selftests/kvm/x86/set_boot_cpu_id.c
+++ b/tools/testing/selftests/kvm/x86/set_boot_cpu_id.c
@@ -69,7 +69,7 @@ static void run_vcpu(struct kvm_vcpu *vcpu)
TEST_ASSERT(!strcmp((const char *)uc.args[0], "hello") &&
uc.args[1] == stage + 1,
"Stage %d: Unexpected register values vmexit, got %lx",
- stage + 1, (ulong)uc.args[1]);
+ stage + 1, (unsigned long)uc.args[1]);
test_set_bsp_busy(vcpu, "while running vm");
break;
case UCALL_DONE:
diff --git a/tools/testing/selftests/kvm/x86/state_test.c b/tools/testing/selftests/kvm/x86/state_test.c
index 4a1056a6cb8d..e6f521a6e737 100644
--- a/tools/testing/selftests/kvm/x86/state_test.c
+++ b/tools/testing/selftests/kvm/x86/state_test.c
@@ -296,7 +296,7 @@ int main(int argc, char *argv[])
/* UCALL_SYNC is handled here. */
TEST_ASSERT(!strcmp((const char *)uc.args[0], "hello") &&
uc.args[1] == stage, "Stage %d: Unexpected register values vmexit, got %lx",
- stage, (ulong)uc.args[1]);
+ stage, (unsigned long)uc.args[1]);
state = vcpu_save_state(vcpu);
memset(®s1, 0, sizeof(regs1));
@@ -343,7 +343,7 @@ int main(int argc, char *argv[])
vcpu_regs_get(vcpu, ®s2);
TEST_ASSERT(!memcmp(®s1, ®s2, sizeof(regs2)),
"Unexpected register values after vcpu_load_state; rdi: %lx rsi: %lx",
- (ulong) regs2.rdi, (ulong) regs2.rsi);
+ (unsigned long)regs2.rdi, (unsigned long)regs2.rsi);
}
done:
diff --git a/tools/testing/selftests/kvm/x86/tsc_msrs_test.c b/tools/testing/selftests/kvm/x86/tsc_msrs_test.c
index 91583969a14f..55779773614b 100644
--- a/tools/testing/selftests/kvm/x86/tsc_msrs_test.c
+++ b/tools/testing/selftests/kvm/x86/tsc_msrs_test.c
@@ -78,7 +78,7 @@ static void run_vcpu(struct kvm_vcpu *vcpu, int stage)
else
ksft_test_result_fail(
"stage %d: Unexpected register values vmexit, got %lx",
- stage + 1, (ulong)uc.args[1]);
+ stage + 1, (unsigned long)uc.args[1]);
return;
case UCALL_DONE:
ksft_test_result_pass("stage %d passed\n", stage + 1);
diff --git a/tools/testing/selftests/kvm/x86/vmx_nested_la57_state_test.c b/tools/testing/selftests/kvm/x86/vmx_nested_la57_state_test.c
index 75073efa926d..448721b54181 100644
--- a/tools/testing/selftests/kvm/x86/vmx_nested_la57_state_test.c
+++ b/tools/testing/selftests/kvm/x86/vmx_nested_la57_state_test.c
@@ -109,7 +109,7 @@ int main(int argc, char *argv[])
}
TEST_ASSERT(uc.args[1] == stage,
- "Expected stage %d, got stage %lu", stage, (ulong)uc.args[1]);
+ "Expected stage %d, got stage %lu", stage, (unsigned long)uc.args[1]);
if (stage == 1) {
pr_info("L2 is active; performing save/restore.\n");
state = vcpu_save_state(vcpu);
diff --git a/tools/testing/selftests/kvm/x86/vmx_preemption_timer_test.c b/tools/testing/selftests/kvm/x86/vmx_preemption_timer_test.c
index eb8021c33cd4..72fbf1b70e9f 100644
--- a/tools/testing/selftests/kvm/x86/vmx_preemption_timer_test.c
+++ b/tools/testing/selftests/kvm/x86/vmx_preemption_timer_test.c
@@ -193,7 +193,7 @@ int main(int argc, char *argv[])
/* UCALL_SYNC is handled here. */
TEST_ASSERT(!strcmp((const char *)uc.args[0], "hello") &&
uc.args[1] == stage, "Stage %d: Unexpected register values vmexit, got %lx",
- stage, (ulong)uc.args[1]);
+ stage, (unsigned long)uc.args[1]);
/*
* If this stage 2 then we should verify the vmx pt expiry
* is as expected.
@@ -234,7 +234,7 @@ int main(int argc, char *argv[])
vcpu_regs_get(vcpu, ®s2);
TEST_ASSERT(!memcmp(®s1, ®s2, sizeof(regs2)),
"Unexpected register values after vcpu_load_state; rdi: %lx rsi: %lx",
- (ulong) regs2.rdi, (ulong) regs2.rsi);
+ (unsigned long)regs2.rdi, (unsigned long)regs2.rsi);
}
done:
--
2.51.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2] KVM: selftests: Replace ulong with unsigned long
2026-08-03 17:08 [PATCH v2] KVM: selftests: Replace ulong with unsigned long Hisam Mehboob
@ 2026-08-17 22:04 ` Hisam Mehboob
2026-08-17 22:24 ` Sean Christopherson
0 siblings, 1 reply; 7+ messages in thread
From: Hisam Mehboob @ 2026-08-17 22:04 UTC (permalink / raw)
To: kvm; +Cc: pbonzini, seanjc, shuah, linux-kselftest
Gentle ping on this patch; it has been on the list since Aug 3 without
any comments.
The musl build failure it fixes is still present in current trees, and
the v1 feedback was addressed in this version. Could it be queued in
kvm-next?
Thanks,
Hisam
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] KVM: selftests: Replace ulong with unsigned long
2026-08-17 22:04 ` Hisam Mehboob
@ 2026-08-17 22:24 ` Sean Christopherson
2026-08-17 22:42 ` Hisam Mehboob
0 siblings, 1 reply; 7+ messages in thread
From: Sean Christopherson @ 2026-08-17 22:24 UTC (permalink / raw)
To: Hisam Mehboob; +Cc: kvm, pbonzini, shuah, linux-kselftest
On Tue, Aug 18, 2026, Hisam Mehboob wrote:
> Gentle ping on this patch; it has been on the list since Aug 3 without
> any comments.
Patience, please. This is on my list of things to grab for 7.4. You posted right
at the end of a cycle, shortly before the merge window, and the code in question
has existed for years, i.e. it didn't seem urgent enough to squeeze into 7.3.
If this is the very last thing needed to unblock musl builds of KVM selftests,
than that changes things, but IIRC there are other "fix selftests builds with musl"
patches floating around.
> The musl build failure it fixes is still present in current trees, and
> the v1 feedback was addressed in this version. Could it be queued in
> kvm-next?
>
> Thanks,
> Hisam
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] KVM: selftests: Replace ulong with unsigned long
2026-08-17 22:24 ` Sean Christopherson
@ 2026-08-17 22:42 ` Hisam Mehboob
2026-08-18 16:27 ` Sean Christopherson
0 siblings, 1 reply; 7+ messages in thread
From: Hisam Mehboob @ 2026-08-17 22:42 UTC (permalink / raw)
To: Sean Christopherson; +Cc: kvm, pbonzini, shuah, linux-kselftest
On 8/18/26 03:24, Sean Christopherson wrote:
> On Tue, Aug 18, 2026, Hisam Mehboob wrote:
>> Gentle ping on this patch; it has been on the list since Aug 3 without
>> any comments.
>
> Patience, please. This is on my list of things to grab for 7.4. You posted right
> at the end of a cycle, shortly before the merge window, and the code in question
> has existed for years, i.e. it didn't seem urgent enough to squeeze into 7.3.
>
> If this is the very last thing needed to unblock musl builds of KVM selftests,
> than that changes things, but IIRC there are other "fix selftests builds with musl"
> patches floating around.
No, this isn't the last blocker. I verified with musl-gcc on x86_64:
with only this patch applied, the build still fails in steal_time.c on
pthread_attr_setaffinity_np() -- it also needs your task-pinning fix
("KVM: selftests: Use KVM's task pinning APIs in steal_time", which I
resent). With both applied, the musl build passes.
>
>> The musl build failure it fixes is still present in current trees, and
>> the v1 feedback was addressed in this version. Could it be queued in
>> kvm-next?
>>
>> Thanks,
>> Hisam
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] KVM: selftests: Replace ulong with unsigned long
2026-08-17 22:42 ` Hisam Mehboob
@ 2026-08-18 16:27 ` Sean Christopherson
2026-08-18 18:19 ` Hisam Mehboob
0 siblings, 1 reply; 7+ messages in thread
From: Sean Christopherson @ 2026-08-18 16:27 UTC (permalink / raw)
To: Hisam Mehboob; +Cc: kvm, pbonzini, shuah, linux-kselftest
On Tue, Aug 18, 2026, Hisam Mehboob wrote:
> On 8/18/26 03:24, Sean Christopherson wrote:
> > On Tue, Aug 18, 2026, Hisam Mehboob wrote:
> > > Gentle ping on this patch; it has been on the list since Aug 3 without
> > > any comments.
> >
> > Patience, please. This is on my list of things to grab for 7.4. You posted right
> > at the end of a cycle, shortly before the merge window, and the code in question
> > has existed for years, i.e. it didn't seem urgent enough to squeeze into 7.3.
> >
> > If this is the very last thing needed to unblock musl builds of KVM selftests,
> > than that changes things, but IIRC there are other "fix selftests builds with musl"
> > patches floating around.
>
> No, this isn't the last blocker. I verified with musl-gcc on x86_64:
> with only this patch applied, the build still fails in steal_time.c on
> pthread_attr_setaffinity_np() -- it also needs your task-pinning fix
> ("KVM: selftests: Use KVM's task pinning APIs in steal_time", which I
> resent). With both applied, the musl build passes.
Oh, so on top of "https://github.com/kvm-x86/linux.git next", this *is* the last
blocker? If so, then I'll grab this for 7.3.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] KVM: selftests: Replace ulong with unsigned long
2026-08-18 16:27 ` Sean Christopherson
@ 2026-08-18 18:19 ` Hisam Mehboob
2026-08-18 19:28 ` Sean Christopherson
0 siblings, 1 reply; 7+ messages in thread
From: Hisam Mehboob @ 2026-08-18 18:19 UTC (permalink / raw)
To: Sean Christopherson; +Cc: kvm, pbonzini, shuah, linux-kselftest
On 8/18/26 21:27, Sean Christopherson wrote:
> Oh, so on top of "https://github.com/kvm-x86/linux.git next", this *is* the last
> blocker? If so, then I'll grab this for 7.3.
Not quite -- I tested kvm-x86/next + this patch with musl-gcc, and the
build still fails. On top of the steal_time fix already in your tree,
two more musl blockers remain, both from code that is only in
kvm-x86/next so far:
1. hardware_disable_test.c, from 496779b54943 ("Pre-set threads affinity
in hardware disable test when possible"):
hardware_disable_test.c:75: error: implicit declaration of function
'pthread_attr_setaffinity_np'
The call sits under #ifdef _GNU_SOURCE, but lib.mk defines _GNU_SOURCE
unconditionally, so the path is always taken and musl (which lacks the
function) breaks.
2. The libvfio wiring from a262fc49e0aa ("Build and link
selftests/vfio/lib into KVM selftests"):
vfio_pci_device.c:25: fatal error: uuid/uuid.h: No such file or
directory
sysfs.c:31: error: implicit declaration of function 'basename'
The former adds a hard libuuid dependency (its headers aren't visible
to musl-gcc here); the latter because musl declares basename only in
<libgen.h>, while glibc exposes it via <string.h> under _GNU_SOURCE.
The rseq __GNUC_PREREQ failure is already covered by my patch in
linux-next. With the above sorted, the musl build passes.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] KVM: selftests: Replace ulong with unsigned long
2026-08-18 18:19 ` Hisam Mehboob
@ 2026-08-18 19:28 ` Sean Christopherson
0 siblings, 0 replies; 7+ messages in thread
From: Sean Christopherson @ 2026-08-18 19:28 UTC (permalink / raw)
To: Hisam Mehboob; +Cc: kvm, pbonzini, shuah, linux-kselftest, David Matlack
+David for the VFIO thing
On Tue, Aug 18, 2026, Hisam Mehboob wrote:
> On 8/18/26 21:27, Sean Christopherson wrote:
>
> > Oh, so on top of "https://github.com/kvm-x86/linux.git next", this *is* the last
> > blocker? If so, then I'll grab this for 7.3.
>
> Not quite -- I tested kvm-x86/next + this patch with musl-gcc, and the
> build still fails. On top of the steal_time fix already in your tree,
> two more musl blockers remain, both from code that is only in
> kvm-x86/next so far:
>
> 1. hardware_disable_test.c, from 496779b54943 ("Pre-set threads affinity
> in hardware disable test when possible"):
>
> hardware_disable_test.c:75: error: implicit declaration of function
> 'pthread_attr_setaffinity_np'
>
> The call sits under #ifdef _GNU_SOURCE, but lib.mk defines _GNU_SOURCE
> unconditionally, so the path is always taken and musl (which lacks the
> function) breaks.
Heh, Sashiko flagged that as problematic, and I was trying to figure out which
macro to key off of[*], but was (obviously) unsuccessful. I don't suppose you
know the canonical way for checking for support of glibc-only functionality of
this nature?
[*] https://lore.kernel.org/all/am0KqJOD-FiC9BXs@google.com
>
> 2. The libvfio wiring from a262fc49e0aa ("Build and link
> selftests/vfio/lib into KVM selftests"):
>
> vfio_pci_device.c:25: fatal error: uuid/uuid.h: No such file or
> directory
> sysfs.c:31: error: implicit declaration of function 'basename'
>
> The former adds a hard libuuid dependency (its headers aren't visible
> to musl-gcc here);
Can you elaborate on what you mean by "its headers aren't visible to musl-gcc"?
> the latter because musl declares basename only in
> <libgen.h>, while glibc exposes it via <string.h> under _GNU_SOURCE.
IIUC, sysfs.c just needs to explicitly include libgen.h?
> The rseq __GNUC_PREREQ failure is already covered by my patch in
> linux-next. With the above sorted, the musl build passes.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-08-18 19:28 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-03 17:08 [PATCH v2] KVM: selftests: Replace ulong with unsigned long Hisam Mehboob
2026-08-17 22:04 ` Hisam Mehboob
2026-08-17 22:24 ` Sean Christopherson
2026-08-17 22:42 ` Hisam Mehboob
2026-08-18 16:27 ` Sean Christopherson
2026-08-18 18:19 ` Hisam Mehboob
2026-08-18 19:28 ` Sean Christopherson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox