mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Richard B. Johnson" <root@chaos.analogic.com>
To: Petr Vandrovec <vandrove@vc.cvut.cz>
Cc: davej@codemonkey.org.uk, linux-kernel@vger.kernel.org
Subject: Re: EFAULT reading /dev/mem... - broken x86info
Date: Mon, 10 Nov 2003 08:55:40 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.53.0311100849260.12099@chaos> (raw)
In-Reply-To: <20031108162737.GB26350@vana.vc.cvut.cz>

On Sat, 8 Nov 2003, Petr Vandrovec wrote:

> Hi Dave,
>   today I attempted to run 'x86info' on my system, and I was awarded by
> a bit unexpected answer:
>
> ppc:~/x# x86info -v
> x86info v1.12b.  Dave Jones 2001-2003
> Feedback to <davej@redhat.com>.
>
> readEntry: Bad address
> Found 1 CPUppc:~/x
>
>
> After some tweaking around I found that I cannot read some pages from /dev/mem -
> - I get -EFAULT on them. x86info run to the 0x86000 and 0x87000 pages, as it
> scans 0x80000-0x8FFFF range for mptable.
>

Your code works on 2.4.22 and probably somewhat higher versions. However,
as I understand it, the new kernels no longer mmap everything by default.
In other words, there are no PTEs unless you or a driver sets them.
In user-mode, you need to mmap() and in kernel mode, you use ioremap_*().

Since you can mmap() something that is already mmapped() without any
problem, the code should probably be "fixed" to mmap everything it
tries to read, page-by-page.

If this is not correct, I'm sure somebody will respond.


Cheers,
Dick Johnson
Penguin : Linux version 2.4.22 on an i686 machine (797.90 BogoMips).
            Note 96.31% of all statistics are fiction.



  reply	other threads:[~2003-11-10 13:54 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-08 16:27 Petr Vandrovec
2003-11-10 13:55 ` Richard B. Johnson [this message]
2003-11-10 16:11 ` Dave Jones
2003-11-10 16:50   ` Manfred Spraul
2003-11-10 16:56     ` Dave Jones
2003-11-10 17:17       ` Manfred Spraul
2003-11-10 18:05         ` Petr Vandrovec
2003-11-10 18:59           ` Manfred Spraul
2003-11-10 19:36             ` Mika Penttilä
2003-11-10 19:47               ` Manfred Spraul
2003-11-10 20:24                 ` Dave Jones

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=Pine.LNX.4.53.0311100849260.12099@chaos \
    --to=root@chaos.analogic.com \
    --cc=davej@codemonkey.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vandrove@vc.cvut.cz \
    /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

all inboxes | Powered by JetHome®