mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stas Sergeev <stsp@list.ru>
To: Linux kernel <linux-kernel@vger.kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Subject: /dev/mem and PCI memory = EFAULT?
Date: Sat, 29 Oct 2016 00:03:34 +0300	[thread overview]
Message-ID: <ca789ce7-0983-a539-dcc9-3eddc8a347fe@list.ru> (raw)

Hello.

For the long time dosemu used /dev/mem for vga pass-through.
Now it appears /dev/mem has this check:
http://lxr.free-electrons.com/source/drivers/char/mem.c#L51
which prevents an accesses to PCI memory regions if the
"high_memory" points low enough. It seems "high_memory"
just points to the end of the physical ram, so depending on
the ram size you either can access PCI devices or you get
EFAULT.
Was it wrong to use /dev/mem for accessing the PCI devices?
How should I do that now?

Note: I haven't properly tested that case. I can see the problem
only under qemu, because all my machines has enough ram for
the things to work. Still the failure under qemu makes me wonder
if I should stop using /dev/mem for accessing PCI memory.

             reply	other threads:[~2016-10-28 21:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-28 21:03 Stas Sergeev [this message]
2016-10-28 21:05 ` Andy Lutomirski
2016-10-28 21:18   ` Stas Sergeev
2016-10-28 21:26     ` Andy Lutomirski
2016-10-28 21:36       ` /dev/mem and PCI memory = EFAULT (regression?) Stas Sergeev
2016-10-28 23:26         ` Linus Torvalds
2016-10-28 23:47           ` Stas Sergeev

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=ca789ce7-0983-a539-dcc9-3eddc8a347fe@list.ru \
    --to=stsp@list.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    /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®