Re: /dev/mem and PCI memory = EFAULT?
From: Andy Lutomirski
Date: Fri Oct 28 2016 - 17:07:37 EST
On Fri, Oct 28, 2016 at 2:03 PM, Stas Sergeev <stsp@xxxxxxx> wrote:
> 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?
>
What is DOSEMU trying to do here? Access the framebuffer?
ISTM it would be better to use the DRM or FB layer directly (just map
the framebuffer itself) or, if necessary, use VFIO.