Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761879AbcJ1VGr (ORCPT ); Fri, 28 Oct 2016 17:06:47 -0400 Received: from mail-ua0-f175.google.com ([209.85.217.175]:33234 "EHLO mail-ua0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756540AbcJ1VGp (ORCPT ); Fri, 28 Oct 2016 17:06:45 -0400 MIME-Version: 1.0 In-Reply-To: References: From: Andy Lutomirski Date: Fri, 28 Oct 2016 14:05:44 -0700 Message-ID: Subject: Re: /dev/mem and PCI memory = EFAULT? To: Stas Sergeev Cc: Linux kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 769 Lines: 19 On Fri, Oct 28, 2016 at 2:03 PM, Stas Sergeev 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.