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

Re: [Xen-devel] [PATCH 1/5] xen/arm: optee: impose limit on shared buffer size


  • To: Julien Grall <julien.grall@xxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Mon, 16 Sep 2019 15:26:53 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g+kaucB7fQFjx5Wg65KDQjhmjJZysKUDhh1z5wcbPTw=; b=g9FST1EVylhrLV5GSQN1YLAXPvf9FesXMaRCZkbvRFDwppCcsZhYwmWI+sWwCTs/k+yQlUgWwCA5gkCMRiUhpBPbUjoi+Tmpo9+QSwX/6vzEPuwmc6NE50LMd0XdpMieqzmT3WxfdDwT+XvY3DGZnXmo9xsHoldFRhMAzJtc4mWjDzm//oVdvGWGRdP34Sv21S+mw6kOXQ9W6Gc8c3NixM8FbrfzJWI8Id2F7qIR3hVydXwxPhlcmSYiKM5jhZsGGR8KSrsA7uXRCA57G7kTWIAwBGSsjW1mlEtxlSVbHWcfMyUB8I4Epuhv/5dA5URH7EL8m0I8hOC9g4NyISHFsw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=El0l2+X0lGqi4mzrsgB7nKRIPvkqx2V+9u77VFcDArwvXOEo4uA65dlgpOP1xF5RWJexvXGg/aWjAhHdIj6TS7qwJ2wN0Cv3qxWbBNo26XkOsZZbPltYWMrSJmVK7Y7hFBENKZMLv3LrVUdfojcRCnFWFdeeLytqhlEStjhuJUJYiSjoNgDW2hWxTl0Cfcv+PpQ+/4+VtsFt/PyqPc7IsO/4taLyoZWEtbPst/SbhR7EV5YtA4ROA1PSdzMdD3GRvwotIOtH/mlgz+YOwOyzBacHyrIg6uX47pvuCSQiJBxwMnoo6W2taLWEdgaXJfbnswLe8DaWnbPVbWaFD8Cy1w==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Volodymyr_Babchuk@xxxxxxxx;
  • Cc: "tee-dev@xxxxxxxxxxxxxxxx" <tee-dev@xxxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Mon, 16 Sep 2019 15:27:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVWeNlCY0CqDi7zE2giEuaPhvOCqckA0sAgALr+QCAAZ6qAIAAA5eAgAABlACABf90AA==
  • Thread-topic: [PATCH 1/5] xen/arm: optee: impose limit on shared buffer size

Hi Julien,

Julien Grall writes:

> Hi,
>
> On 9/12/19 8:45 PM, Volodymyr Babchuk wrote:
>>
>> Hi Julien,
>>
>> Julien Grall writes:
>>
>>> Hi Volodymyr,
>>>
>>> On 9/11/19 7:48 PM, Volodymyr Babchuk wrote:
>>>>
>>>> Julien Grall writes:
>>>>
>>>>> Hi Volodymyr,
>>>>>
>>>>> On 8/23/19 7:48 PM, Volodymyr Babchuk wrote:
>>>>>> We want to limit number of calls to lookup_and_pin_guest_ram_addr()
>>>>>> per one request. There are two ways to do this: either preempt
>>>>>> translate_noncontig() or to limit size of one shared buffer size.
>>>>>>
>>>>>> It is quite hard to preempt translate_noncontig(), because it is deep
>>>>>> nested. So we chose second option. We will allow 512 pages per one
>>>>>> shared buffer. This does not interfere with GP standard, as it
>>>>>> requires that size limit for shared buffer should be at lest 512kB.
>>>>>
>>>>> Do you mean "least" instead of "lest"?
>>>> Yes
>>>>
>>>>> If so, why 512 pages (i.e 1MB)
I have missed that earlier. But 512 pages is 2MB, actually.

>>>>> is plenty enough for most of the use cases? What does "xtest" consist
>>>>> on?
>>>> Bigger buffer xtest tries to allocate is mere 32KB. I believe that 1MB
>>>> is enough for the most cases, because OP-TEE itself have a very limited
>>>> resources. But this value is chosen arbitrary.
>>>
>>> Could we potentially reduce to let say 512KB (or maybe lower) if xtest
>>> only allocate 32KB?
>> Potentially - yes. But only to 512KB if we want to be compatible with
>> the Global Platform specification. Why are you asking, though?
>
> Does the Global Platform specification limit to 512KB? Or is it a minimum?
GP Spec says, that platform should allow *at lest* 512KB. Upper limit is
not set.

> Because, the smaller the buffer is, the less time it will take to
> process in the worst case. Also, if we can have a reason for the size
> (you seem to suggest the spec define a size...) then it is much better
> than a random value.
I have no strong arguments here, but I want to allow the biggest size
possible. It seems, that 512 pages is the accepted limit in hypervisor
code (at least, in p2m.c), so I chose this value.


-- 
Volodymyr Babchuk at EPAM
_______________________________________________
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®.