[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: xen4.13 on raspberry4B use Domain U to control GPIO device



Hello,

+Stefano

On 29/08/2021 15:43, 樊心昊 wrote:
Hello everyone:
    I'm trying use Domain U to control GPIO,but I can't find a way to share bcm2835-gpiomem or gpiomem for Domain U.
     When I had written xl.cfg file, like this

    kernel = "/home/aston/GUEST_Domain/guest_image"
    cmdline = "console=hvc0 earlyprintk=xen sync_console root=/dev/xvda"
    memory = "256"
    name = "rpi4-xen-guest"
    vcpus = 1
    serial="pty"
    disk = [ 'phy:/dev/loop0,xvda,w' ]
vif=[ 'mac=00:11:22:66:88:22,bridge=xenbr0,type=netfront', ]
      device_tree = "/boot/bcm2711-rpi-4-b.dtb"

    dtdev = [ "/soc/gpiomem@7e200000" ]

iomem = [ "0x7e200000,1@0x1000" ] ioports=['0x5']
It will result in anerror,like this

iomem = [ "0x7e200000,1@0x1000" ]   cause:

    libxl: error: libxl_create.c:1498:domcreate_launch_dm: Domain
    1:failed give domain access to iomem range 7e200000-7e200000:
    Operation not permitted

The option 'iomem' takes frame numbers in arguments. If I am not mistaken 0x7e200000 is an address, so you would want to use 0x7e200.

Similar the bits after @ if a guest frame number. Can you confirm you want to map at 0x1000000?

    (XEN) gnttab_mark_dirty not implemented yet


  device_tree = "/boot/bcm2711-rpi-4-b.dtb"
  dtdev = [ "/soc/gpiomem@7e200000" ]
cause

    libxl: error: libxl_create.c:980:libxl__domain_config_setdefault:
    passthrough not supported on this platform

dtdev is used to configure devices protected by an IOMMU. I would be surprised if the GPIO is behind an IOMMU. Can you confirm it?

Note that in this case you need to ensure that you device is not doing any DMA (this would be insecure and broken because guest are have a different view of the memory).



ioports=['0x5']
cause

    libxl: error: libxl_create.c:1467:domcreate_launch_dm: Domain
    2:failed give domain access to ioports 5-5: Operation not supported
The option ioport is an x86 specific option. What are you attempting to do with this option?

Cheers,

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.