From: Sean Christopherson <seanjc@google.com>
To: Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Aqib Faruqui <aqibaf@amazon.com>,
Hisam Mehboob <hisamshar@gmail.com>
Subject: [PATCH v2] KVM: selftests: Undef musl's PAGE_SIZE on x86 to avoid type differences
Date: Tue, 10 Nov 2026 10:24:51 -0800 [thread overview]
Message-ID: <20261110182451.44207-1-seanjc@google.com> (raw)
Before defining PAGE_SIZE in x86's processor.h, explicitly include the
system's limits.h and #undef PAGE_SIZE to workaround a conflict when using
musl where musl defines PAGE_SIZE as a signed 32-bit value, but KVM expects
it to be (and effectively requires it to be) an unsigned 64-bit value.
Reported-by: Aqib Faruqui <aqibaf@amazon.com>
Link: https://lore.kernel.org/kvm/aL8e0MMa4U2-nstQ@google.com
Cc: Hisam Mehboob <hisamshar@gmail.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
---
v2:
- Limit the hackery to KVM x86 selftests.
- Ensure limits.h is included before PAGE_SIZE can get defined by processor.h
v1: https://lore.kernel.org/all/20260507234854.273536-2-hisamshar@gmail.com
tools/testing/selftests/kvm/include/x86/processor.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/tools/testing/selftests/kvm/include/x86/processor.h b/tools/testing/selftests/kvm/include/x86/processor.h
index 5898a277a2e0..65fda03ea893 100644
--- a/tools/testing/selftests/kvm/include/x86/processor.h
+++ b/tools/testing/selftests/kvm/include/x86/processor.h
@@ -6,6 +6,14 @@
#ifndef SELFTEST_KVM_PROCESSOR_H
#define SELFTEST_KVM_PROCESSOR_H
+/*
+ * Explicitly include the system's limit.h and undefine PAGE_SIZE to workaround
+ * an incompatibility where musl defines PAGE_SIZE as a signed integer, whereas
+ * KVM selftests expect it to be a 64-bit unsigned value.
+ */
+#include <limits.h>
+#undef PAGE_SIZE
+
#include <assert.h>
#include <stdint.h>
#include <syscall.h>
base-commit: cf7fa575900051e489f95944c65f432ea706ed73
--
2.56.0.542.g3ef89b7020-goog
reply other threads:[~2026-11-10 18:24 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261110182451.44207-1-seanjc@google.com \
--to=seanjc@google.com \
--cc=aqibaf@amazon.com \
--cc=hisamshar@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®