mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* /dev/mem and PCI memory = EFAULT?
@ 2016-10-28 21:03 Stas Sergeev
  2016-10-28 21:05 ` Andy Lutomirski
  0 siblings, 1 reply; 7+ messages in thread
From: Stas Sergeev @ 2016-10-28 21:03 UTC (permalink / raw)
  To: Linux kernel; +Cc: Andy Lutomirski

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-10-28 23:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-28 21:03 /dev/mem and PCI memory = EFAULT? Stas Sergeev
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

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®