On 31.07.19 00:18, [email protected] wrote:
>     What does the kernel log say about the uio driver setup? Probing might 
> have
>     gone
>     wrong.
> 
> When I check the kernel log with "cat /var/log/kern.log | grep ivshmem", the
> following appears:
> 
>  
> 
> bananapi kernel: [  147.781315] uio_ivshmem 0000:00:00.0: enabling device 
> (0000
> -> 0002)
> bananapi kernel: [  151.007596] Created Jailhouse cell 
> "bananapi-gic-ivshmem-demo"
> 
>  
> 
> And when checking with "cat /var/log/kern.log | grep uio", the following 
> appears:
> 
>  
> 
> bananapi kernel: [  147.781315] uio_ivshmem 0000:00:00.0: enabling device 
> (0000
> -> 0002)
>  

Reads like the driver must be active. No idea what goes wrong here.

> 
>     And which uio_ivshmem driver revision from
>     https://github.com/henning-schild-work/ivshmem-guest-code
>     <https://github.com/henning-schild-work/ivshmem-guest-code> did you use?
>     Sometime,
>     people check out the wrong branch.
> 
> I checkout the jailhouse branch.
>  
> 
>     Also note that there is now a wip/ivshmem2 branch in jailhouse with a 
> reworked
>     device and a queues/jailhouse-ivshmem2 on http://git.kiszka.org/linux.git/
>     <http://git.kiszka.org/linux.git/> with
>     a rewritten uio driver as part of the queue. Maybe that is actually 
> easier to
>     set up.
> 
> I followed this approach and encountered a problem when I enabled the
> hypervisor. The output is the following:
> 
> 
> Initializing Jailhouse hypervisor v0.11 (36-g7c49bb4-dirty) on CPU 0
> Code location: 0xf0000040
> Page pool usage after early setup: mem 56/16362, remap 0/131072
> Initializing processors:
>  CPU 0... OK
>  CPU 1... OK
> Initializing unit: irqchip
> Initializing unit: PCI
> Adding virtual PCI device 00:00.0 to cell "Banana-Pi"
> Page pool usage after late setup: mem 68/16362, remap 5/131072
> Activating hypervisor
> [  136.721403] pci-host-generic 2000000.pci: host bridge /pci@0 ranges:
> [  136.728079] pci-host-generic 2000000.pci:   MEM 0x02100000..0x02101fff ->
> 0x02100000
> [  136.736164] pci-host-generic 2000000.pci: ECAM at [mem 
> 0x02000000-0x020fffff]
> for [bus 00]
> [  136.744954] pci-host-generic 2000000.pci: PCI host bridge to bus 0000:00
> [  136.751852] pci_bus 0000:00: root bus resource [bus 00]
> [  136.757299] pci_bus 0000:00: root bus resource [mem 0x02100000-0x02101fff]
> [  136.764411] pci 0000:00:00.0: [4a48:4a48] type 00 class 0xff0000
> [  136.770627] pci 0000:00:00.0: reg 0x10: [mem 0x00000000-0x00000fff]
> [  136.779618] PCI: bus0: Fast back to back transfers disabled
> [  136.785453] pci 0000:00:00.0: BAR 0: assigned [mem 0x02100000-0x02100fff]
> [  136.792889] uio_ivshm 0000:00:00.0: enabling device (0400 -> 0402)
> [  136.799370] uio_ivshm 0000:00:00.0: state_table at 0x7bf00000, size 
> 0x00001000
> [  136.806802] uio_ivshm 0000:00:00.0: input_sections at 0x7bf02000, size 
> 0x000fe000
> [  136.814451] uio_ivshm 0000:00:00.0: output_section at 0x7bf02000, size 
> 0x0007f000
> [  136.823397] The Jailhouse is opening.
> Unhandled data read at 0x1c25014(4)

Your kernel is now accessing a device that is not configured in the original
bananapi.cell, likely because that config was for a classic banana pi, yours is
an M1. Adjust the config, adding at least a region to cover the 0x100 bytes at
0x01c25000, and things should work better.

> FATAL: unhandled trap (exception class 0x24)
> pc=0xc0543d64 cpsr=0xa00f0193 hsr=0x93850007
> r0=0x00000030 r1=0xde074840 r2=0x00000000 r3=0xe0037000
> r4=0xde074840 r5=0xde8a6068 r6=0x00000000 r7=0xc0a01eb8
> r8=0x00000030 r9=0xde8a6000 r10=0xc0a69bbc r11=0xc07f905c
> r12=0x1e6fe000 r13=0xc0a01e68 r14=0xc0163764
> Parking CPU 0 (Cell: "Banana-Pi")
> Unhandled data read at 0x1c1600c(4)
> FATAL: unhandled trap (exception class 0x24)
> pc=0xc0473924 cpsr=0x200f0013 hsr=0x93830007
> r0=0xef60ff16 r1=0x00000021 r2=0xfffffff8 r3=0xe0029000
> r4=0x0d2e6416 r5=0x00000022 r6=0xde854040 r7=0xc0a04c48
> r8=0xde068000 r9=0xde0680dc r10=0xde854040 r11=0x00000001
> r12=0x00000018 r13=0xde109e98 r14=0x29aaaaab
> Parking CPU 1 (Cell: "Banana-Pi")
> 
> 
> The output for cat /proc/iomem is:
> 
> 
> 01c00000-01c0002f : 1c00000.system-control
> 01c00030-01c0003b : interrupt-controller@1c00030
> 01c02000-01c02fff : 1c02000.dma-controller
> 01c05000-01c05fff : 1c05000.spi
> 01c0c000-01c0cfff : 1c0c000.lcd-controller
> 01c0d000-01c0dfff : 1c0d000.lcd-controller
> 01c0f000-01c0ffff : 1c0f000.mmc
> 01c13000-01c133ff : usb@1c13000
>   01c13000-01c133ff : musb-hdrc.1.auto
> 01c13400-01c1340f : 1c13400.phy
> 01c14000-01c140ff : 1c14000.usb
> 01c14400-01c144ff : 1c14400.usb
> 01c14800-01c14803 : 1c13400.phy
> 01c15000-01c15fff : 1c15000.crypto-engine
> 01c16000-01c16fff : 1c16000.hdmi
> 01c18000-01c18fff : 1c18000.sata
> 01c1c000-01c1c0ff : 1c1c000.usb
> 01c1c400-01c1c4ff : 1c1c400.usb
> 01c1c800-01c1c803 : 1c13400.phy
> 01c20000-01c203ff : clock@1c20000
> 01c20800-01c20bff : 1c20800.pinctrl
> 01c20c90-01c20c9f : 1c20c90.watchdog
> 01c20d00-01c20d1f : 1c20d00.rtc
> 01c21800-01c2183f : 1c21800.ir
> 01c22c00-01c22c3f : 1c22c00.codec
> 01c23800-01c239ff : 1c23800.eeprom
> 01c25000-01c250ff : 1c25000.rtp
> 01c28000-01c2801f : serial
> 01c28c00-01c28c1f : serial
> 01c29c00-01c29c1f : serial
> 01c2ac00-01c2afff : 1c2ac00.i2c
> 01c2b400-01c2b7ff : 1c2b400.i2c
> 01c50000-01c5ffff : 1c50000.ethernet
> 01c60000-01c60fff : hstimer@1c60000
> 01e00000-01e1ffff : 1e00000.display-frontend
> 01e20000-01e3ffff : 1e20000.display-frontend
> 01e40000-01e4ffff : 1e40000.display-backend
> 01e60000-01e6ffff : 1e60000.display-backend
> 40000000-7a3fffff : System RAM
>   40008000-409fffff : Kernel code
>   40b00000-40bac397 : Kernel data
> 
> The bananapi.c config has a memory region for "Ints", which ranges
> between 0x01c20400 and 0x01c207ff (with size of 0x400) and I can't find it in
> /proc/iomem. 
> How can I solve this?
> Am I going on the right path? My only goal is to have IVSHMEM communication
> working between 2 cells in BananaPi-M1. 
> 

See above: There must be some difference in the resource layout of the classic
vs. M1 Banana Pi. Adjust your config (or create a dedicated M1 config) to
address them.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/64ec235d-fe28-e181-7c7b-c00956fea706%40siemens.com.

Reply via email to