Thread (4 messages) 4 messages, 3 authors, 2025-03-06

Re: [RFC kvm-unit-tests PATCH] lib: Use __ASSEMBLER__ instead of __ASSEMBLY__

From: Sean Christopherson <seanjc@google.com>
Date: 2025-03-06 22:17:57
Also in: kvm, kvm-riscv, kvmarm

On Thu, Mar 06, 2025, Thomas Huth wrote:
On 22/02/2025 02.45, Sean Christopherson wrote:
quoted
Convert all non-x86 #ifdefs from __ASSEMBLY__ to __ASSEMBLER__, and remove
all manual __ASSEMBLY__ #defines.  __ASSEMBLY_ was inherited blindly from
the Linux kernel, and must be manually defined, e.g. through build rules
or with the aforementioned explicit #defines in assembly code.

__ASSEMBLER__ on the other hand is automatically defined by the compiler
when preprocessing assembly, i.e. doesn't require manually #defines for
the code to function correctly.

Ignore x86, as x86 doesn't actually rely on __ASSEMBLY__ at the moment,
and is undergoing a parallel cleanup.

Signed-off-by: Sean Christopherson <seanjc@google.com>
---

Completely untested.  This is essentially a "rage" patch after spending
way, way too much time trying to understand why I couldn't include some
__ASSEMBLY__ protected headers in x86 assembly files.
Thanks, applied (after fixing the spot that Andrew mentioned and another one
that has been merged in between)!

BTW, do you happen to know why the kernel uses __ASSEMBLY__ and not
__ASSEMBLER__? Just grown historically, or is there a real reason?
AFAICT, it's purely historical.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help