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?
+#define arm_smccc_smc(...) \
+ do { \
+ if ( cpus_have_const_cap(ARM_SMCCC_1_1) ) \
+ arm_smccc_1_1_smc(__VA_ARGS__); \
+ else \
+ arm_smccc_1_0_smc(__VA_ARGS__); \
+ } while ( 0 )
However, why SMCCC 1.1 should be in the straight path of execution?
It is easier to read - no negation in if(). Also, I think, branch
predictor would be happy. At least, if the following is true:
" If the branch information is not contained in the BTAC, static branch
prediction is used, whereby we assume the branch will be taken if the
branch is a conditional backwards branch or not taken if the branch is a
conditional forwards branch." [1]
[1]
http://linuxkernelhacker.blogspot.com/2014/07/branch-prediction-logic-in-arm.html
--
Volodymyr Babchuk
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel