]> xenbits.xensource.com Git - people/larsk/xen.git/commit
xen/arm: optee: impose limit on shared buffer size
authorVolodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Wed, 18 Sep 2019 18:50:51 +0000 (18:50 +0000)
committerJulien Grall <julien.grall@arm.com>
Mon, 23 Sep 2019 10:23:41 +0000 (11:23 +0100)
commit847c18e68136dd4943a6d0cfe26dc5e766b5bae2
tree416984a994f0dab2f6cd795f50da6e7ffbb5e079
parente17381916ef06c8199f079026d2ee6715c228320
xen/arm: optee: impose limit on shared buffer size

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 limit size of one shared buffer size.

It is quite hard to preempt translate_noncontig(), because it is deep
nested. So we chose the second option. We will allow 129 pages per one
shared buffer. This corresponds to the GP standard, as it requires
that size limit for shared buffer should be at least 512kB. One extra
page (129th) is needed to cope with the fact that user's buffer is not
necessary aligned with page boundary.

Also, with this limitation OP-TEE still passes own "xtest" test suite,
so this is okay for now.

Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Acked-by: Julien Grall <julien.grall@arm.com>
xen/arch/arm/tee/optee.c