public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjanv@redhat.com>
To: Martin Diehl <lists@mdiehl.de>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: 2.6.9-rc2-mm2: devmem_is_allowed
Date: Fri, 24 Sep 2004 10:11:46 +0200	[thread overview]
Message-ID: <20040924081145.GA16455@devserv.devel.redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0409240947230.14340-100000@notebook.home.mdiehl.de>

[-- Attachment #1: Type: text/plain, Size: 1504 bytes --]


On Fri, Sep 24, 2004 at 10:09:40AM +0200, Martin Diehl wrote:
> On Fri, 24 Sep 2004, Arjan van de Ven wrote:
> 
> > On Fri, 2004-09-24 at 00:37, Martin Diehl wrote:
> > > Hi,
> > > 
> > > after switching from working 2.6.9-rc2 to -mm2, X refused to start on my 
> > > testbox. It turned out this was because it failed (EPERM) reading from 
> > > /dev/mem beyond the 1MB limit.
> > 
> > can you get me a strace of the failing X server?
> > The code as is is as designed; X has no business messing with kernel ram
> > over 1Mb, there is nothing there for it to (ab)use.
> > (There is PCI memory much higher up but that is allowed again)
> 
> See below. I've reduced it to show the critical parts (AFAICS). Please 
> tell me if I shall mail you the whole unmodified strace -f output from 
> startx.

this looks good already; I'll investigate this further

> It looks like it is scanning /dev/mem page-by-page for some reason trying 
> to get or identify some 512 page mapping. If /dev/mem does not return 
> EPERM after 1MB (i.e. with my patch applied), it scans the whole 192MB of 
> physical memory in the box entirely before it continues.

WHAT? WHY?

> Btw, if reading from /dev/mem is intended to fail above 1MB, it seems 
> there might be an off-by-one somewhere, because the read starting at
> 1048576 (=1024 x 1024) below succeeds. I.e. the first page failing the 
> read is page 257 on zero-based page counting, not 256.

the first page after 1Mb is "magic" for some bioses so this was deliberate

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

      reply	other threads:[~2004-09-24  8:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-23 22:37 2.6.9-rc2-mm2: devmem_is_allowed Martin Diehl
2004-09-24  6:40 ` Arjan van de Ven
2004-09-24  8:09   ` Martin Diehl
2004-09-24  8:11     ` Arjan van de Ven [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=20040924081145.GA16455@devserv.devel.redhat.com \
    --to=arjanv@redhat.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lists@mdiehl.de \
    /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