Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tee: optee: making OPTEE_SHM_NUM_PRIV_PAGES configurable via Kconfig #62

Open
wants to merge 57 commits into
base: optee
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
aea09b8
[v4.14] tee: optee: fix uninitialized symbol 'parg'
jenswi-linaro May 15, 2017
371a714
[v4.14] tee: add forward declaration for struct device
jforissier May 31, 2017
2cecc25
[v4.14] tee: tee_shm: Constify dma_buf_ops structures.
ArvindYadavCs Jul 1, 2017
8830318
[v4.14] tee: optee: add const to tee_driver_ops and tee_desc structures
goyalbhumika Jun 29, 2017
dbc1a44
[v4.14] tee: optee: interruptible RPC sleep
tiger-yu99 May 5, 2017
dec5f33
[v4.14] tee: indicate privileged dev in gen_caps
jenswi-linaro Feb 16, 2017
481ebd2
[v4.14] tee: optee: sync with new naming of interrupts
Feb 16, 2017
cb4b3c0
[v4.15] optee: fix invalid of_node_put() in optee_driver_init()
jenswi-linaro Oct 9, 2017
ca554c6
[v4.16] tee: add tee_param_is_memref() for driver use
jenswi-linaro Dec 23, 2016
e7f9de6
[v4.16] tee: add TEE_IOCTL_PARAM_ATTR_META
jenswi-linaro Dec 23, 2016
acd2bed
[v4.16] optee: support asynchronous supplicant requests
jenswi-linaro Dec 23, 2016
fabaadf
[v4.16] tee: flexible shared memory pool creation
jenswi-linaro Nov 29, 2017
1ee9189
[v4.16] tee: add register user memory
jenswi-linaro Nov 29, 2017
d5cb8b6
[v4.16] tee: shm: add accessors for buffer size and page offset
lorc Nov 29, 2017
b641b08
[v4.16] tee: shm: add page accessor functions
lorc Nov 29, 2017
229153c
[v4.16] tee: optee: Update protocol definitions
lorc Nov 29, 2017
0390364
[v4.16] tee: optee: add page list manipulation functions
lorc Nov 29, 2017
c9b5a0e
[v4.16] tee: optee: add shared buffer registration functions
lorc Nov 29, 2017
fda1b53
[v4.16] tee: optee: add registered shared parameters handling
lorc Nov 29, 2017
7357af4
[v4.16] tee: optee: add registered buffers handling into RPC calls
lorc Nov 29, 2017
a2f3da6
[v4.16] tee: optee: store OP-TEE capabilities in private data
lorc Nov 29, 2017
7cb2a5d
[v4.16] tee: optee: add optee-specific shared pool implementation
lorc Nov 29, 2017
69afa66
[v4.16] tee: optee: enable dynamic SHM support
lorc Nov 29, 2017
0987f08
[v4.16] tee: use reference counting for tee_context
lorc Nov 29, 2017
e454275
[v4.16] tee: shm: inline tee_shm_get_id()
lorc Nov 29, 2017
fd76ad9
[v4.16] tee: optee: fix header dependencies
arndb Dec 21, 2017
ab4a37e
[v4.16] tee: add start argument to shm_register callback
jenswi-linaro Dec 28, 2017
130df49
[v4.16] tee: optee: check type of registered shared memory
jenswi-linaro Dec 28, 2017
1be3dd5
[v4.16] tee: shm: make function __tee_shm_alloc static
Dec 22, 2017
d02a71b
[v4.16] tee: shm: don't put_page on null shm->pages
Dec 22, 2017
6064770
[v4.16] tee: shm: Potential NULL dereference calling tee_shm_register()
Jan 6, 2018
6434551
[v4.16] arm/arm64: smccc: Make function identifiers an unsigned quantity
Feb 6, 2018
26cc3f4
Add upstream-tee-subsys-patches.txt
jenswi-linaro Apr 4, 2018
9762697
tee: add kernel internal client interface
jenswi-linaro Nov 19, 2015
28f2ad9
tee: new ioctl to a register tee_shm from a dmabuf file descriptor
etienne-lms Oct 27, 2016
82c82e9
arm64: dt: Remove timer from mt8173 **not for mainline**
jbech-linaro Apr 1, 2016
55a8faf
arm64: dt: PSCI for foundation-v8 **not for mainline**
jenswi-linaro Aug 17, 2016
659108f
arm64: dt: use GICv2 for foundation-v8 **not for mainline**
jenswi-linaro Aug 17, 2016
4875c69
arm64: dt: OP-TEE for foundation-v8 **not for mainline**
jenswi-linaro Aug 17, 2016
7cd3bd8
arm64: dt: OP-TEE for Juno **not for mainline**
jenswi-linaro Mar 29, 2016
6ee6b1a
arm64: dt: Add no-map to the reserved-memory node for OP-TEE for foun…
jenswi-linaro Dec 2, 2016
dbea9a5
arm64: dt: Add no-map to the reserved-memory node for OP-TEE for juno…
jenswi-linaro Jan 3, 2017
08e5864
arm64: dt: Add OP-TEE firmware to mt8173 **not for mainline**
jbech-linaro Mar 24, 2016
b447ecb
OP-TEE Benchmark **not for mainline**
Oct 25, 2016
9f9806e
tee: optee: optee_bench.h: remove useless include **not for mainline**
jforissier May 31, 2017
1af7f79
staging/ion: add Allwinner ION "secure" heap
etienne-lms Aug 14, 2017
ffcd4cc
ion: "unmapped" heap for secure data path
etienne-lms Aug 14, 2017
ee589e6
staging/ion: condition unmapped heap to supported architectures
etienne-lms Sep 8, 2017
16843e5
staging/ion: ARM64 supports ION_UNMAPPED_HEAP
etienne-lms Sep 14, 2017
0b488c9
staging:ion: add a no-map property to ion dmabuf attachment
etienne-lms Oct 9, 2017
5f263e9
tee: correct max value for id allocation
MrVan Jan 15, 2018
886746b
tee: optee: GET_OS_REVISION: document a2 as a build identifier
jforissier Nov 24, 2017
bfbafe0
tee: optee: report OP-TEE revision information
jforissier Nov 24, 2017
3ed4ce4
tee: optee: log message if dynamic shm is enabled
Apr 11, 2018
94c2f2e
tee: fix unbalanced context refcount in register shm from fd
etienne-lms Apr 16, 2018
f5d5641
optee: check shm reference are consistent in offset/size
etienne-lms Apr 20, 2018
b64d471
tee: optee: making OPTEE_SHM_NUM_PRIV_PAGES configurable via Kconfig
sahilnxp May 29, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions arch/arm64/boot/dts/arm/foundation-v8.dts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
#include "foundation-v8.dtsi"

/ {
gic: interrupt-controller@2c001000 {
gic: interrupt-controller@2f000000 {
compatible = "arm,cortex-a15-gic", "arm,cortex-a9-gic";
#interrupt-cells = <3>;
#address-cells = <2>;
interrupt-controller;
reg = <0x0 0x2c001000 0 0x1000>,
<0x0 0x2c002000 0 0x2000>,
<0x0 0x2c004000 0 0x2000>,
<0x0 0x2c006000 0 0x2000>;
reg = <0x0 0x2f000000 0 0x10000>,
<0x0 0x2c000000 0 0x2000>,
<0x0 0x2c010000 0 0x2000>,
<0x0 0x2c02F000 0 0x2000>;
interrupts = <1 9 0xf04>;
};
};
49 changes: 32 additions & 17 deletions arch/arm64/boot/dts/arm/foundation-v8.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@

aliases {
serial0 = &v2m_serial0;
serial1 = &v2m_serial1;
serial2 = &v2m_serial2;
serial3 = &v2m_serial3;
};

psci {
compatible = "arm,psci";
method = "smc";
cpu_suspend = <0xc4000001>;
cpu_off = <0x84000002>;
cpu_on = <0xc4000003>;
};


cpus {
#address-cells = <2>;
#size-cells = <0>;
Expand All @@ -32,32 +40,28 @@
device_type = "cpu";
compatible = "arm,armv8";
reg = <0x0 0x0>;
enable-method = "spin-table";
cpu-release-addr = <0x0 0x8000fff8>;
enable-method = "psci";
next-level-cache = <&L2_0>;
};
cpu@1 {
device_type = "cpu";
compatible = "arm,armv8";
reg = <0x0 0x1>;
enable-method = "spin-table";
cpu-release-addr = <0x0 0x8000fff8>;
enable-method = "psci";
next-level-cache = <&L2_0>;
};
cpu@2 {
device_type = "cpu";
compatible = "arm,armv8";
reg = <0x0 0x2>;
enable-method = "spin-table";
cpu-release-addr = <0x0 0x8000fff8>;
enable-method = "psci";
next-level-cache = <&L2_0>;
};
cpu@3 {
device_type = "cpu";
compatible = "arm,armv8";
reg = <0x0 0x3>;
enable-method = "spin-table";
cpu-release-addr = <0x0 0x8000fff8>;
enable-method = "psci";
next-level-cache = <&L2_0>;
};

Expand All @@ -72,6 +76,17 @@
<0x00000008 0x80000000 0 0x80000000>;
};

reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;

optee@0x83000000 {
reg = <0x00000000 0x83000000 0 0x01000000>;
no-map;
};
};

timer {
compatible = "arm,armv8-timer";
interrupts = <1 13 0xf08>,
Expand Down Expand Up @@ -202,14 +217,6 @@
clock-names = "uartclk", "apb_pclk";
};

v2m_serial1: uart@0a0000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0x0a0000 0x1000>;
interrupts = <6>;
clocks = <&v2m_clk24mhz>, <&v2m_clk24mhz>;
clock-names = "uartclk", "apb_pclk";
};

v2m_serial2: uart@0b0000 {
compatible = "arm,pl011", "arm,primecell";
reg = <0x0b0000 0x1000>;
Expand All @@ -233,4 +240,12 @@
};
};
};

firmware {
optee {
compatible = "linaro,optee-tz";
method = "smc";
};
};

};
20 changes: 20 additions & 0 deletions arch/arm64/boot/dts/arm/juno-base.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,19 @@
<0x00000008 0x80000000 0x1 0x80000000>;
};

reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;

/* Shared memory between secure and non-secure world */
optee@0xfee00000 {
reg = <0x00000000 0xfee00000 0 0x00200000>;
no-map;
};
};


smb@8000000 {
compatible = "simple-bus";
#address-cells = <2>;
Expand Down Expand Up @@ -738,4 +751,11 @@
interrupt-map-mask = <0 0>;
interrupt-map = <0 0 &gic 0 0 0 168 IRQ_TYPE_LEVEL_HIGH>;
};

firmware {
optee {
compatible = "linaro,optee-tz";
method = "smc";
};
};
};
7 changes: 7 additions & 0 deletions arch/arm64/boot/dts/mediatek/mt8173-evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@
gpio = <&pio 9 GPIO_ACTIVE_HIGH>;
enable-active-high;
};

firmware {
optee {
compatible = "linaro,optee-tz";
method = "smc";
};
};
};

&cec {
Expand Down
9 changes: 0 additions & 9 deletions arch/arm64/boot/dts/mediatek/mt8173.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -339,15 +339,6 @@
reg = <0 0x10007000 0 0x100>;
};

timer: timer@10008000 {
compatible = "mediatek,mt8173-timer",
"mediatek,mt6577-timer";
reg = <0 0x10008000 0 0x1000>;
interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_LOW>;
clocks = <&infracfg CLK_INFRA_CLK_13M>,
<&topckgen CLK_TOP_RTC_SEL>;
};

pwrap: pwrap@1000d000 {
compatible = "mediatek,mt8173-pwrap";
reg = <0 0x1000d000 0 0x1000>;
Expand Down
32 changes: 32 additions & 0 deletions drivers/staging/android/ion/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,35 @@ config ION_CMA_HEAP
Choose this option to enable CMA heaps with Ion. This heap is backed
by the Contiguous Memory Allocator (CMA). If your system has these
regions, you should say Y here.

config ION_UNMAPPED_HEAP
bool "ION unmapped heap support"
depends on ION && (ARM || ARM64)
help
Choose this option to enable UNMAPPED heaps with Ion. This heap is
backed in specific memory pools, carveout from the Linux memory.
Unless you know your system has these regions, you should say N here.

config ION_DUMMY_UNMAPPED_HEAP
bool "ION dummy driver define an ION unmapped heap"
depends on ION_UNMAPPED_HEAP
help
Dummy ION driver will create a unmapped heap from physical
location provided through CONFIG_ION_DUMMY_UNMAPPED_BASE and
CONFIG_ION_DUMMY_UNMAPPED_SIZE.

config ION_DUMMY_UNMAPPED_BASE
hex "Physical base address of the ION unmapped heap"
depends on ION_DUMMY_UNMAPPED_HEAP
default 0
help
Allows one the statically define an unmapped heap from the
ION dummy driver to exercice unamped heaps buffer managment.

config ION_DUMMY_UNMAPPED_SIZE
hex "Physical byte size of the ION unmapped heap"
depends on ION_DUMMY_UNMAPPED_HEAP
default 0
help
Allows one the statically define an unmapped heap from the
ION dummy driver to exercice unamped heaps buffer managment.
1 change: 1 addition & 0 deletions drivers/staging/android/ion/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ obj-$(CONFIG_ION_SYSTEM_HEAP) += ion_system_heap.o ion_page_pool.o
obj-$(CONFIG_ION_CARVEOUT_HEAP) += ion_carveout_heap.o
obj-$(CONFIG_ION_CHUNK_HEAP) += ion_chunk_heap.o
obj-$(CONFIG_ION_CMA_HEAP) += ion_cma_heap.o
obj-$(CONFIG_ION_UNMAPPED_HEAP) += ion_unmapped_heap.o
12 changes: 12 additions & 0 deletions drivers/staging/android/ion/ion.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ struct ion_dma_buf_attachment {
struct device *dev;
struct sg_table *table;
struct list_head list;
bool no_map;
};

static int ion_dma_buf_attach(struct dma_buf *dmabuf, struct device *dev,
Expand All @@ -237,6 +238,9 @@ static int ion_dma_buf_attach(struct dma_buf *dmabuf, struct device *dev,
return -ENOMEM;
}

if (buffer->heap->type == ION_HEAP_TYPE_UNMAPPED)
a->no_map = true;

a->table = table;
a->dev = dev;
INIT_LIST_HEAD(&a->list);
Expand Down Expand Up @@ -274,6 +278,9 @@ static struct sg_table *ion_map_dma_buf(struct dma_buf_attachment *attachment,

table = a->table;

if (a->no_map)
return table;

if (!dma_map_sg(attachment->dev, table->sgl, table->nents,
direction)){
ret = -ENOMEM;
Expand All @@ -290,6 +297,11 @@ static void ion_unmap_dma_buf(struct dma_buf_attachment *attachment,
struct sg_table *table,
enum dma_data_direction direction)
{
struct ion_dma_buf_attachment *a = attachment->priv;

if (a->no_map)
return;

dma_unmap_sg(attachment->dev, table->sgl, table->nents, direction);
}

Expand Down
Loading