1

I expected to see a list of address ranges starting with 0xffff..., but /proc/vmallocinfo gives some crazy unpadded values. I'm cooking Mali GPU drivers for OrangePi Zero 2W, and was wondering why the driver can't ioremap the GPU register.

Are these values correct? What does it mean to the kernel config?

root@raspberrypi:/home/pi/Downloads/driver/product/kernel/drivers/gpu/arm/midgard# cat /proc/vmallocinfo |grep ioremap
0x0000000055eaf8a7-0x00000000680cafe7    8192 of_iomap+0x64/0xb8 phys=0x0000000003021000 ioremap
0x0000000093fa4f7c-0x00000000214cd459   12288 of_iomap+0x64/0xb8 phys=0x0000000003022000 ioremap
0x000000008eec5156-0x00000000c43cb5a6    8192 __devm_ioremap+0xb8/0x138 phys=0x0000000007010000 ioremap
0x00000000174c6b4f-0x000000009417e241    8192 __devm_ioremap+0xb8/0x138 phys=0x0000000003001000 ioremap
0x00000000fca5d78c-0x00000000d225ad14    8192 __devm_ioremap+0xb8/0x138 phys=0x0000000003002000 ioremap
0x00000000fea45371-0x00000000241ac42c    8192 __devm_ioremap+0xb8/0x138 phys=0x0000000003000000 ioremap
0x00000000f804cc7a-0x0000000020504d6e    8192 __devm_ioremap+0xb8/0x138 phys=0x0000000007000000 ioremap
0x00000000e57e5643-0x000000006a214d35    8192 __devm_ioremap+0xb8/0x138 phys=0x0000000007081000 ioremap
0x000000000f5b5f9e-0x00000000f80492c0    8192 __devm_ioremap+0xb8/0x138 phys=0x0000000003009000 ioremap
0x000000008c82c7bc-0x00000000c0c6ed56    8192 __devm_ioremap+0xb8/0x138 phys=0x0000000003006000 ioremap
0x00000000242d3c9a-0x00000000fc05ac58    8192 __devm_ioremap+0xb8/0x138 phys=0x0000000005096000 ioremap
0x0000000043081299-0x00000000bff3c2ad    8192 of_iomap+0x64/0xb8 phys=0x000000000300a000 ioremap
0x000000009dbe0019-0x00000000e27ad0b1    8192 __devm_ioremap+0xb8/0x138 phys=0x0000000001008000 ioremap
0x0000000050c3c171-0x00000000bcb5b6d7    8192 __devm_ioremap+0xb8/0x138 phys=0x0000000005100000 ioremap
0x000000007e5c4b8e-0x00000000c1db3d7c    8192 __devm_ioremap+0xb8/0x138 phys=0x0000000005101000 ioremap
0x000000003cb701c7-0x00000000955c3e4b    8192 __devm_ioremap+0xb8/0x138 phys=0x0000000005200000 ioremap
...

Also this from dmesg:

[    0.000000] Machine model: OrangePi Zero2 W
[    0.000000] NUMA: No NUMA configuration found
[    0.000000] NUMA: Faking a node at [mem 0x0000000040000000-0x000000013fffffff]
[    0.000000] NUMA: NODE_DATA [mem 0x13f7bf040-0x13f7c0fff]
[    0.000000] Zone ranges:
[    0.000000]   DMA      [mem 0x0000000040000000-0x00000000ffffffff]
[    0.000000]   DMA32    empty
[    0.000000]   Normal   [mem 0x0000000100000000-0x000000013fffffff]
[    0.000000] Movable zone start for each node
0

2 Answers 2

1

/proc (and kernel output in general) no longer shows real addresses; instead, if it shows non-zero values at all, those values are hashes of the pointers, with the top 32 bits zeroed on 64-bit architectures. vmallocinfo specifically uses the kernel pointer output format, which allows its behaviour to be controlled using the kptr_restrict sysctl.

So “addresses” can only be used to compare equality. You can see that the values are meaningless as addresses because they bear no relation to the size of each range, and because the “start” of the range isn’t always lower than the “end”.

You can disable this feature by booting with the no_hash_pointers kernel boot parameter.

0
1

Thanks! I can see real addresses now. It seems that Mali GPU is not mapped properly:

dmesg:

[411.025935] mali 1800000.gpu: real_hw: kbase_reg_get_gpu_id reg=ffff80000af80000 val[0]=0 val[1]=0
root@raspberrypi:/home/pi# cat /proc/vmallocinfo | grep ffff80000af
...
0xffff80000af68000-0xffff80000af6d000   20480 kernel_clone+0x5c/0x3b8 pages=4 vmalloc N0=4
0xffff80000afc8000-0xffff80000afcd000   20480 kernel_clone+0x5c/0x3b8 pages=4 vmalloc N0=4
0xffff80000afd0000-0xffff80000afd5000   20480 kernel_clone+0x5c/0x3b8 pages=4 vmalloc N0=4
...

Update #1

Bingo! GPU needed a soft reset and now the driver can recognize it:

[ 3591.909670] mali 1800000.gpu: dt pm_callback_power_on 0000000000000000
[ 3591.909684] mali 1800000.gpu: dt power_on pm_runtime_get_sync returned 1
[ 3591.909692] mali 1800000.gpu: soft_reset
[ 3591.909802] mali 1800000.gpu: MARCIN: real_hw: kbase_reg_get_gpu_id reg=ffff80000b2c0000 val[0]=1888681984 val[1]=0
[ 3591.909859] mali 1800000.gpu: Register LUT 00070000 initialized for GPU arch 0x00070009
[ 3591.909890] mali 1800000.gpu: GPU identified as 0x3 arch 7.0.9 r0p0 status 0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.