|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 7/7] xen/arm64: Implement a fast path for handling SMCCC_ARCH_WORKAROUND_1
Hi, On 02/06/2018 04:36 PM, Volodymyr Babchuk wrote: On 5 February 2018 at 15:20, Julien Grall <julien.grall@xxxxxxx> wrote:The function SMCCC_ARCH_WORKAROUND_1 will be called by the guest for hardening the branch predictor. So we want the handling to be as fast as possible. As the mitigation is applied on every guest exit, we can check for the call before saving all the context and return very early.Have you tried any benchmarks? How big is the benefit? I have benchmarked but I can't share the result. I can give you an idea on how this could benefits Xen. Linux will call the workaround on every context switch between process. So imagine for each context switch, you have will enter in Xen and in the following order:
1) enter Xen
2) apply the workaround which means calling EL3.
3) save part of the guest context
4) call enter_hypervisor_head that will sync the vGIC state
5) detect you actually call SMCCC_ARCH_WORKAROUND_1 that will do nothing
6) call leave_hypervisor_tail that will sync back the vGIC state and
execute softirq (that could reschedule the vCPU)
7) restore the guest context
8) return to the guest
So effectively, instead of executing hundreds (if not thousands)
instructions each time, you will end up only executing less than 50
instructions.
For now, only provide a fast path for HVC64 call. Because the code rely on 2 registers, x0 and x1 are saved in advanced.Is there a typo? Should it be "advance"? Someone can easily send a follow-up patch for that if it is deemed necessary. Cheers, -- Julien Grall _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |