summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorChris Johnson <cwj@nvidia.com>2012-05-04 19:19:05 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2013-09-14 01:36:32 -0700
commit0535360b670d5ebcc1619d076fa00c23ce15457a (patch)
tree73d9ae68e5d29dd0cbddb1c70995ada477351015 /security
parentfa31be514cb2faf4f033d28584c38a29cd5fc038 (diff)
security: tf_driver: update with latest TL drop
Tegra 2 version: TF_TEGRA2_AA01.07.34078 Tegra 3 version: TF_TEGRA3_AB01.06.34049 Bug 950169 Signed-off-by: Chris Johnson <cwj@nvidia.com> Reviewed-on: http://git-master/r/89927 (cherry picked from commit 28fc4a5b80a0f6db3e6dc50efd8c0412e2ae11bf) Change-Id: I41413b4f00d243e3bb56d44fb32eea29d0291401 Reviewed-on: http://git-master/r/90445 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Chris Johnson <cwj@nvidia.com> Tested-by: Chris Johnson <cwj@nvidia.com> Reviewed-by: Karan Jhavar <kjhavar@nvidia.com> Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com> Conflicts: security/tf_driver/tf_comm.c Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Rebase-Id: R7d6137a8401fe5dea232f324ad65f398f9cf67f3
Diffstat (limited to 'security')
-rw-r--r--security/tf_driver/s_version.h4
-rw-r--r--security/tf_driver/tf_comm.c57
-rw-r--r--security/tf_driver/tf_device.c2
3 files changed, 20 insertions, 43 deletions
diff --git a/security/tf_driver/s_version.h b/security/tf_driver/s_version.h
index 6244d3fe7e8d..ba4d48c6f417 100644
--- a/security/tf_driver/s_version.h
+++ b/security/tf_driver/s_version.h
@@ -33,12 +33,12 @@
*/
#define S_VERSION_OS "A" /* "A" for all Android */
-#define S_VERSION_PLATFORM "B" /* "B" for Tegra3 */
+#define S_VERSION_PLATFORM "A" /* "A" for Tegra2 */
/*
* This version number must be updated for each new release
*/
-#define S_VERSION_MAIN "01.03"
+#define S_VERSION_MAIN "01.07"
/*
* If this is a patch or engineering version use the following
diff --git a/security/tf_driver/tf_comm.c b/security/tf_driver/tf_comm.c
index 16915beb406d..e71f37d79dc2 100644
--- a/security/tf_driver/tf_comm.c
+++ b/security/tf_driver/tf_comm.c
@@ -208,6 +208,7 @@ struct tf_coarse_page_table *tf_alloc_coarse_page_table(
}
array->type = type;
+ array->ref_count = 0;
INIT_LIST_HEAD(&(array->list));
/* now allocate the actual page the page descriptor describes */
@@ -236,7 +237,7 @@ struct tf_coarse_page_table *tf_alloc_coarse_page_table(
*/
coarse_pg_table =
&(array->coarse_page_tables[i]);
- array->ref_count = 1;
+ array->ref_count++;
} else {
/*
* The other elements are added to the free list
@@ -455,12 +456,11 @@ u32 tf_get_l2_descriptor_common(u32 vaddr, struct mm_struct *mm)
/*
* Linux's pte doesn't keep track of TEX value.
* Have to jump to hwpte see include/asm/pgtable.h
- * (-2k before 2.6.38, then +2k)
*/
#ifdef PTE_HWTABLE_SIZE
- hwpte = (u32 *) (ptep+PTE_HWTABLE_PTRS);
+ hwpte = (u32 *) (ptep + PTE_HWTABLE_PTRS);
#else
- hwpte = (u32 *) (ptep-PTRS_PER_PTE);
+ hwpte = (u32 *) (ptep - PTRS_PER_PTE);
#endif
if (((*hwpte) & L2_DESCRIPTOR_ADDR_MASK) !=
((*ptep) & L2_DESCRIPTOR_ADDR_MASK))
@@ -839,52 +839,28 @@ int tf_fill_descriptor_table(
goto error;
}
}
- } else if (is_vmalloc_addr((void *)buffer_offset_vaddr)) {
- /* Kernel-space memory obtained through vmalloc */
- dprintk(KERN_INFO
- "tf_fill_descriptor_table: "
- "vmalloc'ed buffer starting at %p\n",
- (void *)buffer_offset_vaddr);
- for (j = page_shift; j < pages_to_get; j++) {
- struct page *page;
- void *addr =
- (void *)(buffer_offset_vaddr +
- (j - page_shift) * PAGE_SIZE);
- page = vmalloc_to_page(addr);
- if (page == NULL) {
- dprintk(KERN_ERR
- "tf_fill_descriptor_table: "
- "cannot map %p (vmalloc) "
- "to page\n",
- addr);
- ret = -EFAULT;
- goto error;
- }
- coarse_pg_table->descriptors[j] = (u32)page;
- get_page(page);
-
- /* change coarse page "page address" */
- tf_get_l2_page_descriptor(
- &coarse_pg_table->descriptors[j],
- flags,
- &init_mm);
- }
} else {
- /* Kernel-space memory given by a virtual address */
+ /* Kernel-space memory */
dprintk(KERN_INFO
"tf_fill_descriptor_table: "
- "buffer starting at virtual address %p\n",
+ "buffer starting at %p\n",
(void *)buffer_offset_vaddr);
for (j = page_shift; j < pages_to_get; j++) {
struct page *page;
void *addr =
(void *)(buffer_offset_vaddr +
(j - page_shift) * PAGE_SIZE);
- page = virt_to_page(addr);
+
+ if (is_vmalloc_addr(
+ (void *) buffer_offset_vaddr))
+ page = vmalloc_to_page(addr);
+ else
+ page = virt_to_page(addr);
+
if (page == NULL) {
dprintk(KERN_ERR
"tf_fill_descriptor_table: "
- "cannot map %p (virtual) "
+ "cannot map %p (vmalloc) "
"to page\n",
addr);
ret = -EFAULT;
@@ -1256,8 +1232,9 @@ static int tf_send_recv(struct tf_comm *comm,
dprintk(KERN_INFO "[pid=%d] tf_send_recv(%p)\n",
current->pid, command);
-#ifdef CONFIG_TF_ZEBRA
- tf_clock_timer_start();
+#ifdef CONFIG_FREEZER
+ saved_flags = current->flags;
+ current->flags |= PF_KTHREAD;
#endif
#ifdef CONFIG_FREEZER
diff --git a/security/tf_driver/tf_device.c b/security/tf_driver/tf_device.c
index ad44b46c2067..5d5f3c63ce88 100644
--- a/security/tf_driver/tf_device.c
+++ b/security/tf_driver/tf_device.c
@@ -393,7 +393,7 @@ static int __init tf_device_register(void)
}
#ifdef CONFIG_TF_DRIVER_CRYPTO_FIPS
- error = tf_self_test_post_init(&(dev_stats->kobj));
+ error = tf_self_test_post_init(&(g_tf_dev.kobj));
/* N.B. error > 0 indicates a POST failure, which will not
prevent the module from loading. */
if (error < 0) {