From: Bob Picco <bob.picco@hp.com>
To: Keir Fraser <Keir.Fraser@cl.cam.ac.uk>
Cc: linux-kernel@vger.kernel.org, akpm@osdl.org, rddunlap@osdl.org,
cosmos@visi.com
Subject: Re: [PATCH] Fix mmap() of /dev/hpet
Date: Thu, 22 Sep 2005 09:59:46 -0400 [thread overview]
Message-ID: <20050922135946.GV16066@localhost.localdomain> (raw)
In-Reply-To: <E1EIPh5-0001Xp-00@mta1.cl.cam.ac.uk>
Keir Fraser wrote: [Thu Sep 22 2005, 07:56:50AM EDT]
> The address passed to io_remap_pfn_range() in hpet_mmap() does not
> need to be converted using __pa(): it is already a physical
> address. This bug was found and the patch suggested by Clay Harris.
>
> I introduced this particular bug when making io_remap_pfn_range
> changes a few months ago. In fact mmap()ing /dev/hpet has *never*
> previously worked: before my changes __pa() was being executed on an
> ioremap()ed virtual address, which is also invalid.
>
> Signed-off-by: Keir Fraser <keir@xensource.com>
>
> diff -urpP linux-2.6.14-rc2.old/drivers/char/hpet.c linux-2.6.14-rc2.new/drivers/char/hpet.c
> --- linux-2.6.14-rc2.old/drivers/char/hpet.c 2005-09-22 12:47:00.773424663 +0100
> +++ linux-2.6.14-rc2.new/drivers/char/hpet.c 2005-09-22 12:47:18.216928551 +0100
> @@ -273,7 +273,6 @@ static int hpet_mmap(struct file *file,
>
> vma->vm_flags |= VM_IO;
> vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
> - addr = __pa(addr);
>
> if (io_remap_pfn_range(vma, vma->vm_start, addr >> PAGE_SHIFT,
> PAGE_SIZE, vma->vm_page_prot)) {
Keir:
Well it looks definitely wrong. I wonder how my mmap test ever succeeded.
thanks,
bob
prev parent reply other threads:[~2005-09-22 13:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-22 11:56 [PATCH] Fix mmap() of /dev/hpet Keir Fraser
2005-09-22 13:59 ` Bob Picco [this message]
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=20050922135946.GV16066@localhost.localdomain \
--to=bob.picco@hp.com \
--cc=Keir.Fraser@cl.cam.ac.uk \
--cc=akpm@osdl.org \
--cc=cosmos@visi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rddunlap@osdl.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