public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jose Alonso <joalonsof@gmail.com>
To: Fubo Chen <fubo.chen@gmail.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Lukasz Dorau <lukasz.dorau@intel.com>,
	Maciej Patelczyk <maciej.patelczyk@intel.com>,
	Dave Jiang <dave.jiang@intel.com>,
	Simon Horman <horms@verge.net.au>,
	Magnus Damm <magnus.damm@gmail.com>,
	Paul Mundt <lethal@linux-sh.org>, Christoph Hellwig <hch@lst.de>,
	Jens Axboe <axboe@kernel.dk>,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] for_each macros correctness
Date: Sun, 26 Jan 2014 16:05:06 -0200	[thread overview]
Message-ID: <1390759506.6778.1.camel@laptop> (raw)
In-Reply-To: <CAJAFBLBONBLnMnC3Dq8fad4vAUPJPOjp6+5TEzdUAC=Dq6x7pQ@mail.gmail.com>

On Sun, 2014-01-26 at 14:39 +0100, Fubo Chen wrote:
> On Sun, Jan 26, 2014 at 11:54 AM, Jose Alonso <joalonsof@gmail.com> wrote:
> > I observed that there are for_each macros that do an extra memory access
> > beyond the defined area.
> > Normally this does not cause problems.
> > But, this can cause exceptions. For example: if the area is allocated at
> > the end of a page and the next page is not accessible.
> >
> > For correctness, I suggest changing the arguments of the 'for loop' like
> > others 'for_each' do in the kernel.
> 
> Does this patch fix a kernel crash when using gcc 4.8 like the patch
> in http://lkml.org/lkml/2014/1/21/146 ?

The patch for 'for_each_isci_host' is equivalent.

I followed the link above, and as I understand: The access to 
to_pci_info(pdev)->hosts[2] do not caused exception, but
the fact of hosts[2] is "logically accessed" "confused" the
gcc 4.8 compiler. (The gcc compiler do very aggressive loop
optimization and can eliminate loops executing each pass
linearly).



  reply	other threads:[~2014-01-26 18:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-26 10:54 [PATCH] for_each macros correctness Jose Alonso
2014-01-26 13:39 ` Fubo Chen
2014-01-26 18:05   ` Jose Alonso [this message]
2014-01-27  9:26 ` Dorau, Lukasz
2014-01-27 20:01 ` Jens Axboe
2014-01-28 12:02 ` Heiko Carstens

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=1390759506.6778.1.camel@laptop \
    --to=joalonsof@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=broonie@kernel.org \
    --cc=dave.jiang@intel.com \
    --cc=fubo.chen@gmail.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=hch@lst.de \
    --cc=heiko.carstens@de.ibm.com \
    --cc=horms@verge.net.au \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lethal@linux-sh.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukasz.dorau@intel.com \
    --cc=maciej.patelczyk@intel.com \
    --cc=magnus.damm@gmail.com \
    --cc=schwidefsky@de.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox