Re: [PATCH v3 10/15] x86/paravirt: simplify paravirt macros
Hi Juergen, I love your patch! Perhaps something to improve: [auto build test WARNING on linus/master] [also build test WARNING on v5.10] [cannot apply to xen-tip/linux-next tip/x86/core tip/x86/asm next-20201217] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Juergen-Gross/x86-major-paravirt-cleanup/20201217-173646 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git accefff5b547a9a1d959c7e76ad539bf2480e78b config: x86_64-randconfig-a016-20201217 (attached as .config) compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project cee1e7d14f4628d6174b33640d502bff3b54ae45) reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # install x86_64 cross compiling tool for clang build # apt-get install binutils-x86-64-linux-gnu # https://github.com/0day-ci/linux/commit/0d13a33e925f799d8487bcc597e2dc016d1fdd16 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Juergen-Gross/x86-major-paravirt-cleanup/20201217-173646 git checkout 0d13a33e925f799d8487bcc597e2dc016d1fdd16 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): In file included from arch/x86/kernel/asm-offsets.c:13: In file included from include/linux/suspend.h:5: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:22: In file included from include/linux/writeback.h:14: In file included from include/linux/blk-cgroup.h:23: In file included from include/linux/blkdev.h:26: In file included from include/linux/scatterlist.h:9: In file included from arch/x86/include/asm/io.h:244: >> arch/x86/include/asm/paravirt.h:44:2: warning: variable '__eax' is >> uninitialized when used within its own initialization [-Wuninitialized] PVOP_VCALL0(mmu.flush_tlb_user); ^~~ arch/x86/include/asm/paravirt_types.h:504:2: note: expanded from macro 'PVOP_VCALL0' __PVOP_VCALL(op) ^~~~ arch/x86/include/asm/paravirt_types.h:492:8: note: expanded from macro '__PVOP_VCALL' (void)PVOP_CALL(long, op, CLBR_ANY, PVOP_VCALL_CLOBBERS,\ ^~~ arch/x86/include/asm/paravirt_types.h:471:3: note: expanded from macro 'PVOP_CALL' PVOP_CALL_ARGS; \ ^~ arch/x86/include/asm/paravirt_types.h:431:41: note: expanded from macro 'PVOP_CALL_ARGS' __edx = __edx, __ecx = __ecx, __eax = __eax; ~ ^ In file included from arch/x86/kernel/asm-offsets.c:13: In file included from include/linux/suspend.h:5: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:22: In file included from include/linux/writeback.h:14: In file included from include/linux/blk-cgroup.h:23: In file included from include/linux/blkdev.h:26: In file included from include/linux/scatterlist.h:9: In file included from arch/x86/include/asm/io.h:244: arch/x86/include/asm/paravirt.h:49:2: warning: variable '__eax' is uninitialized when used within its own initialization [-Wuninitialized] PVOP_VCALL0(mmu.flush_tlb_kernel); ^ arch/x86/include/asm/paravirt_types.h:504:2: note: expanded from macro 'PVOP_VCALL0' __PVOP_VCALL(op) ^~~~ arch/x86/include/asm/paravirt_types.h:492:8: note: expanded from macro '__PVOP_VCALL' (void)PVOP_CALL(long, op, CLBR_ANY, PVOP_VCALL_CLOBBERS,\ ^~~ arch/x86/include/asm/paravirt_types.h:471:3: note: expanded from macro 'PVOP_CALL' PVOP_CALL_ARGS; \ ^~ arch/x86/include/asm/paravirt_types.h:431:41: note: expanded from macro 'PVOP_CALL_ARGS' __edx = __edx, __ecx = __ecx, __eax = __eax; ~ ^ In file included from arch/x86/kernel/asm-offsets.c:13: In file included from include/linux/suspend.h:5: In file included from include/linux/swap.h:9: In file included from include/linux/memcontrol.h:22: In file included from
[PATCH v3 10/15] x86/paravirt: simplify paravirt macros
The central pvops call macros PVOP_CALL() and PVOP_VCALL() are looking very similar now. The main differences are using PVOP_VCALL_ARGS or PVOP_CALL_ARGS, which are identical, and the return value handling. So drop PVOP_VCALL_ARGS and instead of PVOP_VCALL() just use (void)PVOP_CALL(long, ...). Note that it isn't easily possible to just redefine PVOP_VCALL() to use PVOP_CALL() instead, as this would require further hiding of commas in macro parameters. Signed-off-by: Juergen Gross --- V3: - new patch --- arch/x86/include/asm/paravirt_types.h | 25 - 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h index 42f9eef84131..a9efd4dad820 100644 --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm/paravirt_types.h @@ -408,11 +408,9 @@ int paravirt_disable_iospace(void); * makes sure the incoming and outgoing types are always correct. */ #ifdef CONFIG_X86_32 -#define PVOP_VCALL_ARGS \ +#define PVOP_CALL_ARGS \ unsigned long __eax = __eax, __edx = __edx, __ecx = __ecx; -#define PVOP_CALL_ARGS PVOP_VCALL_ARGS - #define PVOP_CALL_ARG1(x) "a" ((unsigned long)(x)) #define PVOP_CALL_ARG2(x) "d" ((unsigned long)(x)) #define PVOP_CALL_ARG3(x) "c" ((unsigned long)(x)) @@ -428,12 +426,10 @@ int paravirt_disable_iospace(void); #define VEXTRA_CLOBBERS #else /* CONFIG_X86_64 */ /* [re]ax isn't an arg, but the return val */ -#define PVOP_VCALL_ARGS\ +#define PVOP_CALL_ARGS \ unsigned long __edi = __edi, __esi = __esi, \ __edx = __edx, __ecx = __ecx, __eax = __eax; -#define PVOP_CALL_ARGS PVOP_VCALL_ARGS - #define PVOP_CALL_ARG1(x) "D" ((unsigned long)(x)) #define PVOP_CALL_ARG2(x) "S" ((unsigned long)(x)) #define PVOP_CALL_ARG3(x) "d" ((unsigned long)(x)) @@ -492,25 +488,12 @@ int paravirt_disable_iospace(void); PVOP_CALL(rettype, op.func, CLBR_RET_REG, \ PVOP_CALLEE_CLOBBERS, , ##__VA_ARGS__) - -#define PVOP_VCALL(op, clbr, call_clbr, extra_clbr, ...) \ - ({ \ - PVOP_VCALL_ARGS;\ - PVOP_TEST_NULL(op); \ - asm volatile(paravirt_alt(PARAVIRT_CALL)\ -: call_clbr, ASM_CALL_CONSTRAINT \ -: paravirt_type(op), \ - paravirt_clobber(clbr), \ - ##__VA_ARGS__\ -: "memory", "cc" extra_clbr); \ - }) - #define __PVOP_VCALL(op, ...) \ - PVOP_VCALL(op, CLBR_ANY, PVOP_VCALL_CLOBBERS, \ + (void)PVOP_CALL(long, op, CLBR_ANY, PVOP_VCALL_CLOBBERS,\ VEXTRA_CLOBBERS, ##__VA_ARGS__) #define __PVOP_VCALLEESAVE(op, ...)\ - PVOP_VCALL(op.func, CLBR_RET_REG, \ + (void)PVOP_CALL(long, op.func, CLBR_RET_REG,\ PVOP_VCALLEE_CLOBBERS, , ##__VA_ARGS__) -- 2.26.2