Commit 84c3ae30 authored by Julien Grall's avatar Julien Grall

xen/arm: livepatch: Prevent CPUs to fetch stale instructions after livepatching

During livepatch, a single CPU will take care of applying the patch and
all the others will wait for the action to complete. They will then once
execute arch_livepatch_post_action() to flush the pipeline.

Per B2.2.5 "Concurrent modification and execution of instructions" in
DDI 0487E.a, flushing the instruction cache is not enough to ensure new
instructions are seen. All the PEs should also do an isb() to
synchronize the fetched instruction stream.
Signed-off-by: default avatarJulien Grall <julien.grall@arm.com>
Acked-by: default avatarRoss Lagerwall <ross.lagerwall@citrix.com>
Reviewed-by: default avatarVolodymyr Babchuk <volodymyr_babchuk@epam.com>
parent ae84f553
......@@ -88,7 +88,8 @@ void arch_livepatch_revert(const struct livepatch_func *func)
void arch_livepatch_post_action(void)
{
/* arch_livepatch_revive has nuked the instruction cache. */
/* Discard any stale instructions that may have been fetched. */
isb();
}
void arch_livepatch_mask(void)
......
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