<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/tee, branch v5.5</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2020-01-24T20:05:08Z</updated>
<entry>
<title>Merge tag 'tee-optee-fix2-for-5.5' of https://git.linaro.org:/people/jens.wiklander/linux-tee into arm/fixes</title>
<updated>2020-01-24T20:05:08Z</updated>
<author>
<name>Olof Johansson</name>
<email>olof@lixom.net</email>
</author>
<published>2020-01-24T20:05:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=088307d216205227baa4707f07c73d1dcb863c9b'/>
<id>urn:sha1:088307d216205227baa4707f07c73d1dcb863c9b</id>
<content type='text'>
Fix OP-TEE compile error with nommu

* tag 'tee-optee-fix2-for-5.5' of https://git.linaro.org:/people/jens.wiklander/linux-tee:
  tee: optee: Fix compilation issue with nommu

Link: https://lore.kernel.org/r/20200123101310.GA10320@jax
Signed-off-by: Olof Johansson &lt;olof@lixom.net&gt;
</content>
</entry>
<entry>
<title>tee: optee: Fix compilation issue with nommu</title>
<updated>2020-01-23T09:55:20Z</updated>
<author>
<name>Vincenzo Frascino</name>
<email>vincenzo.frascino@arm.com</email>
</author>
<published>2020-01-10T12:28:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9e0caab8e0f96f0af7d1dd388e62f44184a75372'/>
<id>urn:sha1:9e0caab8e0f96f0af7d1dd388e62f44184a75372</id>
<content type='text'>
The optee driver uses specific page table types to verify if a memory
region is normal. These types are not defined in nommu systems. Trying
to compile the driver in these systems results in a build error:

  linux/drivers/tee/optee/call.c: In function ‘is_normal_memory’:
  linux/drivers/tee/optee/call.c:533:26: error: ‘L_PTE_MT_MASK’ undeclared
     (first use in this function); did you mean ‘PREEMPT_MASK’?
     return (pgprot_val(p) &amp; L_PTE_MT_MASK) == L_PTE_MT_WRITEALLOC;
                             ^~~~~~~~~~~~~
                             PREEMPT_MASK
  linux/drivers/tee/optee/call.c:533:26: note: each undeclared identifier is
     reported only once for each function it appears in
  linux/drivers/tee/optee/call.c:533:44: error: ‘L_PTE_MT_WRITEALLOC’ undeclared
     (first use in this function)
     return (pgprot_val(p) &amp; L_PTE_MT_MASK) == L_PTE_MT_WRITEALLOC;
                                            ^~~~~~~~~~~~~~~~~~~

Make the optee driver depend on MMU to fix the compilation issue.

Signed-off-by: Vincenzo Frascino &lt;vincenzo.frascino@arm.com&gt;
[jw: update commit title]
Signed-off-by: Jens Wiklander &lt;jens.wiklander@linaro.org&gt;
</content>
</entry>
<entry>
<title>optee: Fix multi page dynamic shm pool alloc</title>
<updated>2020-01-03T10:21:12Z</updated>
<author>
<name>Sumit Garg</name>
<email>sumit.garg@linaro.org</email>
</author>
<published>2019-12-30T13:22:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5a769f6ff439cedc547395a6dc78faa26108f741'/>
<id>urn:sha1:5a769f6ff439cedc547395a6dc78faa26108f741</id>
<content type='text'>
optee_shm_register() expected pages to be passed as an array of page
pointers rather than as an array of contiguous pages. So fix that via
correctly passing pages as per expectation.

Fixes: a249dd200d03 ("tee: optee: Fix dynamic shm pool allocations")
Reported-by: Vincent Cao &lt;vincent.t.cao@intel.com&gt;
Signed-off-by: Sumit Garg &lt;sumit.garg@linaro.org&gt;
Tested-by: Vincent Cao &lt;vincent.t.cao@intel.com&gt;
Signed-off-by: Jens Wiklander &lt;jens.wiklander@linaro.org&gt;
</content>
</entry>
<entry>
<title>Merge mainline/master into arm/fixes</title>
<updated>2019-12-05T21:18:54Z</updated>
<author>
<name>Olof Johansson</name>
<email>olof@lixom.net</email>
</author>
<published>2019-12-05T21:16:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=942e6f8a8314e5550e254519dfba4ccd5170421d'/>
<id>urn:sha1:942e6f8a8314e5550e254519dfba4ccd5170421d</id>
<content type='text'>
This brings in the mainline tree right after armsoc contents was merged
this release cycle, so that we can re-run savedefconfig, etc.

Signed-off-by: Olof Johansson &lt;olof@lixom.net&gt;
</content>
</entry>
<entry>
<title>tee: optee: fix device enumeration error handling</title>
<updated>2019-11-15T10:31:24Z</updated>
<author>
<name>Jens Wiklander</name>
<email>jens.wiklander@linaro.org</email>
</author>
<published>2019-11-06T15:48:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=03212e347f9443e524d6383c6806ac08295c1fb0'/>
<id>urn:sha1:03212e347f9443e524d6383c6806ac08295c1fb0</id>
<content type='text'>
Prior to this patch in optee_probe() when optee_enumerate_devices() was
called the struct optee was fully initialized. If
optee_enumerate_devices() returns an error optee_probe() is supposed to
clean up and free the struct optee completely, but will at this late
stage need to call optee_remove() instead. This isn't done and thus
freeing the struct optee prematurely.

With this patch the call to optee_enumerate_devices() is done after
optee_probe() has returned successfully and in case
optee_enumerate_devices() fails everything is cleaned up with a call to
optee_remove().

Fixes: c3fa24af9244 ("tee: optee: add TEE bus device enumeration support")
Reviewed-by: Sumit Garg &lt;sumit.garg@linaro.org&gt;
Signed-off-by: Jens Wiklander &lt;jens.wiklander@linaro.org&gt;
</content>
</entry>
<entry>
<title>tee: optee: Fix dynamic shm pool allocations</title>
<updated>2019-11-15T10:31:11Z</updated>
<author>
<name>Sumit Garg</name>
<email>sumit.garg@linaro.org</email>
</author>
<published>2019-11-08T11:27:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a249dd200d03791cab23e47571f3e13d9c72af6c'/>
<id>urn:sha1:a249dd200d03791cab23e47571f3e13d9c72af6c</id>
<content type='text'>
In case of dynamic shared memory pool, kernel memory allocated using
dmabuf_mgr pool needs to be registered with OP-TEE prior to its usage
during optee_open_session() or optee_invoke_func().

So fix dmabuf_mgr pool allocations via an additional call to
optee_shm_register().

Also, allow kernel pages to be registered as shared memory with OP-TEE.

Fixes: 9733b072a12a ("optee: allow to work without static shared memory")
Signed-off-by: Sumit Garg &lt;sumit.garg@linaro.org&gt;
Signed-off-by: Jens Wiklander &lt;jens.wiklander@linaro.org&gt;
</content>
</entry>
<entry>
<title>compat_ioctl: move more drivers to compat_ptr_ioctl</title>
<updated>2019-10-23T15:23:44Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2018-09-11T19:59:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1832f2d8ff69138aa70d3cb3b4ea3c2058e73aea'/>
<id>urn:sha1:1832f2d8ff69138aa70d3cb3b4ea3c2058e73aea</id>
<content type='text'>
The .ioctl and .compat_ioctl file operations have the same prototype so
they can both point to the same function, which works great almost all
the time when all the commands are compatible.

One exception is the s390 architecture, where a compat pointer is only
31 bit wide, and converting it into a 64-bit pointer requires calling
compat_ptr(). Most drivers here will never run in s390, but since we now
have a generic helper for it, it's easy enough to use it consistently.

I double-checked all these drivers to ensure that all ioctl arguments
are used as pointers or are ignored, but are not interpreted as integer
values.

Acked-by: Jason Gunthorpe &lt;jgg@mellanox.com&gt;
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Acked-by: Mauro Carvalho Chehab &lt;mchehab+samsung@kernel.org&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Acked-by: David Sterba &lt;dsterba@suse.com&gt;
Acked-by: Darren Hart (VMware) &lt;dvhart@infradead.org&gt;
Acked-by: Jonathan Cameron &lt;Jonathan.Cameron@huawei.com&gt;
Acked-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Acked-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
</content>
</entry>
<entry>
<title>tee/shm: untag user pointers in tee_shm_register</title>
<updated>2019-09-26T00:51:41Z</updated>
<author>
<name>Andrey Konovalov</name>
<email>andreyknvl@google.com</email>
</author>
<published>2019-09-25T23:48:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=78063a9dd9637c0450cf6eacc03f42eb1295917f'/>
<id>urn:sha1:78063a9dd9637c0450cf6eacc03f42eb1295917f</id>
<content type='text'>
This patch is a part of a series that extends kernel ABI to allow to pass
tagged user pointers (with the top byte set to something else other than
0x00) as syscall arguments.

tee_shm_register()-&gt;optee_shm_unregister()-&gt;check_mem_type() uses provided
user pointers for vma lookups (via __check_mem_type()), which can only by
done with untagged pointers.

Untag user pointers in this function.

Link: http://lkml.kernel.org/r/4b993f33196b3566ac81285ff8453219e2079b45.1563904656.git.andreyknvl@google.com
Signed-off-by: Andrey Konovalov &lt;andreyknvl@google.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Acked-by: Jens Wiklander &lt;jens.wiklander@linaro.org&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
Cc: Eric Auger &lt;eric.auger@redhat.com&gt;
Cc: Felix Kuehling &lt;Felix.Kuehling@amd.com&gt;
Cc: Khalid Aziz &lt;khalid.aziz@oracle.com&gt;
Cc: Mauro Carvalho Chehab &lt;mchehab+samsung@kernel.org&gt;
Cc: Mike Rapoport &lt;rppt@linux.ibm.com&gt;
Cc: Vincenzo Frascino &lt;vincenzo.frascino@arm.com&gt;
Cc: Will Deacon &lt;will@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>tee: optee: add might_sleep for RPC requests</title>
<updated>2019-07-08T20:38:56Z</updated>
<author>
<name>Rouven Czerwinski</name>
<email>r.czerwinski@pengutronix.de</email>
</author>
<published>2019-07-03T10:03:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9f02b8f61f29f4518581770d57bfffe99b1ea599'/>
<id>urn:sha1:9f02b8f61f29f4518581770d57bfffe99b1ea599</id>
<content type='text'>
If the kernel is compiled with CONFIG_PREEMPT_VOLUNTARY and OP-TEE is
executing a long running workload, the following errors are raised:

[ 1705.971228] rcu: INFO: rcu_sched detected stalls on CPUs/tasks:
[ 1705.977195] rcu:     (detected by 0, t=2102 jiffies, g=51977, q=3)
[ 1705.983152] rcu: All QSes seen, last rcu_sched kthread activity 2102 (140596-138494), jiffies_till_next_fqs=1, root -&gt;qsmask 0x0
[ 1705.994729] optee-xtest     R  running task        0   169    157 0x00000002

While OP-TEE is returning regularly to the kernel due to timer
interrupts, the OPTEE_SMC_FUNC_FOREIGN_INTR case does not contain an
explicit rescheduling point. Add a might_sleep() to the RPC request case
to ensure that the kernel can reschedule another task if OP-TEE requests
RPC handling.

Signed-off-by: Rouven Czerwinski &lt;r.czerwinski@pengutronix.de&gt;
Signed-off-by: Jens Wiklander &lt;jens.wiklander@linaro.org&gt;
</content>
</entry>
<entry>
<title>treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282</title>
<updated>2019-06-05T15:36:37Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2019-05-29T14:17:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=9c92ab61914157664a2fbdf926df0eb937838e45'/>
<id>urn:sha1:9c92ab61914157664a2fbdf926df0eb937838e45</id>
<content type='text'>
Based on 1 normalized pattern(s):

  this software is licensed under the terms of the gnu general public
  license version 2 as published by the free software foundation and
  may be copied distributed and modified under those terms this
  program is distributed in the hope that it will be useful but
  without any warranty without even the implied warranty of
  merchantability or fitness for a particular purpose see the gnu
  general public license for more details

extracted by the scancode license scanner the SPDX license identifier

  GPL-2.0-only

has been chosen to replace the boilerplate/reference in 285 file(s).

Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Reviewed-by: Alexios Zavras &lt;alexios.zavras@intel.com&gt;
Reviewed-by: Allison Randal &lt;allison@lohutok.net&gt;
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190529141900.642774971@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
