livepatch, arm[32|64]: Share arch_livepatch_revert

It is exactly the same in both platforms.

No functional change.

Acked-by: Julien Grall <julien.grall@arm.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
This commit is contained in:
Konrad Rzeszutek Wilk committed 2016-09-27 22:07:08 -04:00
1 parent 3dbe9a994a
commit 008a8a029d
3 files changed
+15 -24

No files matched your search

+1 -12
View File
@@ -75,18 +75,7 @@ void arch_livepatch_apply(struct livepatch_func *func)
clean_and_invalidate_dcache_va_range(new_ptr, sizeof (*new_ptr) * len);
}
void arch_livepatch_revert(const struct livepatch_func *func)
{
uint32_t *new_ptr;
unsigned int len;
new_ptr = func->old_addr - (void *)_start + vmap_of_xen_text;
len = livepatch_insn_len(func);
memcpy(new_ptr, func->opaque, len);
clean_and_invalidate_dcache_va_range(new_ptr, len);
}
/* arch_livepatch_revert shared with ARM 32/ARM 64. */
int arch_livepatch_verify_elf(const struct livepatch_elf *elf)
{
+1 -12
View File
@@ -62,18 +62,7 @@ void arch_livepatch_apply(struct livepatch_func *func)
clean_and_invalidate_dcache_va_range(new_ptr, sizeof (*new_ptr) * len);
}
void arch_livepatch_revert(const struct livepatch_func *func)
{
uint32_t *new_ptr;
unsigned int len;
new_ptr = func->old_addr - (void *)_start + vmap_of_xen_text;
len = livepatch_insn_len(func);
memcpy(new_ptr, func->opaque, len);
clean_and_invalidate_dcache_va_range(new_ptr, len);
}
/* arch_livepatch_revert shared with ARM 32/ARM 64. */
int arch_livepatch_verify_elf(const struct livepatch_elf *elf)
{
+13
View File
@@ -69,6 +69,19 @@ int arch_livepatch_verify_func(const struct livepatch_func *func)
return 0;
}
void arch_livepatch_revert(const struct livepatch_func *func)
{
uint32_t *new_ptr;
unsigned int len;
new_ptr = func->old_addr - (void *)_start + vmap_of_xen_text;
len = livepatch_insn_len(func);
memcpy(new_ptr, func->opaque, len);
clean_and_invalidate_dcache_va_range(new_ptr, len);
}
void arch_livepatch_post_action(void)
{
/* arch_livepatch_revive has nuked the instruction cache. */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.