From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYFBa-0001bF-MN for qemu-devel@nongnu.org; Tue, 23 Feb 2016 10:47:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYFBW-0006hd-Rc for qemu-devel@nongnu.org; Tue, 23 Feb 2016 10:47:38 -0500 Received: from mail-wm0-x22e.google.com ([2a00:1450:400c:c09::22e]:35203) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYFBW-0006hW-L7 for qemu-devel@nongnu.org; Tue, 23 Feb 2016 10:47:34 -0500 Received: by mail-wm0-x22e.google.com with SMTP id c200so227134241wme.0 for ; Tue, 23 Feb 2016 07:47:34 -0800 (PST) MIME-Version: 1.0 Date: Tue, 23 Feb 2016 17:47:33 +0200 Message-ID: From: Igor R Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] Developing custom device for ARM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hello, I implemented a simple sys_bus device that only communicates through port io. The purpose of this device is to be accessible via /dev/port only, with no need for any additional kernel modules. I Defined the memory region using memory_region_init_io and registered it using sysbus_add_io. I registered the memory region in address 0x9000, and defined custom read and write functions for it. In the guest Linux I used dd if=/dev/port skip=$((0x9000)) count=1 bs=1 to access the port io registers. This worked great for x86 and mips (malta) machines, however, on an arm (versatilepb) machine, I couldn't get this method to work. The reads and writes from 0x900X addresses did not get through to my device. Further inspection revealed that in arm, the kernel tries to reference the *virtual* address 0x9000, while in mips it references the virtual address 0x8b009000. (In x86 a different set of opcodes are used to access the port io area). Why isn't this method working on arm? Thanks.