lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABgObfa7eZXs75F3F9ycyip_LHMYq3=VZHhuar76Bji1OOBXHQ@mail.gmail.com>
Date: Wed, 12 Nov 2025 09:54:12 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Michael Kelley <mhklinux@...look.com>
Cc: Peter Zijlstra <peterz@...radead.org>, Naman Jain <namjain@...ux.microsoft.com>, 
	Sean Christopherson <seanjc@...gle.com>, "K . Y . Srinivasan" <kys@...rosoft.com>, 
	Haiyang Zhang <haiyangz@...rosoft.com>, Wei Liu <wei.liu@...nel.org>, 
	Dexuan Cui <decui@...rosoft.com>, Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, 
	Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>, 
	"H . Peter Anvin" <hpa@...or.com>, 
	"linux-hyperv@...r.kernel.org" <linux-hyperv@...r.kernel.org>, 
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "x86@...nel.org" <x86@...nel.org>, 
	Mukesh Rathor <mrathor@...ux.microsoft.com>, 
	Stanislav Kinsburskii <skinsburskii@...ux.microsoft.com>, 
	Nuno Das Neves <nunodasneves@...ux.microsoft.com>, Christoph Hellwig <hch@...radead.org>, 
	Saurabh Sengar <ssengar@...ux.microsoft.com>, ALOK TIWARI <alok.a.tiwari@...cle.com>
Subject: Re: [PATCH v11 2/2] Drivers: hv: Introduce mshv_vtl driver

On Wed, Nov 12, 2025 at 5:12 AM Michael Kelley <mhklinux@...look.com> wrote:
> > +     .section        .discard.addressable,"aw"
> > +     .align 8
> > +     .type   __UNIQUE_ID_addressable___SCK____mshv_vtl_return_hypercall_662.0, @object
> > +     .size   __UNIQUE_ID_addressable___SCK____mshv_vtl_return_hypercall_662.0, 8
> > +__UNIQUE_ID_addressable___SCK____mshv_vtl_return_hypercall_662.0:
> > +     .quad   __SCK____mshv_vtl_return_hypercall
>
> This is pretty yucky itself. Why is it better than calling out to a C function?
> Is it because in spite of the annotations, there's no guarantee the C
> compiler won't generate some code that messes up a register value? Or is
> there some other reason?
>
> Does the magic "_662.0" have any significance?  Or is it just some
> uniqueness salt on the symbol name?

It's just a counter coming from include/linux/compiler.h:

#define __UNIQUE_ID(prefix) \
        __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)

#define ___ADDRESSABLE(sym, __attrs) \
        static void * __used __attrs \
        __UNIQUE_ID(__PASTE(__addressable_,sym)) = (void *)(uintptr_t)&sym;

#define __ADDRESSABLE(sym) \
        ___ADDRESSABLE(sym, __section(".discard.addressable"))

You can replace the whole ugly symbol with just something like
__dummy_SCK____mshv_vtl_return_hypercall if you prefer.

Paolo


Paolo


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ