mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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:
1 parent
3dbe9a994a
commit
008a8a029d
3 files changed
+15
-24
No files matched your search
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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. */
|
||||
|
||||