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

Re: [Xen-devel] [PATCH 2/5] xen/arm: optee: check for preemption while freeing shared buffers


  • To: Julien Grall <julien.grall@xxxxxxx>
  • From: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Date: Thu, 12 Sep 2019 19:47:16 +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=rFoyGA8gZ+SddT2UVpr0emKF6cI8qTC3Ib4hYKD3G+0=; b=jB2IS3eq4+ci6pS6U9NPTjaeVeUxtyCHyaMAOiEMKgudK7pEUaxzUIk9L4XN0WVMyFqEihqsDOA7uWK69EOz1NKt7oHjkexOFa3wmR1ry5Z6M4I3P45ZK4a16+61NyywE6f5W76gkw9MhiOBZSxVmbJqCcsUMkY8w03hi0C4YK3F7Qro9R0p+QEs3D+oSVdDVPohea9XTyhNH2InWm/eddXJ7KWlJp+/m5sC/Wp5XHth5eXjL5f4tUynzcR6RQSbv8eCzhYw9pMMx8cuAVZaEnx0O8qgzxQ/J0FM2aMoxccSHHDHQ+HI9Zy8L5skdpEI4guPYxPg/LzkD/YMWPGGmQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YsvQyRLUcO6lSIg+NrHVEAe4jFOFfXcgO4Z0c6S2p6lCnz+wLIZ1D52LWSt0fEk+oV1FMVzgAZzqz2VFG7aVbtCTnK2ScetZkD54YpwVa/3RJHv9ioTXPf9UDVXGspAB1+1OcGgYLSyfKhwpTbB7zAsDzr+QxU98ADMQL7HplP1You8on92PG1T6SGqZim6vX4sqo9tCYKi1Dpk14jRXCayX3GBtLJ+7R1MbQp4R/aQu06j4l5MqbT4kOMNceW9UaAW/Qe4oCOtaSy9QDwouYFGjfC2rkGQoouuFKM0Ec5cpkLMspaPJGTJY3bKwvuJaMYAGp5dyxDyq7UoA4bujJw==
  • 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: Thu, 12 Sep 2019 19:47:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVWeNlIytwW28PUEKII1lAK5bjtackBZ8AgALq7YCAAZ81AIAAAjmA
  • Thread-topic: [PATCH 2/5] xen/arm: optee: check for preemption while freeing shared buffers

Julien Grall writes:

> Hi Volodymyr,
>
> On 9/11/19 7:53 PM, Volodymyr Babchuk wrote:
>>
>> Julien Grall writes:
>>
>>> Hi Volodymyr,
>>>
>>> On 8/23/19 7:48 PM, Volodymyr Babchuk wrote:
>>>> Now we have limit for one shared buffer size, so we can be sure that
>>>> one call to free_optee_shm_buf() will not free all
>>>> MAX_TOTAL_SMH_BUF_PG pages at once. Thus, we now can check for
>>>> hypercall_preempt_check() in the loop inside
>>>> optee_relinquish_resources() and this will ensure that we are not
>>>> missing preemption.
>>>
>>> I am not sure to understand the correlation between the two
>>> sentences. Even if previously the guest could pin up to
>>> MAX_TOTAL_SHM_BUF_PG in one call, a well-behaved guest would result to
>>> do multiple calls and therefore preemption would have been useful.
>> Looks like now I don't understand you.
>>
>> I'm talking about shared buffers. We have limited shared buffer to some
>> reasonable size. There is bad- or well-behaving guests in this context,
>> because guest can't share one big buffer in multiple calls. In other
>> worlds, if guest *needs* to share 512MB buffer with OP-TEE, it will be
>> forced to do this in one call. But we are forbidding big buffers right
>> now.
>>
>> optee_relinquish_resources() is called during domain destruction. At
>> this time we can have a number of still living shared buffers, each of
>> one is no bigger than 512 pages. Thanks to this, we can call
>> hypercall_preempt_check() only in optee_relinquish_resources(), but not
>> in free_optee_shm_buf().
>
> I understand what you mean, however my point is that this patch does
> not dependent of the previous patch. Even if this patch goes alone,
> you will improve well-behaved guest. For ill-behaved guest, the
> problem will stay the same so no change.
>
Ah, I see now. Okay, I'll rework the commit description.

-- 
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®.