ksummit.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leonro@mellanox.com>
To: "greg@kroah.com" <greg@kroah.com>
Cc: "ksummit-discuss@lists.linuxfoundation.org"
	<ksummit-discuss@lists.linuxfoundation.org>
Subject: Re: [Ksummit-discuss] [TECH TOPIC] How to encourage driver authors to annotate integer endianness properly
Date: Wed, 25 Oct 2017 13:24:23 +0300	[thread overview]
Message-ID: <20171025102423.GQ16127@mtr-leonro.local> (raw)
In-Reply-To: <20171025101355.GA22977@kroah.com>

[-- Attachment #1: Type: text/plain, Size: 2665 bytes --]

On Wed, Oct 25, 2017 at 12:13:55PM +0200, greg@kroah.com wrote:
> On Wed, Oct 25, 2017 at 10:06:59AM +0000, Bart Van Assche wrote:
> > On Wed, 2017-10-25 at 11:54 +0200, Greg KH wrote:
> > > On Wed, Oct 25, 2017 at 09:47:25AM +0000, Bart Van Assche wrote:
> > > > Hello Ted,
> > > >
> > > > As you most likely know endianness annotations like __be32 can be verified
> > > > by the static source code analyzer called sparse. These annotations are a
> > > > big help to verify whether endianness conversions in drivers are correct
> > > > (e.g. be32_to_cpu()). However, many driver authors either are not familiar
> > > > with sparse or do not use it to verify their work. I think we need a way
> > > > to encourage driver authors to pay attention to endianness annotations,
> > > > e.g. by letting the zero-day kernel test infrastructure verify endianness
> > > > annotations. Please consider to add this topic to the kernel summit agenda.
> > >
> > > Driver subsystem maintainers should know this, and sparse reports should
> > > be simple to run and notice these issues.  If you know of a subsystem
> > > that is not paying attention to this, please let those maintainers know
> > > and send patches to resolve the issues :)
> >
> > Hi Greg,
> >
> > A significant challenge is that for several drivers (e.g. drivers/scsi/qla2xxx
> > and drivers/infiniband/hw/nes) fixing the endianness annotations is so hard
> > that only the driver authors can make these drivers endianness clean.
>
> Then ask them to do so, and if they will not, then mark the drivers in
> Kconfig so they do not get built for big endian platforms.
>
> > Three challenges that have been encountered while trying to make
> > drivers endianness clean are:
> > - Some driver authors use a single variable to store both cpu-endian and big
> >   endian data.
> > - Endianness bugs - using a big endian integer where a cpu endian number
> >   should have been used or vice versa.
> > - The definitive resource for the endianness format is the firmware
> >   documentation. For many kernel drivers the firmware documentation is either
> >   not available or only available under NDA.
>
> These problems are not "new" at all, it's been this way for 20+ years now :)

The major difference between past and current is in the tools, they evolved.

>
> Oh, and the maintainers summit is already half over, and the schedule is
> full from what I can tell...

There is one open TBD slot.

>
> thanks,
>
> greg k-h
> _______________________________________________
> Ksummit-discuss mailing list
> Ksummit-discuss@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/ksummit-discuss

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2017-10-25 10:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-25  9:47 Bart Van Assche
2017-10-25  9:54 ` Greg KH
2017-10-25 10:06   ` Bart Van Assche
2017-10-25 10:13     ` greg
2017-10-25 10:16       ` Mark Brown
2017-10-25 12:56         ` Theodore Ts'o
2017-10-25 10:24       ` Leon Romanovsky [this message]
2017-10-25 10:38         ` greg
2017-10-25 12:11           ` Bart Van Assche
2017-10-25 10:18     ` Leon Romanovsky
2017-10-25 12:40 ` Alexey Dobriyan
2017-10-25 13:11   ` David Woodhouse
2017-10-25 16:16     ` Josh Triplett
2017-10-29  2:05       ` Bart Van Assche

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=20171025102423.GQ16127@mtr-leonro.local \
    --to=leonro@mellanox.com \
    --cc=greg@kroah.com \
    --cc=ksummit-discuss@lists.linuxfoundation.org \
    /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