From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Theodore Tso <tytso@mit.edu>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Add user taint flag
Date: Tue, 23 May 2006 09:49:20 +1000 [thread overview]
Message-ID: <44724E00.8090000@yahoo.com.au> (raw)
In-Reply-To: <20060522183352.GA4453@thunk.org>
Theodore Tso wrote:
>
>+struct page *rmem_vma_nopage(struct vm_area_struct *vma,
>+ unsigned long address, int *type)
>+{
>+ struct page *pageptr;
>+ unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;
>+ unsigned long physaddr = address - vma->vm_start + offset;
>+ unsigned long pageframe = physaddr >> PAGE_SHIFT;
>+
>+ if (!pfn_valid(pageframe))
>+ return NOPAGE_SIGBUS;
>+ pageptr = pfn_to_page(pageframe);
>+ get_page(pageptr);
>+ if (type)
>+ *type = VM_FAULT_MINOR;
>+ return pageptr;
>+}
>
This won't work because struct page could easily be a free page.
I think /dev/mem should be able to remap physical memory now that
PG_reserved is gone.
--
Send instant messages to your online friends http://au.messenger.yahoo.com
next prev parent reply other threads:[~2006-05-22 23:49 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-21 23:04 [PATCH] Add user taint flag Theodore Ts'o
2006-05-22 10:36 ` Andrew Morton
2006-05-22 18:33 ` Theodore Tso
2006-05-22 23:49 ` Nick Piggin [this message]
2006-05-24 13:43 ` Stefan Seyfried
2006-05-22 12:17 ` Stephen C. Tweedie
2006-05-22 14:14 ` Arjan van de Ven
2006-05-22 14:35 ` Alan Cox
2006-05-22 14:29 ` Valdis.Kletnieks
2006-05-22 18:56 ` Jan Engelhardt
2006-05-22 14:37 ` Arjan van de Ven
2006-05-23 1:11 ` Theodore Tso
2006-05-22 15:48 ` Randy.Dunlap
2006-05-23 18:45 ` Greg KH
2006-05-24 13:39 ` Theodore Tso
2006-05-24 13:55 ` Dave Jones
2006-05-24 14:15 ` Dave Jones
2006-05-25 15:01 ` Greg KH
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=44724E00.8090000@yahoo.com.au \
--to=nickpiggin@yahoo.com.au \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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.