public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Aqib Faruqui <aqibaf@amazon.com>
To: <seanjc@google.com>
Cc: <aqibaf@amazon.co.uk>, <kvm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-kselftest@vger.kernel.org>
Subject: Re: [PATCH 5/9] KVM: selftests: Prevent PAGE_SIZE redefinition on x86
Date: Fri, 5 Sep 2025 13:59:57 +0000	[thread overview]
Message-ID: <20250905135957.12341-1-aqibaf@amazon.com> (raw)
In-Reply-To: <aLqh2ojEpZZhjheT@google.com>

Thanks for the suggestion. I don't see your previous redefinition of PAGE_SIZE 
upstream, just 3 lines above the warning redefinition:

> In file included from include/x86/svm_util.h:13,
>                  from include/x86/sev.h:15,
>                  from lib/x86/sev.c:5:
> include/x86/processor.h:373:9: error: "PAGE_SIZE" redefined [-Werror]
>   373 | #define PAGE_SIZE               (1ULL << PAGE_SHIFT)
>       |         ^~~~~~~~~
> include/x86/processor.h:370:9: note: this is the location of the previous definition
>   370 | #define PAGE_SIZE               BIT(12)
>       |         ^~~~~~~~~

But I investigated further and found that both glibc and musl define PAGE_SIZE in 
sys/user.h:

glibc (sys/user.h):
  #define PAGE_SHIFT    12
  #define PAGE_SIZE     (1UL << PAGE_SHIFT)

musl (sys/user.h):
  #define PAGE_SIZE     4096

KVM selftests (include/x86/processor.h):
  #define PAGE_SHIFT		12
  #define PAGE_SIZE     (1ULL << PAGE_SHIFT)

This creates redefinition warnings with both C libraries on my system. I've already 
sent a v2 patch series with the PAGE_SIZE patch dropped but I'm not sure what the 
next course of action would be for this?

> Please keep discussions on-list unless there's something that can't/shouldn't be
> posted publicly, e.g. for confidentiality or security reasons.

Apologies, doing this for the first time! Hopefully this one works as it should.

  reply	other threads:[~2025-09-05 14:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-29 14:25 [PATCH 0/9] Add compatibility fixes for KVM selftests with non-glibc C libraries Aqib Faruqui
2025-08-29 14:25 ` [PATCH 1/9] KVM: selftests: Add pidfd_open syscall number fallback Aqib Faruqui
2025-08-29 22:52   ` Sean Christopherson
2025-08-29 14:25 ` [PATCH 2/9] KVM: selftests: Add __packed attribute fallback Aqib Faruqui
2025-08-29 22:46   ` Sean Christopherson
2025-09-01 15:08     ` Faruqui, Aqib
2025-08-29 14:25 ` [PATCH 3/9] KVM: selftests: Add pthread_attr_setaffinity_np fallback Aqib Faruqui
2025-08-29 22:37   ` Sean Christopherson
2025-08-29 14:25 ` [PATCH 4/9] selftests: kselftest: Add memfd_create syscall compatibility Aqib Faruqui
2025-08-29 14:25 ` [PATCH 5/9] KVM: selftests: Prevent PAGE_SIZE redefinition on x86 Aqib Faruqui
2025-08-29 20:38   ` Sean Christopherson
     [not found]     ` <33701547-13AA-467D-AC41-A1A05963B1DD@amazon.com>
2025-09-05  8:39       ` Sean Christopherson
2025-09-05 13:59         ` Aqib Faruqui [this message]
2025-09-08 18:22           ` Sean Christopherson
2025-08-29 14:25 ` [PATCH 6/9] KVM: selftests: Add backtrace fallback Aqib Faruqui
2025-08-29 14:25 ` [PATCH 7/9] rseq: selftests: Add non-glibc compatibility fixes Aqib Faruqui
2025-08-29 14:25 ` [PATCH 8/9] selftests: Fix stdbuf compatibility in mixed libc environments Aqib Faruqui
2025-08-29 14:25 ` [PATCH 9/9] selftests: kselftest: Add ulong typedef for non-glibc compatibility Aqib Faruqui

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=20250905135957.12341-1-aqibaf@amazon.com \
    --to=aqibaf@amazon.com \
    --cc=aqibaf@amazon.co.uk \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=seanjc@google.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