Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1511416

/dev/mem and PCI memory = EFAULT?

From Stas Sergeev <stsp@list.ru>
Newsgroups linux.kernel
Subject /dev/mem and PCI memory = EFAULT?
Date 2016-10-28 23:10 +0200
Message-ID <sxmzv-59w-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View 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.

Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

/dev/mem and PCI memory = EFAULT? Stas Sergeev <stsp@list.ru> - 2016-10-28 23:10 +0200
  Re: /dev/mem and PCI memory = EFAULT? Andy Lutomirski <luto@amacapital.net> - 2016-10-28 23:10 +0200
    Re: /dev/mem and PCI memory = EFAULT? Stas Sergeev <stsp@list.ru> - 2016-10-28 23:20 +0200
      Re: /dev/mem and PCI memory = EFAULT? Andy Lutomirski <luto@amacapital.net> - 2016-10-28 23:30 +0200
        Re: /dev/mem and PCI memory = EFAULT (regression?) Stas Sergeev <stsp@list.ru> - 2016-10-29 00:10 +0200
          Re: /dev/mem and PCI memory = EFAULT (regression?) Linus Torvalds <torvalds@linux-foundation.org> - 2016-10-29 01:30 +0200
            Re: /dev/mem and PCI memory = EFAULT (regression?) Stas Sergeev <stsp@list.ru> - 2016-10-29 01:50 +0200

csiph-web