[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] x86/alternatives: adjust alternative_vcall0()



commit 1f1179c619f6b82d3f193a9da7a24c359f79fb67
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri Dec 3 11:36:46 2021 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Dec 3 11:36:46 2021 +0100

    x86/alternatives: adjust alternative_vcall0()
    
    I'm puzzled about two inconsistencies with other alternative_vcall<N>()
    here: There's a check missing that the supplied function pointer is
    actually pointing to a function taking no args. And there's a pointless
    pair of parentheses. Correct both.
    
    Fixes: 67d01cdb5518 ("x86: infrastructure to allow converting certain 
indirect calls to direct ones")
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Wei Chen <Wei.Chen@xxxxxxx>
---
 xen/include/asm-x86/alternative.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/xen/include/asm-x86/alternative.h 
b/xen/include/asm-x86/alternative.h
index 8bc59b02af..a7a82c2c03 100644
--- a/xen/include/asm-x86/alternative.h
+++ b/xen/include/asm-x86/alternative.h
@@ -218,7 +218,8 @@ extern void alternative_branches(void);
 
 #define alternative_vcall0(func) ({             \
     ALT_CALL_NO_ARG1;                           \
-    ((void)alternative_callN(0, int, func));    \
+    (void)sizeof(func());                       \
+    (void)alternative_callN(0, int, func);      \
 })
 
 #define alternative_call0(func) ({              \
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.