diff options
Diffstat (limited to 'security')
-rw-r--r-- | security/tf_driver/s_version.h | 4 | ||||
-rw-r--r-- | security/tf_driver/tf_comm.c | 56 | ||||
-rw-r--r-- | security/tf_driver/tf_device.c | 2 |
3 files changed, 17 insertions, 45 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..ad45d31d80b9 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,10 +1232,6 @@ 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(); -#endif - #ifdef CONFIG_FREEZER saved_flags = current->flags; current->flags |= PF_FREEZER_NOSIG; 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) { |