[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=whAUHyXM29_9w_T26=15D1KZnuR3R+f4MT9f-C89oukvA@mail.gmail.com>
Date: Tue, 18 Mar 2025 11:33:25 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Ingo Molnar <mingo@...nel.org>
Cc: "H. Peter Anvin" <hpa@...or.com>, linux-kernel@...r.kernel.org,
Juergen Gross <jgross@...e.com>, Stefano Stabellini <sstabellini@...nel.org>,
"Ahmed S . Darwish" <darwi@...utronix.de>, Andrew Cooper <andrew.cooper3@...rix.com>,
John Ogness <john.ogness@...utronix.de>, Peter Zijlstra <peterz@...radead.org>,
Borislav Petkov <bp@...en8.de>, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH 0/5] x86/cpu: Introduce <asm/cpuid/types.h> and
<asm/cpuid/api.h> and clean them up
On Tue, 18 Mar 2025 at 11:04, Ingo Molnar <mingo@...nel.org> wrote:
>
> plus we could implement the main CPUID call as:
>
> static inline void native_cpuid(struct cpuid_regs *cregs)
> {
> /* ecx is often an input as well as an output. */
> asm volatile("cpuid"
So this really needs "asm inline" now. Because if it's not inlined, it
generates horrific code.
Anyway, I agree with whoever (hpa?) said we should probably just
unconditionally make all "asm" be "__asm__ __inline__" .
And then *if* there are any places that want to out-line the asm (why
would you do that? At that point you'd be better off just writing
assembler!), they could use an explicit __asm__ instead with a
comment.
Sadly, I think doing just a mindless
#define asm(...) __asm__ __inline__(__VA_ARGS__)
doesn't work, because we also have
register void *tos asm("r11");
kind of patterns.
So first we'd have to change those to use __asm__(), and *then* we
could do the "asm() is always __asm__ __inline__()" thing.
Linus
Powered by blists - more mailing lists