Re: [SPARSE] noderef & ASM statements

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 15, 2019 at 12:49 PM Luc Van Oostenryck
<luc.vanoostenryck@xxxxxxxxx> wrote:
>
> The only simple temporary 'solution' is see for the moment would be
> to disable 'noderef' warnings while expanding ASM.

No, I think the real fix is to consider memory arguments to asm's to
have an implicit "address_of" operation applied to them.

Basically, the *compiler* never derefences the expression, it's just
given as an address to the asm.

But note that this would require looking at the type of argument to
the asm. If it's a register that the compiler is supposed to fill in,
then the compiler obviously *does* dereference the expression.

But if the asm constraint is "m", then the compiler basically passes
in just he address, and the asm is what *may* do the dereference.

Note the *may*. It's entirely possible that we're passing a memory op
to the inline asm in order for the asm to generate not a dereference,
but something entirely different (like a cache flush, or in the case
of the kernel, maybe a special user access).

Is this somewhat annoying? Yes. But a memory op to an asm really is
more like an address than an access.

              Linus



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux