From: "H. Peter Anvin" <hpa@zytor.com>
To: Andrei Warkentin <awarkentin@vmware.com>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: /dev/mem "unbounded?"
Date: Wed, 09 Nov 2011 16:11:42 -0800 [thread overview]
Message-ID: <4EBB16BE.9050308@zytor.com> (raw)
In-Reply-To: <1927751307.356328.1320878326756.JavaMail.root@zimbra-prod-mbox-2.vmware.com>
On 11/09/2011 02:38 PM, Andrei Warkentin wrote:
> Hi Peter,
>
> ----- Original Message -----
>>
>> That would be incorrect behavior, though, except perhaps for the
>> range
>> that cannot be addressed by the processor. It is explicitly
>> permitted
>> to address ranges that does not have addresses mapped to it.
>
> There is a current mechanism for restricting access to a subset
> of addresses, and it is used to enforce < 1MB accesses on x86
> if CONFIG_STRICT_DEVMEM. This could be extended.
>
Well, that mechanism is broken. The way it *should* work is that any
region which is system RAM should be denied access, and the rest is
accessible. The current behavior is a hack due to the behavior of some
old versions of Xorg, but that has long been fixed.
> Do you think there is any value in specifying something like
> CONFIG_DEV_MEM_ONLY_CLAIMED, which would only allow accesses
> until the end of the last range claimed with request_region (but
> could, of course, well be unmapped). This will allow accesses to
> any unclaimed "holes" in between. I.e., if you have 0-100m claimed,
> followed by 300-700m claimed, then reading /dev/mem will work up
> until you reach 700m.
No. If you don't know what you're accessing, you should not be touching
/dev/mem under any circumstances. Odds are that even if you're only
reading, there are registers with side effects in there somewhere.
-hpa
next prev parent reply other threads:[~2011-11-10 0:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <51331881.351549.1320871450391.JavaMail.root@zimbra-prod-mbox-2.vmware.com>
2011-11-09 21:01 ` /dev/mem "unbounded?" Andrei Warkentin
2011-11-09 22:18 ` H. Peter Anvin
2011-11-09 22:38 ` Andrei Warkentin
2011-11-10 0:11 ` H. Peter Anvin [this message]
2011-11-10 5:10 ` Andrei Warkentin
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=4EBB16BE.9050308@zytor.com \
--to=hpa@zytor.com \
--cc=awarkentin@vmware.com \
--cc=linux-kernel@vger.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.