@srini
It appears that rpcmem_android.c does not register the buffer for mapping during FastRPC calls.
So the data is copied regardless. I tried to register it manually with remote_register_buf
this creates a mapping during fastrpc_create_maps but crashes on subsequent calls with
Sep 22 15:48:23 linaro-gnome kernel: Unable to handle kernel access to user memory outside uaccess routines at virtual address 0000fffff7fef000
Sep 22 15:48:23 linaro-gnome kernel: Mem abort info:
Sep 22 15:48:23 linaro-gnome kernel: ESR = 0x9600000f
Sep 22 15:48:23 linaro-gnome kernel: EC = 0x25: DABT (current EL), IL = 32 bits
Sep 22 15:48:23 linaro-gnome kernel: SET = 0, FnV = 0
Sep 22 15:48:23 linaro-gnome kernel: EA = 0, S1PTW = 0
Sep 22 15:48:23 linaro-gnome kernel: FSC = 0x0f: level 3 permission fault
Sep 22 15:48:23 linaro-gnome kernel: Data abort info:
Sep 22 15:48:23 linaro-gnome kernel: ISV = 0, ISS = 0x0000000f
Sep 22 15:48:23 linaro-gnome kernel: CM = 0, WnR = 0
Sep 22 15:48:23 linaro-gnome kernel: user pgtable: 4k pages, 48-bit VAs, pgdp=000000014658e000
Sep 22 15:48:23 linaro-gnome kernel: [0000fffff7fef000] pgd=080000014641c003, p4d=080000014641c003, pud=08000001219da003, pmd=0800000104e90003, pte=0068000101767fcb
Sep 22 15:48:23 linaro-gnome kernel: Internal error: Oops: 9600000f [#2] PREEMPT SMP
Sep 22 15:48:23 linaro-gnome kernel: Modules linked in: michael_mic rfcomm af_alg snd_soc_wsa881x regmap_sdw bnep q6asm_dai q6routing q6afe_dai q6afe_clocks q6adm q6asm q6afe q6dsp_common q6core snd_soc_hdmi_code>
Sep 22 15:48:23 linaro-gnome kernel: qcom_usb_vbus_regulator spi_geni_qcom i2c_qcom_geni pinctrl_lpass_lpi
Sep 22 15:48:23 linaro-gnome kernel: CPU: 5 PID: 2006 Comm: profiling Tainted: G D W 5.15.0-qcomlt-arm64 #252
Sep 22 15:48:23 linaro-gnome kernel: Hardware name: Qualcomm Technologies, Inc. Robotics RB5 (DT)
Sep 22 15:48:23 linaro-gnome kernel: pstate: 20400005 (nzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
Sep 22 15:48:23 linaro-gnome kernel: pc : __arch_copy_to_user+0x180/0x220
Sep 22 15:48:23 linaro-gnome kernel: lr : fastrpc_internal_invoke+0xa60/0xd90 [fastrpc]
Sep 22 15:48:23 linaro-gnome kernel: sp : ffff80001179bc60
Sep 22 15:48:23 linaro-gnome kernel: x29: ffff80001179bc60 x28: 0000000000000018 x27: ffff800020ce9000
Sep 22 15:48:23 linaro-gnome kernel: x26: 0000000000000002 x25: 000000007fffffff x24: 0000ffffffffffff
Sep 22 15:48:23 linaro-gnome kernel: x23: ffff5ea20305b660 x22: ffff5ea2218d4880 x21: ffff5ea20305be30
Sep 22 15:48:23 linaro-gnome kernel: x20: ffff5ea20305be00 x19: ffff5ea20305b600 x18: 0000000000000000
Sep 22 15:48:23 linaro-gnome kernel: x17: 0000000000000000 x16: ffffbaca24366740 x15: 0000fffff7fef000
Sep 22 15:48:23 linaro-gnome kernel: x14: 000000000000011b x13: 0000000000000051 x12: 071c71c71c71c71c
Sep 22 15:48:23 linaro-gnome kernel: x11: 0000000000000051 x10: 0000000000000a20 x9 : ffff80001179bae0
Sep 22 15:48:23 linaro-gnome kernel: x8 : ffff5ea2218d5300 x7 : ffff5ea202862200 x6 : 0000fffff7fef000
Sep 22 15:48:23 linaro-gnome kernel: x5 : 0000fffff7ff7000 x4 : 0000000000000000 x3 : 0000fffff7fef000
Sep 22 15:48:23 linaro-gnome kernel: x2 : 0000000000007f80 x1 : 0000fffff7fef000 x0 : 0000fffff7fef000
Sep 22 15:48:23 linaro-gnome kernel: Call trace:
Sep 22 15:48:23 linaro-gnome kernel: __arch_copy_to_user+0x180/0x220
Sep 22 15:48:23 linaro-gnome kernel: fastrpc_device_ioctl+0x570/0x844 [fastrpc]
Sep 22 15:48:23 linaro-gnome kernel: __arm64_sys_ioctl+0xac/0xf0
Sep 22 15:48:23 linaro-gnome kernel: invoke_syscall+0x48/0x114
Sep 22 15:48:23 linaro-gnome kernel: el0_svc_common.constprop.0+0x44/0xfc
Sep 22 15:48:23 linaro-gnome kernel: do_el0_svc+0x2c/0x94
Sep 22 15:48:23 linaro-gnome kernel: el0_svc+0x28/0x80
Sep 22 15:48:23 linaro-gnome kernel: el0t_64_sync_handler+0xa8/0x130
Sep 22 15:48:23 linaro-gnome kernel: el0t_64_sync+0x1a0/0x1a4
Sep 22 15:48:23 linaro-gnome kernel: Code: d503201f d503201f d503201f d503201f (a8c12027)
Sep 22 15:48:23 linaro-gnome kernel: ---[ end trace bbd663a568ccad6d ]---
Any idea what I am doing wrong?