Commit efc759ad authored by danh-arm's avatar danh-arm Committed by GitHub
Browse files

Merge pull request #686 from danh-arm/dh/remove-inv-dcache-after-auth

Remove dcache invalidation after image authentication
parents 937108a0 ad4494dc
...@@ -321,12 +321,16 @@ int load_image(meminfo_t *mem_layout, ...@@ -321,12 +321,16 @@ int load_image(meminfo_t *mem_layout,
(void *) image_base, image_size); (void *) image_base, image_size);
} }
#if !TRUSTED_BOARD_BOOT
/* /*
* File has been successfully loaded. * File has been successfully loaded.
* Flush the image in Trusted SRAM so that the next exception level can * Flush the image to main memory so that it can be executed later by
* see it. * any CPU, regardless of cache and MMU state.
* When TBB is enabled the image is flushed later, after image
* authentication.
*/ */
flush_dcache_range(image_base, image_size); flush_dcache_range(image_base, image_size);
#endif /* TRUSTED_BOARD_BOOT */
INFO("Image id=%u loaded at address %p, size = 0x%zx\n", image_id, INFO("Image id=%u loaded at address %p, size = 0x%zx\n", image_id,
(void *) image_base, image_size); (void *) image_base, image_size);
...@@ -388,10 +392,12 @@ int load_auth_image(meminfo_t *mem_layout, ...@@ -388,10 +392,12 @@ int load_auth_image(meminfo_t *mem_layout,
image_data->image_size); image_data->image_size);
return -EAUTH; return -EAUTH;
} }
/*
/* After working with data, invalidate the data cache */ * File has been successfully loaded and authenticated.
inv_dcache_range(image_data->image_base, * Flush the image to main memory so that it can be executed later by
(size_t)image_data->image_size); * any CPU, regardless of cache and MMU state.
*/
flush_dcache_range(image_data->image_base, image_data->image_size);
#endif /* TRUSTED_BOARD_BOOT */ #endif /* TRUSTED_BOARD_BOOT */
return 0; return 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment