RE: [Hampshire] Sys fs, PCI & mmap

Top Page

Reply to this message
Author: Bond, Peter
Date:  
To: Hampshire LUG Discussion List
Subject: RE: [Hampshire] Sys fs, PCI & mmap
> Just write a small kernel module that does a mmio mapping the physical
> memory on the card into the virtual memory of the userspace
> application.
> You do need a kernel module driver loaded to do this task though.
> There would simply be a few IOCTL calls so that userspace can request
> a pointer to the virtual memory location, and also to release the
> memory.
>
> Take a look at some of the PCI passthru code in qemu. qemu is a
> userspace app and can be used to passthru mmio from the hardware into
> the qemu vm.


>From a while back...


Having managed to get the PCI analyser back up and running, it appears that using devmem2 on the base address as reported in the /sys/bus/pci/devices/.../resource file, it does indeed result in reads across the PCI bus at the expected address (and return the data that I expect to see there); however, writes are not currently showing any accesses at all. My guess at the moment is the mapping that is going on - may be caching, I need to investigate further - I'll have a look at what Qemu does too.

Note that this is not using a custom kernel module to handle the mapping, just what is provided by sysfs.

Hope this is of some use to someone!

Peter

**********************************************************************

This email, its content and any attachments is PRIVATE AND
CONFIDENTIAL to TANDBERG Television, Part of the Ericsson Group.
If received in error please notify the sender and destroy the original
message and attachments.

www.tandbergtv.com
**********************************************************************