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

Re: [Xen-devel] [PATCH v2 09/13] optee: add support for arbitrary shared memory





On 09/11/2018 08:33 PM, Volodymyr Babchuk wrote:
Hi Julien,

Hi,

On 11.09.18 16:37, Julien Grall wrote:
Hi Volodymyr,

On 10/09/18 19:04, Volodymyr Babchuk wrote:
On 10.09.18 17:02, Julien Grall wrote:
On 03/09/18 17:54, Volodymyr Babchuk wrote:
[...]

+    if ( !pages_data_xen_start )
+        return false;
+
+    shm_buf = allocate_shm_buf(ctx, param->u.tmem.shm_ref, num_pages);

In alocate_shm_buf you are now globally limiting the number of pages ( (16384) to pin. However, this does not limit per call.

With the current limit, you would could call up to 16384 times lookup_and_pin_guest_ram_addr(...). On Arm, for p2m related operation, we limit to 512 iterations in one go before checking the preemption.
So I think 16384 times is far too much.
So, in other words, I can translate only 2MB buffer (if 4096KB pages are used), is it right?

2MB for the whole command. So if you have 5 buffer in the command, then the sum of the buffer should not be bigger than 2MB.
4  buffers, but yes, it can be up to 8MB. Okay, I'll add per-call counter to limit memory usage for a whole call.

That would need to be reduced to 2MB in total per call. You probably want to look at max_order(...).


However, 2MB might be too big considering that you also need to account the SMC call. Does buffer can be passed for fast call?
No, all such calls are yielding calls, so you can ignore time used for SMC call itself.

How come you can ignore it? It has a cost to trap to EL3.

Cheers,

--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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