|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 5/6] xen/arm: smccc: Add wrapper to automatically select the calling convention
On 28/08/18 16:50, Volodymyr Babchuk wrote: Hi Julien, Hi, On 28.08.18 18:27, Julien Grall wrote:Hi Volodymyr, On 28/08/18 16:10, Volodymyr Babchuk wrote:On 28.08.18 17:43, Julien Grall wrote: [...]I have looked at cpus_have_const_cap() and haven't found good way to optimize it with the current infrastructure in Xen. Feel free to suggest improvement.Another thing: maybe it is worth to branch to 1.0 code and leave 1.1 in a straight path of execution? This will save you one more instruction for SMCCC 1.1 call.I am not sure to understand your suggestion here. Could you expand? Spectre would not have existed if the branch predictor was so easy ;). Yes, this is the good point. So, you can add likely/unlikely not only in cpus_have_const_cap(...) but also in #define arm_smccc_smc(...)You also can't assume how the compiler will compile the code, it may end up to generate the else branch first because it is predicted to be taken more often. This is why GCC provide __builtin_expect (commonly used as unlikely/likely) to influence the compiler choice for branch prediction. There are no need to have likely/unlikely in arm_smccc_smc if it is already present in cpus_have_const_cap. 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 |