All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frantisek Hrbata <fhrbata@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	mingo@redhat.com, hpa@zytor.com, x86@kernel.org, oleg@redhat.com,
	kamaleshb@in.ibm.com, hechjie@cn.ibm.com,
	akpm@linux-foundation.org, dave.hansen@intel.com,
	dvlasenk@redhat.com, prarit@redhat.com, lwoodman@redhat.com,
	hannsj_uhl@de.ibm.com, torvalds@linux-foundation.org
Subject: Re: [RESEND PATCH 2/4] x86: add phys addr validity check for /dev/mem mmap
Date: Tue, 30 Sep 2014 14:41:22 +0200	[thread overview]
Message-ID: <20140930124121.GB3073@localhost.localdomain> (raw)
In-Reply-To: <alpine.DEB.2.02.1409292211560.22082@ionos.tec.linutronix.de>

On Mon, Sep 29, 2014 at 10:15:28PM +0200, Thomas Gleixner wrote:
> On Mon, 29 Sep 2014, Frantisek Hrbata wrote:
> > V2: fix pfn check in valid_mmap_phys_addr_range, thanks to Dave Hansen
> 
> AFAICT, Dave also asked you to change size_t count into something more
> intuitive, i.e. nr_bytes or such.

Hi,

mea culpa, I for unknown reason changed it from "size" to "count". I guess some
cut&paste mess. The correct prototype used elsewhere in kernel is

int valid_mmap_phys_addr_range(unsigned long pfn, size_t size)

Does it make sense to replace "count" with "size" so it's consistent with the
rest or do you prefer "nr_bytes" or as Dave proposed "len_bytes"?

I will fix this and I'm sorry Dave I did not change it as discussed. It totally
slipped my mind.

Many thanks Thomas.

> 
> > +int valid_mmap_phys_addr_range(unsigned long pfn, size_t count)
> 
> And right he is. I really had to look twice to see that count is
> actually number of bytes and not number of pages, which is what you
> expect after pfn.
> 
> > +{
> > +	return arch_pfn_possible(pfn + (count >> PAGE_SHIFT));
> > +}
> 
> Thanks,
> 
> 	tglx

-- 
Frantisek Hrbata

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Frantisek Hrbata <fhrbata@redhat.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	mingo@redhat.com, hpa@zytor.com, x86@kernel.org, oleg@redhat.com,
	kamaleshb@in.ibm.com, hechjie@cn.ibm.com,
	akpm@linux-foundation.org, dave.hansen@intel.com,
	dvlasenk@redhat.com, prarit@redhat.com, lwoodman@redhat.com,
	hannsj_uhl@de.ibm.com, torvalds@linux-foundation.org
Subject: Re: [RESEND PATCH 2/4] x86: add phys addr validity check for /dev/mem mmap
Date: Tue, 30 Sep 2014 14:41:22 +0200	[thread overview]
Message-ID: <20140930124121.GB3073@localhost.localdomain> (raw)
In-Reply-To: <alpine.DEB.2.02.1409292211560.22082@ionos.tec.linutronix.de>

On Mon, Sep 29, 2014 at 10:15:28PM +0200, Thomas Gleixner wrote:
> On Mon, 29 Sep 2014, Frantisek Hrbata wrote:
> > V2: fix pfn check in valid_mmap_phys_addr_range, thanks to Dave Hansen
> 
> AFAICT, Dave also asked you to change size_t count into something more
> intuitive, i.e. nr_bytes or such.

Hi,

mea culpa, I for unknown reason changed it from "size" to "count". I guess some
cut&paste mess. The correct prototype used elsewhere in kernel is

int valid_mmap_phys_addr_range(unsigned long pfn, size_t size)

Does it make sense to replace "count" with "size" so it's consistent with the
rest or do you prefer "nr_bytes" or as Dave proposed "len_bytes"?

I will fix this and I'm sorry Dave I did not change it as discussed. It totally
slipped my mind.

Many thanks Thomas.

> 
> > +int valid_mmap_phys_addr_range(unsigned long pfn, size_t count)
> 
> And right he is. I really had to look twice to see that count is
> actually number of bytes and not number of pages, which is what you
> expect after pfn.
> 
> > +{
> > +	return arch_pfn_possible(pfn + (count >> PAGE_SHIFT));
> > +}
> 
> Thanks,
> 
> 	tglx

-- 
Frantisek Hrbata

  reply	other threads:[~2014-09-30 12:41 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-29 11:32 [RESEND PATCH 0/4] x86: /dev/mem fixes Frantisek Hrbata
2014-09-29 11:32 ` Frantisek Hrbata
2014-09-29 11:32 ` [RESEND PATCH 1/4] x86: add arch_pfn_possible helper Frantisek Hrbata
2014-09-29 11:32   ` Frantisek Hrbata
2014-09-29 11:33 ` [RESEND PATCH 2/4] x86: add phys addr validity check for /dev/mem mmap Frantisek Hrbata
2014-09-29 11:33   ` Frantisek Hrbata
2014-09-29 20:15   ` Thomas Gleixner
2014-09-29 20:15     ` Thomas Gleixner
2014-09-30 12:41     ` Frantisek Hrbata [this message]
2014-09-30 12:41       ` Frantisek Hrbata
2014-09-30 14:27       ` Dave Hansen
2014-09-30 14:27         ` Dave Hansen
2014-09-30 16:33         ` Frantisek Hrbata
2014-09-30 16:33           ` Frantisek Hrbata
2014-09-30 21:57           ` Thomas Gleixner
2014-09-30 21:57             ` Thomas Gleixner
2014-09-29 11:33 ` [RESEND PATCH 3/4] x86: add high_memory check to (xlate|unxlate)_dev_mem_ptr Frantisek Hrbata
2014-09-29 11:33   ` Frantisek Hrbata
2014-09-29 11:33 ` [RESEND PATCH 4/4] x86: remove high_memory check from valid_phys_addr_range Frantisek Hrbata
2014-09-29 11:33   ` Frantisek Hrbata
2014-09-30 16:24 ` [PATCH v2 0/4] x86: /dev/mem fixes Frantisek Hrbata
2014-09-30 16:24   ` Frantisek Hrbata
2014-09-30 16:25   ` [PATCH v2 1/4] x86: add arch_pfn_possible helper Frantisek Hrbata
2014-09-30 16:25     ` Frantisek Hrbata
2014-09-30 16:25   ` [PATCH v2 2/4] x86: add phys addr validity check for /dev/mem mmap Frantisek Hrbata
2014-09-30 16:25     ` Frantisek Hrbata
2014-09-30 16:25   ` [PATCH v2 3/4] x86: add high_memory check to (xlate|unxlate)_dev_mem_ptr Frantisek Hrbata
2014-09-30 16:25     ` Frantisek Hrbata
2014-09-30 16:25   ` [PATCH v2 4/4] x86: remove high_memory check from valid_phys_addr_range Frantisek Hrbata
2014-09-30 16:25     ` Frantisek Hrbata

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=20140930124121.GB3073@localhost.localdomain \
    --to=fhrbata@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dave.hansen@intel.com \
    --cc=dvlasenk@redhat.com \
    --cc=hannsj_uhl@de.ibm.com \
    --cc=hechjie@cn.ibm.com \
    --cc=hpa@zytor.com \
    --cc=kamaleshb@in.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lwoodman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=oleg@redhat.com \
    --cc=prarit@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@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 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.