All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Nicolai Hähnle" <nhaehnle@gmail.com>
To: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "Nicolai Hähnle" <nicolai.haehnle@amd.com>,
	"ML dri-devel" <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] xf86drm: ensure proper alignment of pointers in drmProcessPciDevice
Date: Tue, 17 May 2016 10:24:43 -0500	[thread overview]
Message-ID: <573B37BB.9030608@gmail.com> (raw)
In-Reply-To: <CACvgo50XNgQoxZAivvyAPwMP=zxyWcZ_Ha0c_Sg3LZ0ZQYdS1Q@mail.gmail.com>

Hi Emil,

On 14.05.2016 18:03, Emil Velikov wrote:
> Hi Nicolai,
>
> On 13 May 2016 at 07:14, Nicolai Hähnle <nhaehnle@gmail.com> wrote:
>> From: Nicolai Hähnle <nicolai.haehnle@amd.com>
>>
>> Previously, (*device)->businfo.pci would end up misaligned, which results
>> in undefined behavior.
>>
> Can you point me to a source where I can read more on the topic ?
> I'm pretty sure I ran this through valgrind and it gave a clear bill of health.

Valgrind doesn't complain here either, I noticed it with 
-fsanitize=undefined (ubsan) applied to Mesa.

That makes sense, since unaligned loads/stores aren't really a bug as 
far as the x86 ISA is concerned, which is the level at which valgrind 
looks at the code. On the other hand, apparently already an unaligned 
cast (not just the dereference!) is undefined behavior as far as C is 
concerned. I'm not a C language lawyer, but that's what people are 
saying on the interwebs, so it must be true :)

> P.S. Please run the following in your repo $git config --local
> format.subjectPrefix "PATCH libdrm"

Done.

Cheers,
Nicolai
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-05-17 15:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-13  6:14 [PATCH] xf86drm: ensure proper alignment of pointers in drmProcessPciDevice Nicolai Hähnle
2016-05-14 23:03 ` Emil Velikov
2016-05-17 15:24   ` Nicolai Hähnle [this message]
2016-06-10 14:07 ` Nicolai Hähnle
2016-06-10 16:55   ` Emil Velikov
2016-06-10 18:19     ` Nicolai Hähnle

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=573B37BB.9030608@gmail.com \
    --to=nhaehnle@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=nicolai.haehnle@amd.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.