mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Yuriy Kolerov <Yuriy.Kolerov@synopsys.com>,
	Michal Hocko <mhocko@kernel.org>
Cc: "linux-snps-arc@lists.infradead.org" 
	<linux-snps-arc@lists.infradead.org>,
	"Alexey.Brodkin@synopsys.com" <Alexey.Brodkin@synopsys.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] ARC: mm: Restrict definition of pfn_valid() macro for CONFIG_FLATMEM
Date: Wed, 30 Nov 2016 08:55:02 -0800	[thread overview]
Message-ID: <0f309613-82dc-90c3-a01a-ecfcbe7201ce@synopsys.com> (raw)
In-Reply-To: <3ABF60118B9B784CA5BF7C841D2F00EC01025AC2@de02wembxa.internal.synopsys.com>

On 11/30/2016 06:21 AM, Yuriy Kolerov wrote:
>> On Tue 29-11-16 18:29:06, Yuriy Kolerov wrote:
>>> > > Despite the fact that subtraction of unsigned integers is a defined
>>> > > behaviour however such operations can lead to unexpected results. Thus
>>> > > it is better to check both left and right boundaries to avoid
>>> > > potential bugs as it done in the generic page.h.
>> > 
>> > Why and which code would use an out of range pfn? Why other arches do
>> > not need to care?
> Actually some arches do care about checking of both left and right boundaries (e.g. avr32, sparc, etc). The problem is that a value of pfn may be calculated incorrectly in some places of the kernel. E.g. not long ago I sent a patch which fixes truncation of the most significant byte in pfn/pte in some cases (in the kernel with PAE40, however it is not a FLATMEM case). So such situations can happens in the most unexpected places.
> 

So the point is - is this a preventive fix (desired thing) or it being there would
have helped find the PAE40 bug earlier / easier. Woudl it have prevented the
kernel crash. If so then this is a nobrainer fix.

BTW did you try to gauge the code gen impact - this function gets pulled all over
the place in mm code. So build kernel with and w/o change and do a
scripts/bloat-o-meter

-Vineet

  reply	other threads:[~2016-11-30 16:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-29 15:29 Yuriy Kolerov
2016-11-30  9:16 ` Michal Hocko
2016-11-30 14:21   ` Yuriy Kolerov
2016-11-30 16:55     ` Vineet Gupta [this message]
2016-12-02 14:14       ` Yuriy Kolerov

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=0f309613-82dc-90c3-a01a-ecfcbe7201ce@synopsys.com \
    --to=vineet.gupta1@synopsys.com \
    --cc=Alexey.Brodkin@synopsys.com \
    --cc=Yuriy.Kolerov@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-snps-arc@lists.infradead.org \
    --cc=mhocko@kernel.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

Powered by JetHome