linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
@ 2020-06-03 12:32 kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2020-06-03 12:32 UTC (permalink / raw)
  To: Jason, A., Donenfeld,
  Cc: kbuild-all, clang-built-linux, linux-kernel, Herbert Xu

[-- Attachment #1: Type: text/plain, Size: 6584 bytes --]

Hi Jason,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d6f9469a03d832dcd17041ed67774ffb5f3e73b3
commit: 07b586fe06625b0b610dc3d3a969c51913d143d4 crypto: x86/curve25519 - replace with formally verified implementation
date:   4 months ago
config: x86_64-randconfig-r012-20200603 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 16437992cac249f6fe1efd392d20e3469b47e39e)
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
        git checkout 07b586fe06625b0b610dc3d3a969c51913d143d4
        # 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 <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
"  movq 0(%1), %%rdx;"                                       /* f[0] */
^
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
arch/x86/crypto/curve25519-x86_64.c:609:3: error: inline assembly requires more registers than available
"  movq 0(%1), %%rdx;"                                       /* f[0] */
^
arch/x86/crypto/curve25519-x86_64.c:609:3: error: inline assembly requires more registers than available
11 errors generated.

vim +518 arch/x86/crypto/curve25519-x86_64.c

   509	
   510	/* Computes the square of a field element: out <- f * f
   511	 * Uses the 8-element buffer tmp for intermediate results */
   512	static inline void fsqr(u64 *out, const u64 *f, u64 *tmp)
   513	{
   514		asm volatile(
   515			/* Compute the raw multiplication: tmp <- f * f */
   516	
   517			/* Step 1: Compute all partial products */
 > 518			"  movq 0(%1), %%rdx;"                                       /* f[0] */
   519			"  mulxq 8(%1), %%r8, %%r14;"      "  xor %%r15, %%r15;"     /* f[1]*f[0] */
   520			"  mulxq 16(%1), %%r9, %%r10;"     "  adcx %%r14, %%r9;"     /* f[2]*f[0] */
   521			"  mulxq 24(%1), %%rax, %%rcx;"    "  adcx %%rax, %%r10;"    /* f[3]*f[0] */
   522			"  movq 24(%1), %%rdx;"                                      /* f[3] */
   523			"  mulxq 8(%1), %%r11, %%r12;"     "  adcx %%rcx, %%r11;"    /* f[1]*f[3] */
   524			"  mulxq 16(%1), %%rax, %%r13;"    "  adcx %%rax, %%r12;"    /* f[2]*f[3] */
   525			"  movq 8(%1), %%rdx;"             "  adcx %%r15, %%r13;"    /* f1 */
   526			"  mulxq 16(%1), %%rax, %%rcx;"    "  mov $0, %%r14;"        /* f[2]*f[1] */
   527	
   528			/* Step 2: Compute two parallel carry chains */
   529			"  xor %%r15, %%r15;"
   530			"  adox %%rax, %%r10;"
   531			"  adcx %%r8, %%r8;"
   532			"  adox %%rcx, %%r11;"
   533			"  adcx %%r9, %%r9;"
   534			"  adox %%r15, %%r12;"
   535			"  adcx %%r10, %%r10;"
   536			"  adox %%r15, %%r13;"
   537			"  adcx %%r11, %%r11;"
   538			"  adox %%r15, %%r14;"
   539			"  adcx %%r12, %%r12;"
   540			"  adcx %%r13, %%r13;"
   541			"  adcx %%r14, %%r14;"
   542	
   543			/* Step 3: Compute intermediate squares */
   544			"  movq 0(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[0]^2 */
   545			                           "  movq %%rax, 0(%0);"
   546			"  add %%rcx, %%r8;"       "  movq %%r8, 8(%0);"
   547			"  movq 8(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[1]^2 */
   548			"  adcx %%rax, %%r9;"      "  movq %%r9, 16(%0);"
   549			"  adcx %%rcx, %%r10;"     "  movq %%r10, 24(%0);"
   550			"  movq 16(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[2]^2 */
   551			"  adcx %%rax, %%r11;"     "  movq %%r11, 32(%0);"
   552			"  adcx %%rcx, %%r12;"     "  movq %%r12, 40(%0);"
   553			"  movq 24(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[3]^2 */
   554			"  adcx %%rax, %%r13;"     "  movq %%r13, 48(%0);"
   555			"  adcx %%rcx, %%r14;"     "  movq %%r14, 56(%0);"
   556	
   557			/* Line up pointers */
   558			"  mov %0, %1;"
   559			"  mov %2, %0;"
   560	
   561			/* Wrap the result back into the field */
   562	
   563			/* Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo */
   564			"  mov $38, %%rdx;"
   565			"  mulxq 32(%1), %%r8, %%r13;"
   566			"  xor %%rcx, %%rcx;"
   567			"  adoxq 0(%1), %%r8;"
   568			"  mulxq 40(%1), %%r9, %%r12;"
   569			"  adcx %%r13, %%r9;"
   570			"  adoxq 8(%1), %%r9;"
   571			"  mulxq 48(%1), %%r10, %%r13;"
   572			"  adcx %%r12, %%r10;"
   573			"  adoxq 16(%1), %%r10;"
   574			"  mulxq 56(%1), %%r11, %%rax;"
   575			"  adcx %%r13, %%r11;"
   576			"  adoxq 24(%1), %%r11;"
   577			"  adcx %%rcx, %%rax;"
   578			"  adox %%rcx, %%rax;"
   579			"  imul %%rdx, %%rax;"
   580	
   581			/* Step 2: Fold the carry back into dst */
   582			"  add %%rax, %%r8;"
   583			"  adcx %%rcx, %%r9;"
   584			"  movq %%r9, 8(%0);"
   585			"  adcx %%rcx, %%r10;"
   586			"  movq %%r10, 16(%0);"
   587			"  adcx %%rcx, %%r11;"
   588			"  movq %%r11, 24(%0);"
   589	
   590			/* Step 3: Fold the carry bit back in; guaranteed not to carry at this point */
   591			"  mov $0, %%rax;"
   592			"  cmovc %%rdx, %%rax;"
   593			"  add %%rax, %%r8;"
   594			"  movq %%r8, 0(%0);"
   595		: "+&r" (tmp), "+&r" (f), "+&r" (out)
   596		:
   597		: "%rax", "%rcx", "%rdx", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "memory", "cc"
   598		);
   599	}
   600	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28231 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread
* arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
@ 2021-05-10  8:30 kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2021-05-10  8:30 UTC (permalink / raw)
  To: Jason A. Donenfeld
  Cc: kbuild-all, clang-built-linux, linux-kernel, Herbert Xu

[-- Attachment #1: Type: text/plain, Size: 7675 bytes --]

Hi Jason,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   6efb943b8616ec53a5e444193dccf1af9ad627b5
commit: 07b586fe06625b0b610dc3d3a969c51913d143d4 crypto: x86/curve25519 - replace with formally verified implementation
date:   1 year, 3 months ago
config: x86_64-randconfig-a014-20210510 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 492173d42b32cb91d5d0d72d5ed84fcab80d059a)
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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=07b586fe06625b0b610dc3d3a969c51913d143d4
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 07b586fe06625b0b610dc3d3a969c51913d143d4
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
                   "  movq 0(%1), %%rdx;"                                       /* f[0] */
                   ^
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
   19 errors generated.


vim +518 arch/x86/crypto/curve25519-x86_64.c

   509	
   510	/* Computes the square of a field element: out <- f * f
   511	 * Uses the 8-element buffer tmp for intermediate results */
   512	static inline void fsqr(u64 *out, const u64 *f, u64 *tmp)
   513	{
   514		asm volatile(
   515			/* Compute the raw multiplication: tmp <- f * f */
   516	
   517			/* Step 1: Compute all partial products */
 > 518			"  movq 0(%1), %%rdx;"                                       /* f[0] */
   519			"  mulxq 8(%1), %%r8, %%r14;"      "  xor %%r15, %%r15;"     /* f[1]*f[0] */
   520			"  mulxq 16(%1), %%r9, %%r10;"     "  adcx %%r14, %%r9;"     /* f[2]*f[0] */
   521			"  mulxq 24(%1), %%rax, %%rcx;"    "  adcx %%rax, %%r10;"    /* f[3]*f[0] */
   522			"  movq 24(%1), %%rdx;"                                      /* f[3] */
   523			"  mulxq 8(%1), %%r11, %%r12;"     "  adcx %%rcx, %%r11;"    /* f[1]*f[3] */
   524			"  mulxq 16(%1), %%rax, %%r13;"    "  adcx %%rax, %%r12;"    /* f[2]*f[3] */
   525			"  movq 8(%1), %%rdx;"             "  adcx %%r15, %%r13;"    /* f1 */
   526			"  mulxq 16(%1), %%rax, %%rcx;"    "  mov $0, %%r14;"        /* f[2]*f[1] */
   527	
   528			/* Step 2: Compute two parallel carry chains */
   529			"  xor %%r15, %%r15;"
   530			"  adox %%rax, %%r10;"
   531			"  adcx %%r8, %%r8;"
   532			"  adox %%rcx, %%r11;"
   533			"  adcx %%r9, %%r9;"
   534			"  adox %%r15, %%r12;"
   535			"  adcx %%r10, %%r10;"
   536			"  adox %%r15, %%r13;"
   537			"  adcx %%r11, %%r11;"
   538			"  adox %%r15, %%r14;"
   539			"  adcx %%r12, %%r12;"
   540			"  adcx %%r13, %%r13;"
   541			"  adcx %%r14, %%r14;"
   542	
   543			/* Step 3: Compute intermediate squares */
   544			"  movq 0(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[0]^2 */
   545			                           "  movq %%rax, 0(%0);"
   546			"  add %%rcx, %%r8;"       "  movq %%r8, 8(%0);"
   547			"  movq 8(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[1]^2 */
   548			"  adcx %%rax, %%r9;"      "  movq %%r9, 16(%0);"
   549			"  adcx %%rcx, %%r10;"     "  movq %%r10, 24(%0);"
   550			"  movq 16(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[2]^2 */
   551			"  adcx %%rax, %%r11;"     "  movq %%r11, 32(%0);"
   552			"  adcx %%rcx, %%r12;"     "  movq %%r12, 40(%0);"
   553			"  movq 24(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[3]^2 */
   554			"  adcx %%rax, %%r13;"     "  movq %%r13, 48(%0);"
   555			"  adcx %%rcx, %%r14;"     "  movq %%r14, 56(%0);"
   556	
   557			/* Line up pointers */
   558			"  mov %0, %1;"
   559			"  mov %2, %0;"
   560	
   561			/* Wrap the result back into the field */
   562	
   563			/* Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo */
   564			"  mov $38, %%rdx;"
   565			"  mulxq 32(%1), %%r8, %%r13;"
   566			"  xor %%rcx, %%rcx;"
   567			"  adoxq 0(%1), %%r8;"
   568			"  mulxq 40(%1), %%r9, %%r12;"
   569			"  adcx %%r13, %%r9;"
   570			"  adoxq 8(%1), %%r9;"
   571			"  mulxq 48(%1), %%r10, %%r13;"
   572			"  adcx %%r12, %%r10;"
   573			"  adoxq 16(%1), %%r10;"
   574			"  mulxq 56(%1), %%r11, %%rax;"
   575			"  adcx %%r13, %%r11;"
   576			"  adoxq 24(%1), %%r11;"
   577			"  adcx %%rcx, %%rax;"
   578			"  adox %%rcx, %%rax;"
   579			"  imul %%rdx, %%rax;"
   580	
   581			/* Step 2: Fold the carry back into dst */
   582			"  add %%rax, %%r8;"
   583			"  adcx %%rcx, %%r9;"
   584			"  movq %%r9, 8(%0);"
   585			"  adcx %%rcx, %%r10;"
   586			"  movq %%r10, 16(%0);"
   587			"  adcx %%rcx, %%r11;"
   588			"  movq %%r11, 24(%0);"
   589	
   590			/* Step 3: Fold the carry bit back in; guaranteed not to carry at this point */
   591			"  mov $0, %%rax;"
   592			"  cmovc %%rdx, %%rax;"
   593			"  add %%rax, %%r8;"
   594			"  movq %%r8, 0(%0);"
   595		: "+&r" (tmp), "+&r" (f), "+&r" (out)
   596		:
   597		: "%rax", "%rcx", "%rdx", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "memory", "cc"
   598		);
   599	}
   600	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36779 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread
* arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
@ 2021-04-22  2:20 kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2021-04-22  2:20 UTC (permalink / raw)
  To: Jason A. Donenfeld
  Cc: kbuild-all, clang-built-linux, linux-kernel, Herbert Xu

[-- Attachment #1: Type: text/plain, Size: 7746 bytes --]

Hi Jason,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   16fc44d6387e260f4932e9248b985837324705d8
commit: 07b586fe06625b0b610dc3d3a969c51913d143d4 crypto: x86/curve25519 - replace with formally verified implementation
date:   1 year, 2 months ago
config: x86_64-randconfig-a006-20210422 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project d87b9b81ccb95217181ce75515c6c68bbb408ca4)
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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=07b586fe06625b0b610dc3d3a969c51913d143d4
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 07b586fe06625b0b610dc3d3a969c51913d143d4
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
                   "  movq 0(%1), %%rdx;"                                       /* f[0] */
                   ^
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
   fatal error: too many errors emitted, stopping now [-ferror-limit=]
   20 errors generated.


vim +518 arch/x86/crypto/curve25519-x86_64.c

   509	
   510	/* Computes the square of a field element: out <- f * f
   511	 * Uses the 8-element buffer tmp for intermediate results */
   512	static inline void fsqr(u64 *out, const u64 *f, u64 *tmp)
   513	{
   514		asm volatile(
   515			/* Compute the raw multiplication: tmp <- f * f */
   516	
   517			/* Step 1: Compute all partial products */
 > 518			"  movq 0(%1), %%rdx;"                                       /* f[0] */
   519			"  mulxq 8(%1), %%r8, %%r14;"      "  xor %%r15, %%r15;"     /* f[1]*f[0] */
   520			"  mulxq 16(%1), %%r9, %%r10;"     "  adcx %%r14, %%r9;"     /* f[2]*f[0] */
   521			"  mulxq 24(%1), %%rax, %%rcx;"    "  adcx %%rax, %%r10;"    /* f[3]*f[0] */
   522			"  movq 24(%1), %%rdx;"                                      /* f[3] */
   523			"  mulxq 8(%1), %%r11, %%r12;"     "  adcx %%rcx, %%r11;"    /* f[1]*f[3] */
   524			"  mulxq 16(%1), %%rax, %%r13;"    "  adcx %%rax, %%r12;"    /* f[2]*f[3] */
   525			"  movq 8(%1), %%rdx;"             "  adcx %%r15, %%r13;"    /* f1 */
   526			"  mulxq 16(%1), %%rax, %%rcx;"    "  mov $0, %%r14;"        /* f[2]*f[1] */
   527	
   528			/* Step 2: Compute two parallel carry chains */
   529			"  xor %%r15, %%r15;"
   530			"  adox %%rax, %%r10;"
   531			"  adcx %%r8, %%r8;"
   532			"  adox %%rcx, %%r11;"
   533			"  adcx %%r9, %%r9;"
   534			"  adox %%r15, %%r12;"
   535			"  adcx %%r10, %%r10;"
   536			"  adox %%r15, %%r13;"
   537			"  adcx %%r11, %%r11;"
   538			"  adox %%r15, %%r14;"
   539			"  adcx %%r12, %%r12;"
   540			"  adcx %%r13, %%r13;"
   541			"  adcx %%r14, %%r14;"
   542	
   543			/* Step 3: Compute intermediate squares */
   544			"  movq 0(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[0]^2 */
   545			                           "  movq %%rax, 0(%0);"
   546			"  add %%rcx, %%r8;"       "  movq %%r8, 8(%0);"
   547			"  movq 8(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[1]^2 */
   548			"  adcx %%rax, %%r9;"      "  movq %%r9, 16(%0);"
   549			"  adcx %%rcx, %%r10;"     "  movq %%r10, 24(%0);"
   550			"  movq 16(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[2]^2 */
   551			"  adcx %%rax, %%r11;"     "  movq %%r11, 32(%0);"
   552			"  adcx %%rcx, %%r12;"     "  movq %%r12, 40(%0);"
   553			"  movq 24(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[3]^2 */
   554			"  adcx %%rax, %%r13;"     "  movq %%r13, 48(%0);"
   555			"  adcx %%rcx, %%r14;"     "  movq %%r14, 56(%0);"
   556	
   557			/* Line up pointers */
   558			"  mov %0, %1;"
   559			"  mov %2, %0;"
   560	
   561			/* Wrap the result back into the field */
   562	
   563			/* Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo */
   564			"  mov $38, %%rdx;"
   565			"  mulxq 32(%1), %%r8, %%r13;"
   566			"  xor %%rcx, %%rcx;"
   567			"  adoxq 0(%1), %%r8;"
   568			"  mulxq 40(%1), %%r9, %%r12;"
   569			"  adcx %%r13, %%r9;"
   570			"  adoxq 8(%1), %%r9;"
   571			"  mulxq 48(%1), %%r10, %%r13;"
   572			"  adcx %%r12, %%r10;"
   573			"  adoxq 16(%1), %%r10;"
   574			"  mulxq 56(%1), %%r11, %%rax;"
   575			"  adcx %%r13, %%r11;"
   576			"  adoxq 24(%1), %%r11;"
   577			"  adcx %%rcx, %%rax;"
   578			"  adox %%rcx, %%rax;"
   579			"  imul %%rdx, %%rax;"
   580	
   581			/* Step 2: Fold the carry back into dst */
   582			"  add %%rax, %%r8;"
   583			"  adcx %%rcx, %%r9;"
   584			"  movq %%r9, 8(%0);"
   585			"  adcx %%rcx, %%r10;"
   586			"  movq %%r10, 16(%0);"
   587			"  adcx %%rcx, %%r11;"
   588			"  movq %%r11, 24(%0);"
   589	
   590			/* Step 3: Fold the carry bit back in; guaranteed not to carry at this point */
   591			"  mov $0, %%rax;"
   592			"  cmovc %%rdx, %%rax;"
   593			"  add %%rax, %%r8;"
   594			"  movq %%r8, 0(%0);"
   595		: "+&r" (tmp), "+&r" (f), "+&r" (out)
   596		:
   597		: "%rax", "%rcx", "%rdx", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "memory", "cc"
   598		);
   599	}
   600	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 33316 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread
* arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
@ 2021-04-05 22:49 kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2021-04-05 22:49 UTC (permalink / raw)
  To: Jason A. Donenfeld
  Cc: kbuild-all, clang-built-linux, linux-kernel, Herbert Xu

[-- Attachment #1: Type: text/plain, Size: 7671 bytes --]

Hi Jason,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0a50438c84363bd37fe18fe432888ae9a074dcab
commit: 07b586fe06625b0b610dc3d3a969c51913d143d4 crypto: x86/curve25519 - replace with formally verified implementation
date:   1 year, 2 months ago
config: x86_64-randconfig-a012-20210406 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 2760a808b9916a2839513b7fd7314a464f52481e)
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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=07b586fe06625b0b610dc3d3a969c51913d143d4
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 07b586fe06625b0b610dc3d3a969c51913d143d4
        # 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 <lkp@intel.com>

All errors (new ones prefixed by >>):

>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
                   "  movq 0(%1), %%rdx;"                                       /* f[0] */
                   ^
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
   19 errors generated.


vim +518 arch/x86/crypto/curve25519-x86_64.c

   509	
   510	/* Computes the square of a field element: out <- f * f
   511	 * Uses the 8-element buffer tmp for intermediate results */
   512	static inline void fsqr(u64 *out, const u64 *f, u64 *tmp)
   513	{
   514		asm volatile(
   515			/* Compute the raw multiplication: tmp <- f * f */
   516	
   517			/* Step 1: Compute all partial products */
 > 518			"  movq 0(%1), %%rdx;"                                       /* f[0] */
   519			"  mulxq 8(%1), %%r8, %%r14;"      "  xor %%r15, %%r15;"     /* f[1]*f[0] */
   520			"  mulxq 16(%1), %%r9, %%r10;"     "  adcx %%r14, %%r9;"     /* f[2]*f[0] */
   521			"  mulxq 24(%1), %%rax, %%rcx;"    "  adcx %%rax, %%r10;"    /* f[3]*f[0] */
   522			"  movq 24(%1), %%rdx;"                                      /* f[3] */
   523			"  mulxq 8(%1), %%r11, %%r12;"     "  adcx %%rcx, %%r11;"    /* f[1]*f[3] */
   524			"  mulxq 16(%1), %%rax, %%r13;"    "  adcx %%rax, %%r12;"    /* f[2]*f[3] */
   525			"  movq 8(%1), %%rdx;"             "  adcx %%r15, %%r13;"    /* f1 */
   526			"  mulxq 16(%1), %%rax, %%rcx;"    "  mov $0, %%r14;"        /* f[2]*f[1] */
   527	
   528			/* Step 2: Compute two parallel carry chains */
   529			"  xor %%r15, %%r15;"
   530			"  adox %%rax, %%r10;"
   531			"  adcx %%r8, %%r8;"
   532			"  adox %%rcx, %%r11;"
   533			"  adcx %%r9, %%r9;"
   534			"  adox %%r15, %%r12;"
   535			"  adcx %%r10, %%r10;"
   536			"  adox %%r15, %%r13;"
   537			"  adcx %%r11, %%r11;"
   538			"  adox %%r15, %%r14;"
   539			"  adcx %%r12, %%r12;"
   540			"  adcx %%r13, %%r13;"
   541			"  adcx %%r14, %%r14;"
   542	
   543			/* Step 3: Compute intermediate squares */
   544			"  movq 0(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[0]^2 */
   545			                           "  movq %%rax, 0(%0);"
   546			"  add %%rcx, %%r8;"       "  movq %%r8, 8(%0);"
   547			"  movq 8(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[1]^2 */
   548			"  adcx %%rax, %%r9;"      "  movq %%r9, 16(%0);"
   549			"  adcx %%rcx, %%r10;"     "  movq %%r10, 24(%0);"
   550			"  movq 16(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[2]^2 */
   551			"  adcx %%rax, %%r11;"     "  movq %%r11, 32(%0);"
   552			"  adcx %%rcx, %%r12;"     "  movq %%r12, 40(%0);"
   553			"  movq 24(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[3]^2 */
   554			"  adcx %%rax, %%r13;"     "  movq %%r13, 48(%0);"
   555			"  adcx %%rcx, %%r14;"     "  movq %%r14, 56(%0);"
   556	
   557			/* Line up pointers */
   558			"  mov %0, %1;"
   559			"  mov %2, %0;"
   560	
   561			/* Wrap the result back into the field */
   562	
   563			/* Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo */
   564			"  mov $38, %%rdx;"
   565			"  mulxq 32(%1), %%r8, %%r13;"
   566			"  xor %%rcx, %%rcx;"
   567			"  adoxq 0(%1), %%r8;"
   568			"  mulxq 40(%1), %%r9, %%r12;"
   569			"  adcx %%r13, %%r9;"
   570			"  adoxq 8(%1), %%r9;"
   571			"  mulxq 48(%1), %%r10, %%r13;"
   572			"  adcx %%r12, %%r10;"
   573			"  adoxq 16(%1), %%r10;"
   574			"  mulxq 56(%1), %%r11, %%rax;"
   575			"  adcx %%r13, %%r11;"
   576			"  adoxq 24(%1), %%r11;"
   577			"  adcx %%rcx, %%rax;"
   578			"  adox %%rcx, %%rax;"
   579			"  imul %%rdx, %%rax;"
   580	
   581			/* Step 2: Fold the carry back into dst */
   582			"  add %%rax, %%r8;"
   583			"  adcx %%rcx, %%r9;"
   584			"  movq %%r9, 8(%0);"
   585			"  adcx %%rcx, %%r10;"
   586			"  movq %%r10, 16(%0);"
   587			"  adcx %%rcx, %%r11;"
   588			"  movq %%r11, 24(%0);"
   589	
   590			/* Step 3: Fold the carry bit back in; guaranteed not to carry at this point */
   591			"  mov $0, %%rax;"
   592			"  cmovc %%rdx, %%rax;"
   593			"  add %%rax, %%r8;"
   594			"  movq %%r8, 0(%0);"
   595		: "+&r" (tmp), "+&r" (f), "+&r" (out)
   596		:
   597		: "%rax", "%rcx", "%rdx", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "memory", "cc"
   598		);
   599	}
   600	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 24079 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread
* arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
@ 2021-03-19 21:03 kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2021-03-19 21:03 UTC (permalink / raw)
  To: Jason A. Donenfeld
  Cc: kbuild-all, clang-built-linux, linux-kernel, Herbert Xu

[-- Attachment #1: Type: text/plain, Size: 7670 bytes --]

Hi Jason,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8b12a62a4e3ed4ae99c715034f557eb391d6b196
commit: 07b586fe06625b0b610dc3d3a969c51913d143d4 crypto: x86/curve25519 - replace with formally verified implementation
date:   1 year, 1 month ago
config: x86_64-randconfig-a014-20210319 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project fcc1ce00931751ac02498986feb37744e9ace8de)
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://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=07b586fe06625b0b610dc3d3a969c51913d143d4
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 07b586fe06625b0b610dc3d3a969c51913d143d4
        # 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 <lkp@intel.com>

All errors (new ones prefixed by >>):

>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
                   "  movq 0(%1), %%rdx;"                                       /* f[0] */
                   ^
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
   19 errors generated.


vim +518 arch/x86/crypto/curve25519-x86_64.c

   509	
   510	/* Computes the square of a field element: out <- f * f
   511	 * Uses the 8-element buffer tmp for intermediate results */
   512	static inline void fsqr(u64 *out, const u64 *f, u64 *tmp)
   513	{
   514		asm volatile(
   515			/* Compute the raw multiplication: tmp <- f * f */
   516	
   517			/* Step 1: Compute all partial products */
 > 518			"  movq 0(%1), %%rdx;"                                       /* f[0] */
   519			"  mulxq 8(%1), %%r8, %%r14;"      "  xor %%r15, %%r15;"     /* f[1]*f[0] */
   520			"  mulxq 16(%1), %%r9, %%r10;"     "  adcx %%r14, %%r9;"     /* f[2]*f[0] */
   521			"  mulxq 24(%1), %%rax, %%rcx;"    "  adcx %%rax, %%r10;"    /* f[3]*f[0] */
   522			"  movq 24(%1), %%rdx;"                                      /* f[3] */
   523			"  mulxq 8(%1), %%r11, %%r12;"     "  adcx %%rcx, %%r11;"    /* f[1]*f[3] */
   524			"  mulxq 16(%1), %%rax, %%r13;"    "  adcx %%rax, %%r12;"    /* f[2]*f[3] */
   525			"  movq 8(%1), %%rdx;"             "  adcx %%r15, %%r13;"    /* f1 */
   526			"  mulxq 16(%1), %%rax, %%rcx;"    "  mov $0, %%r14;"        /* f[2]*f[1] */
   527	
   528			/* Step 2: Compute two parallel carry chains */
   529			"  xor %%r15, %%r15;"
   530			"  adox %%rax, %%r10;"
   531			"  adcx %%r8, %%r8;"
   532			"  adox %%rcx, %%r11;"
   533			"  adcx %%r9, %%r9;"
   534			"  adox %%r15, %%r12;"
   535			"  adcx %%r10, %%r10;"
   536			"  adox %%r15, %%r13;"
   537			"  adcx %%r11, %%r11;"
   538			"  adox %%r15, %%r14;"
   539			"  adcx %%r12, %%r12;"
   540			"  adcx %%r13, %%r13;"
   541			"  adcx %%r14, %%r14;"
   542	
   543			/* Step 3: Compute intermediate squares */
   544			"  movq 0(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[0]^2 */
   545			                           "  movq %%rax, 0(%0);"
   546			"  add %%rcx, %%r8;"       "  movq %%r8, 8(%0);"
   547			"  movq 8(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[1]^2 */
   548			"  adcx %%rax, %%r9;"      "  movq %%r9, 16(%0);"
   549			"  adcx %%rcx, %%r10;"     "  movq %%r10, 24(%0);"
   550			"  movq 16(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[2]^2 */
   551			"  adcx %%rax, %%r11;"     "  movq %%r11, 32(%0);"
   552			"  adcx %%rcx, %%r12;"     "  movq %%r12, 40(%0);"
   553			"  movq 24(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[3]^2 */
   554			"  adcx %%rax, %%r13;"     "  movq %%r13, 48(%0);"
   555			"  adcx %%rcx, %%r14;"     "  movq %%r14, 56(%0);"
   556	
   557			/* Line up pointers */
   558			"  mov %0, %1;"
   559			"  mov %2, %0;"
   560	
   561			/* Wrap the result back into the field */
   562	
   563			/* Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo */
   564			"  mov $38, %%rdx;"
   565			"  mulxq 32(%1), %%r8, %%r13;"
   566			"  xor %%rcx, %%rcx;"
   567			"  adoxq 0(%1), %%r8;"
   568			"  mulxq 40(%1), %%r9, %%r12;"
   569			"  adcx %%r13, %%r9;"
   570			"  adoxq 8(%1), %%r9;"
   571			"  mulxq 48(%1), %%r10, %%r13;"
   572			"  adcx %%r12, %%r10;"
   573			"  adoxq 16(%1), %%r10;"
   574			"  mulxq 56(%1), %%r11, %%rax;"
   575			"  adcx %%r13, %%r11;"
   576			"  adoxq 24(%1), %%r11;"
   577			"  adcx %%rcx, %%rax;"
   578			"  adox %%rcx, %%rax;"
   579			"  imul %%rdx, %%rax;"
   580	
   581			/* Step 2: Fold the carry back into dst */
   582			"  add %%rax, %%r8;"
   583			"  adcx %%rcx, %%r9;"
   584			"  movq %%r9, 8(%0);"
   585			"  adcx %%rcx, %%r10;"
   586			"  movq %%r10, 16(%0);"
   587			"  adcx %%rcx, %%r11;"
   588			"  movq %%r11, 24(%0);"
   589	
   590			/* Step 3: Fold the carry bit back in; guaranteed not to carry at this point */
   591			"  mov $0, %%rax;"
   592			"  cmovc %%rdx, %%rax;"
   593			"  add %%rax, %%r8;"
   594			"  movq %%r8, 0(%0);"
   595		: "+&r" (tmp), "+&r" (f), "+&r" (out)
   596		:
   597		: "%rax", "%rcx", "%rdx", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "memory", "cc"
   598		);
   599	}
   600	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 26701 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread
* arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
@ 2020-07-12  3:36 kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2020-07-12  3:36 UTC (permalink / raw)
  To: Jason A. Donenfeld
  Cc: kbuild-all, clang-built-linux, linux-kernel, Herbert Xu

[-- Attachment #1: Type: text/plain, Size: 6315 bytes --]

Hi Jason,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0aea6d5c5be33ce94c16f9ab2f64de1f481f424b
commit: 07b586fe06625b0b610dc3d3a969c51913d143d4 crypto: x86/curve25519 - replace with formally verified implementation
date:   5 months ago
config: x86_64-randconfig-a003-20200712 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 02946de3802d3bc65bc9f2eb9b8d4969b5a7add8)
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
        git checkout 07b586fe06625b0b610dc3d3a969c51913d143d4
        # 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 <lkp@intel.com>

All errors (new ones prefixed by >>):

>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
                   "  movq 0(%1), %%rdx;"                                       /* f[0] */
                   ^
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
   9 errors generated.

vim +518 arch/x86/crypto/curve25519-x86_64.c

   509	
   510	/* Computes the square of a field element: out <- f * f
   511	 * Uses the 8-element buffer tmp for intermediate results */
   512	static inline void fsqr(u64 *out, const u64 *f, u64 *tmp)
   513	{
   514		asm volatile(
   515			/* Compute the raw multiplication: tmp <- f * f */
   516	
   517			/* Step 1: Compute all partial products */
 > 518			"  movq 0(%1), %%rdx;"                                       /* f[0] */
   519			"  mulxq 8(%1), %%r8, %%r14;"      "  xor %%r15, %%r15;"     /* f[1]*f[0] */
   520			"  mulxq 16(%1), %%r9, %%r10;"     "  adcx %%r14, %%r9;"     /* f[2]*f[0] */
   521			"  mulxq 24(%1), %%rax, %%rcx;"    "  adcx %%rax, %%r10;"    /* f[3]*f[0] */
   522			"  movq 24(%1), %%rdx;"                                      /* f[3] */
   523			"  mulxq 8(%1), %%r11, %%r12;"     "  adcx %%rcx, %%r11;"    /* f[1]*f[3] */
   524			"  mulxq 16(%1), %%rax, %%r13;"    "  adcx %%rax, %%r12;"    /* f[2]*f[3] */
   525			"  movq 8(%1), %%rdx;"             "  adcx %%r15, %%r13;"    /* f1 */
   526			"  mulxq 16(%1), %%rax, %%rcx;"    "  mov $0, %%r14;"        /* f[2]*f[1] */
   527	
   528			/* Step 2: Compute two parallel carry chains */
   529			"  xor %%r15, %%r15;"
   530			"  adox %%rax, %%r10;"
   531			"  adcx %%r8, %%r8;"
   532			"  adox %%rcx, %%r11;"
   533			"  adcx %%r9, %%r9;"
   534			"  adox %%r15, %%r12;"
   535			"  adcx %%r10, %%r10;"
   536			"  adox %%r15, %%r13;"
   537			"  adcx %%r11, %%r11;"
   538			"  adox %%r15, %%r14;"
   539			"  adcx %%r12, %%r12;"
   540			"  adcx %%r13, %%r13;"
   541			"  adcx %%r14, %%r14;"
   542	
   543			/* Step 3: Compute intermediate squares */
   544			"  movq 0(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[0]^2 */
   545			                           "  movq %%rax, 0(%0);"
   546			"  add %%rcx, %%r8;"       "  movq %%r8, 8(%0);"
   547			"  movq 8(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[1]^2 */
   548			"  adcx %%rax, %%r9;"      "  movq %%r9, 16(%0);"
   549			"  adcx %%rcx, %%r10;"     "  movq %%r10, 24(%0);"
   550			"  movq 16(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[2]^2 */
   551			"  adcx %%rax, %%r11;"     "  movq %%r11, 32(%0);"
   552			"  adcx %%rcx, %%r12;"     "  movq %%r12, 40(%0);"
   553			"  movq 24(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[3]^2 */
   554			"  adcx %%rax, %%r13;"     "  movq %%r13, 48(%0);"
   555			"  adcx %%rcx, %%r14;"     "  movq %%r14, 56(%0);"
   556	
   557			/* Line up pointers */
   558			"  mov %0, %1;"
   559			"  mov %2, %0;"
   560	
   561			/* Wrap the result back into the field */
   562	
   563			/* Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo */
   564			"  mov $38, %%rdx;"
   565			"  mulxq 32(%1), %%r8, %%r13;"
   566			"  xor %%rcx, %%rcx;"
   567			"  adoxq 0(%1), %%r8;"
   568			"  mulxq 40(%1), %%r9, %%r12;"
   569			"  adcx %%r13, %%r9;"
   570			"  adoxq 8(%1), %%r9;"
   571			"  mulxq 48(%1), %%r10, %%r13;"
   572			"  adcx %%r12, %%r10;"
   573			"  adoxq 16(%1), %%r10;"
   574			"  mulxq 56(%1), %%r11, %%rax;"
   575			"  adcx %%r13, %%r11;"
   576			"  adoxq 24(%1), %%r11;"
   577			"  adcx %%rcx, %%rax;"
   578			"  adox %%rcx, %%rax;"
   579			"  imul %%rdx, %%rax;"
   580	
   581			/* Step 2: Fold the carry back into dst */
   582			"  add %%rax, %%r8;"
   583			"  adcx %%rcx, %%r9;"
   584			"  movq %%r9, 8(%0);"
   585			"  adcx %%rcx, %%r10;"
   586			"  movq %%r10, 16(%0);"
   587			"  adcx %%rcx, %%r11;"
   588			"  movq %%r11, 24(%0);"
   589	
   590			/* Step 3: Fold the carry bit back in; guaranteed not to carry at this point */
   591			"  mov $0, %%rax;"
   592			"  cmovc %%rdx, %%rax;"
   593			"  add %%rax, %%r8;"
   594			"  movq %%r8, 0(%0);"
   595		: "+&r" (tmp), "+&r" (f), "+&r" (out)
   596		:
   597		: "%rax", "%rcx", "%rdx", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "memory", "cc"
   598		);
   599	}
   600	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 34048 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread
* arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
@ 2020-07-04 20:40 kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2020-07-04 20:40 UTC (permalink / raw)
  To: Jason A. Donenfeld
  Cc: kbuild-all, clang-built-linux, linux-kernel, Herbert Xu

[-- Attachment #1: Type: text/plain, Size: 6644 bytes --]

Hi Jason,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   35e884f89df4c48566d745dc5a97a0d058d04263
commit: 07b586fe06625b0b610dc3d3a969c51913d143d4 crypto: x86/curve25519 - replace with formally verified implementation
date:   5 months ago
config: x86_64-randconfig-a002-20200705 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project e359ab1eca5727ce4c688bb49323b8a09478d61c)
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
        git checkout 07b586fe06625b0b610dc3d3a969c51913d143d4
        # 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 <lkp@intel.com>

All errors (new ones prefixed by >>):

>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
                   "  movq 0(%1), %%rdx;"                                       /* f[0] */
                   ^
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
   arch/x86/crypto/curve25519-x86_64.c:609:3: error: inline assembly requires more registers than available
                   "  movq 0(%1), %%rdx;"                                       /* f[0] */
                   ^
   arch/x86/crypto/curve25519-x86_64.c:609:3: error: inline assembly requires more registers than available
   11 errors generated.

vim +518 arch/x86/crypto/curve25519-x86_64.c

   509	
   510	/* Computes the square of a field element: out <- f * f
   511	 * Uses the 8-element buffer tmp for intermediate results */
   512	static inline void fsqr(u64 *out, const u64 *f, u64 *tmp)
   513	{
   514		asm volatile(
   515			/* Compute the raw multiplication: tmp <- f * f */
   516	
   517			/* Step 1: Compute all partial products */
 > 518			"  movq 0(%1), %%rdx;"                                       /* f[0] */
   519			"  mulxq 8(%1), %%r8, %%r14;"      "  xor %%r15, %%r15;"     /* f[1]*f[0] */
   520			"  mulxq 16(%1), %%r9, %%r10;"     "  adcx %%r14, %%r9;"     /* f[2]*f[0] */
   521			"  mulxq 24(%1), %%rax, %%rcx;"    "  adcx %%rax, %%r10;"    /* f[3]*f[0] */
   522			"  movq 24(%1), %%rdx;"                                      /* f[3] */
   523			"  mulxq 8(%1), %%r11, %%r12;"     "  adcx %%rcx, %%r11;"    /* f[1]*f[3] */
   524			"  mulxq 16(%1), %%rax, %%r13;"    "  adcx %%rax, %%r12;"    /* f[2]*f[3] */
   525			"  movq 8(%1), %%rdx;"             "  adcx %%r15, %%r13;"    /* f1 */
   526			"  mulxq 16(%1), %%rax, %%rcx;"    "  mov $0, %%r14;"        /* f[2]*f[1] */
   527	
   528			/* Step 2: Compute two parallel carry chains */
   529			"  xor %%r15, %%r15;"
   530			"  adox %%rax, %%r10;"
   531			"  adcx %%r8, %%r8;"
   532			"  adox %%rcx, %%r11;"
   533			"  adcx %%r9, %%r9;"
   534			"  adox %%r15, %%r12;"
   535			"  adcx %%r10, %%r10;"
   536			"  adox %%r15, %%r13;"
   537			"  adcx %%r11, %%r11;"
   538			"  adox %%r15, %%r14;"
   539			"  adcx %%r12, %%r12;"
   540			"  adcx %%r13, %%r13;"
   541			"  adcx %%r14, %%r14;"
   542	
   543			/* Step 3: Compute intermediate squares */
   544			"  movq 0(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[0]^2 */
   545			                           "  movq %%rax, 0(%0);"
   546			"  add %%rcx, %%r8;"       "  movq %%r8, 8(%0);"
   547			"  movq 8(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[1]^2 */
   548			"  adcx %%rax, %%r9;"      "  movq %%r9, 16(%0);"
   549			"  adcx %%rcx, %%r10;"     "  movq %%r10, 24(%0);"
   550			"  movq 16(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[2]^2 */
   551			"  adcx %%rax, %%r11;"     "  movq %%r11, 32(%0);"
   552			"  adcx %%rcx, %%r12;"     "  movq %%r12, 40(%0);"
   553			"  movq 24(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[3]^2 */
   554			"  adcx %%rax, %%r13;"     "  movq %%r13, 48(%0);"
   555			"  adcx %%rcx, %%r14;"     "  movq %%r14, 56(%0);"
   556	
   557			/* Line up pointers */
   558			"  mov %0, %1;"
   559			"  mov %2, %0;"
   560	
   561			/* Wrap the result back into the field */
   562	
   563			/* Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo */
   564			"  mov $38, %%rdx;"
   565			"  mulxq 32(%1), %%r8, %%r13;"
   566			"  xor %%rcx, %%rcx;"
   567			"  adoxq 0(%1), %%r8;"
   568			"  mulxq 40(%1), %%r9, %%r12;"
   569			"  adcx %%r13, %%r9;"
   570			"  adoxq 8(%1), %%r9;"
   571			"  mulxq 48(%1), %%r10, %%r13;"
   572			"  adcx %%r12, %%r10;"
   573			"  adoxq 16(%1), %%r10;"
   574			"  mulxq 56(%1), %%r11, %%rax;"
   575			"  adcx %%r13, %%r11;"
   576			"  adoxq 24(%1), %%r11;"
   577			"  adcx %%rcx, %%rax;"
   578			"  adox %%rcx, %%rax;"
   579			"  imul %%rdx, %%rax;"
   580	
   581			/* Step 2: Fold the carry back into dst */
   582			"  add %%rax, %%r8;"
   583			"  adcx %%rcx, %%r9;"
   584			"  movq %%r9, 8(%0);"
   585			"  adcx %%rcx, %%r10;"
   586			"  movq %%r10, 16(%0);"
   587			"  adcx %%rcx, %%r11;"
   588			"  movq %%r11, 24(%0);"
   589	
   590			/* Step 3: Fold the carry bit back in; guaranteed not to carry at this point */
   591			"  mov $0, %%rax;"
   592			"  cmovc %%rdx, %%rax;"
   593			"  add %%rax, %%r8;"
   594			"  movq %%r8, 0(%0);"
   595		: "+&r" (tmp), "+&r" (f), "+&r" (out)
   596		:
   597		: "%rax", "%rcx", "%rdx", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "memory", "cc"
   598		);
   599	}
   600	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30973 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread
* arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
@ 2020-06-18 14:53 kernel test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kernel test robot @ 2020-06-18 14:53 UTC (permalink / raw)
  To: Jason A. Donenfeld
  Cc: kbuild-all, clang-built-linux, linux-kernel, Herbert Xu

[-- Attachment #1: Type: text/plain, Size: 6315 bytes --]

Hi Jason,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   1b5044021070efa3259f3e9548dc35d1eb6aa844
commit: 07b586fe06625b0b610dc3d3a969c51913d143d4 crypto: x86/curve25519 - replace with formally verified implementation
date:   4 months ago
config: x86_64-randconfig-r011-20200618 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 487ca07fcc75d52755c9fe2ee05bcb3b6eeeec44)
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
        git checkout 07b586fe06625b0b610dc3d3a969c51913d143d4
        # 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 <lkp@intel.com>

All errors (new ones prefixed by >>):

>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
                   "  movq 0(%1), %%rdx;"                                       /* f[0] */
                   ^
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
   9 errors generated.

vim +518 arch/x86/crypto/curve25519-x86_64.c

   509	
   510	/* Computes the square of a field element: out <- f * f
   511	 * Uses the 8-element buffer tmp for intermediate results */
   512	static inline void fsqr(u64 *out, const u64 *f, u64 *tmp)
   513	{
   514		asm volatile(
   515			/* Compute the raw multiplication: tmp <- f * f */
   516	
   517			/* Step 1: Compute all partial products */
 > 518			"  movq 0(%1), %%rdx;"                                       /* f[0] */
   519			"  mulxq 8(%1), %%r8, %%r14;"      "  xor %%r15, %%r15;"     /* f[1]*f[0] */
   520			"  mulxq 16(%1), %%r9, %%r10;"     "  adcx %%r14, %%r9;"     /* f[2]*f[0] */
   521			"  mulxq 24(%1), %%rax, %%rcx;"    "  adcx %%rax, %%r10;"    /* f[3]*f[0] */
   522			"  movq 24(%1), %%rdx;"                                      /* f[3] */
   523			"  mulxq 8(%1), %%r11, %%r12;"     "  adcx %%rcx, %%r11;"    /* f[1]*f[3] */
   524			"  mulxq 16(%1), %%rax, %%r13;"    "  adcx %%rax, %%r12;"    /* f[2]*f[3] */
   525			"  movq 8(%1), %%rdx;"             "  adcx %%r15, %%r13;"    /* f1 */
   526			"  mulxq 16(%1), %%rax, %%rcx;"    "  mov $0, %%r14;"        /* f[2]*f[1] */
   527	
   528			/* Step 2: Compute two parallel carry chains */
   529			"  xor %%r15, %%r15;"
   530			"  adox %%rax, %%r10;"
   531			"  adcx %%r8, %%r8;"
   532			"  adox %%rcx, %%r11;"
   533			"  adcx %%r9, %%r9;"
   534			"  adox %%r15, %%r12;"
   535			"  adcx %%r10, %%r10;"
   536			"  adox %%r15, %%r13;"
   537			"  adcx %%r11, %%r11;"
   538			"  adox %%r15, %%r14;"
   539			"  adcx %%r12, %%r12;"
   540			"  adcx %%r13, %%r13;"
   541			"  adcx %%r14, %%r14;"
   542	
   543			/* Step 3: Compute intermediate squares */
   544			"  movq 0(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[0]^2 */
   545			                           "  movq %%rax, 0(%0);"
   546			"  add %%rcx, %%r8;"       "  movq %%r8, 8(%0);"
   547			"  movq 8(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[1]^2 */
   548			"  adcx %%rax, %%r9;"      "  movq %%r9, 16(%0);"
   549			"  adcx %%rcx, %%r10;"     "  movq %%r10, 24(%0);"
   550			"  movq 16(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[2]^2 */
   551			"  adcx %%rax, %%r11;"     "  movq %%r11, 32(%0);"
   552			"  adcx %%rcx, %%r12;"     "  movq %%r12, 40(%0);"
   553			"  movq 24(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[3]^2 */
   554			"  adcx %%rax, %%r13;"     "  movq %%r13, 48(%0);"
   555			"  adcx %%rcx, %%r14;"     "  movq %%r14, 56(%0);"
   556	
   557			/* Line up pointers */
   558			"  mov %0, %1;"
   559			"  mov %2, %0;"
   560	
   561			/* Wrap the result back into the field */
   562	
   563			/* Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo */
   564			"  mov $38, %%rdx;"
   565			"  mulxq 32(%1), %%r8, %%r13;"
   566			"  xor %%rcx, %%rcx;"
   567			"  adoxq 0(%1), %%r8;"
   568			"  mulxq 40(%1), %%r9, %%r12;"
   569			"  adcx %%r13, %%r9;"
   570			"  adoxq 8(%1), %%r9;"
   571			"  mulxq 48(%1), %%r10, %%r13;"
   572			"  adcx %%r12, %%r10;"
   573			"  adoxq 16(%1), %%r10;"
   574			"  mulxq 56(%1), %%r11, %%rax;"
   575			"  adcx %%r13, %%r11;"
   576			"  adoxq 24(%1), %%r11;"
   577			"  adcx %%rcx, %%rax;"
   578			"  adox %%rcx, %%rax;"
   579			"  imul %%rdx, %%rax;"
   580	
   581			/* Step 2: Fold the carry back into dst */
   582			"  add %%rax, %%r8;"
   583			"  adcx %%rcx, %%r9;"
   584			"  movq %%r9, 8(%0);"
   585			"  adcx %%rcx, %%r10;"
   586			"  movq %%r10, 16(%0);"
   587			"  adcx %%rcx, %%r11;"
   588			"  movq %%r11, 24(%0);"
   589	
   590			/* Step 3: Fold the carry bit back in; guaranteed not to carry at this point */
   591			"  mov $0, %%rax;"
   592			"  cmovc %%rdx, %%rax;"
   593			"  add %%rax, %%r8;"
   594			"  movq %%r8, 0(%0);"
   595		: "+&r" (tmp), "+&r" (f), "+&r" (out)
   596		:
   597		: "%rax", "%rcx", "%rdx", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "memory", "cc"
   598		);
   599	}
   600	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 36257 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread
* arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
@ 2020-05-18 17:42 kbuild test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kbuild test robot @ 2020-05-18 17:42 UTC (permalink / raw)
  To: Jason A. Donenfeld
  Cc: kbuild-all, clang-built-linux, linux-kernel, Herbert Xu

[-- Attachment #1: Type: text/plain, Size: 6277 bytes --]

Hi Jason,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b9bbe6ed63b2b9f2c9ee5cbd0f2c946a2723f4ce
commit: 07b586fe06625b0b610dc3d3a969c51913d143d4 crypto: x86/curve25519 - replace with formally verified implementation
date:   3 months ago
config: x86_64-randconfig-r001-20200518 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 135b877874fae96b4372c8a3fbfaa8ff44ff86e3)
reproduce:
        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
        git checkout 07b586fe06625b0b610dc3d3a969c51913d143d4
        # 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: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
"  movq 0(%1), %%rdx;"                                       /* f[0] */
^
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
9 errors generated.

vim +518 arch/x86/crypto/curve25519-x86_64.c

   509	
   510	/* Computes the square of a field element: out <- f * f
   511	 * Uses the 8-element buffer tmp for intermediate results */
   512	static inline void fsqr(u64 *out, const u64 *f, u64 *tmp)
   513	{
   514		asm volatile(
   515			/* Compute the raw multiplication: tmp <- f * f */
   516	
   517			/* Step 1: Compute all partial products */
 > 518			"  movq 0(%1), %%rdx;"                                       /* f[0] */
   519			"  mulxq 8(%1), %%r8, %%r14;"      "  xor %%r15, %%r15;"     /* f[1]*f[0] */
   520			"  mulxq 16(%1), %%r9, %%r10;"     "  adcx %%r14, %%r9;"     /* f[2]*f[0] */
   521			"  mulxq 24(%1), %%rax, %%rcx;"    "  adcx %%rax, %%r10;"    /* f[3]*f[0] */
   522			"  movq 24(%1), %%rdx;"                                      /* f[3] */
   523			"  mulxq 8(%1), %%r11, %%r12;"     "  adcx %%rcx, %%r11;"    /* f[1]*f[3] */
   524			"  mulxq 16(%1), %%rax, %%r13;"    "  adcx %%rax, %%r12;"    /* f[2]*f[3] */
   525			"  movq 8(%1), %%rdx;"             "  adcx %%r15, %%r13;"    /* f1 */
   526			"  mulxq 16(%1), %%rax, %%rcx;"    "  mov $0, %%r14;"        /* f[2]*f[1] */
   527	
   528			/* Step 2: Compute two parallel carry chains */
   529			"  xor %%r15, %%r15;"
   530			"  adox %%rax, %%r10;"
   531			"  adcx %%r8, %%r8;"
   532			"  adox %%rcx, %%r11;"
   533			"  adcx %%r9, %%r9;"
   534			"  adox %%r15, %%r12;"
   535			"  adcx %%r10, %%r10;"
   536			"  adox %%r15, %%r13;"
   537			"  adcx %%r11, %%r11;"
   538			"  adox %%r15, %%r14;"
   539			"  adcx %%r12, %%r12;"
   540			"  adcx %%r13, %%r13;"
   541			"  adcx %%r14, %%r14;"
   542	
   543			/* Step 3: Compute intermediate squares */
   544			"  movq 0(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[0]^2 */
   545			                           "  movq %%rax, 0(%0);"
   546			"  add %%rcx, %%r8;"       "  movq %%r8, 8(%0);"
   547			"  movq 8(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[1]^2 */
   548			"  adcx %%rax, %%r9;"      "  movq %%r9, 16(%0);"
   549			"  adcx %%rcx, %%r10;"     "  movq %%r10, 24(%0);"
   550			"  movq 16(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[2]^2 */
   551			"  adcx %%rax, %%r11;"     "  movq %%r11, 32(%0);"
   552			"  adcx %%rcx, %%r12;"     "  movq %%r12, 40(%0);"
   553			"  movq 24(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[3]^2 */
   554			"  adcx %%rax, %%r13;"     "  movq %%r13, 48(%0);"
   555			"  adcx %%rcx, %%r14;"     "  movq %%r14, 56(%0);"
   556	
   557			/* Line up pointers */
   558			"  mov %0, %1;"
   559			"  mov %2, %0;"
   560	
   561			/* Wrap the result back into the field */
   562	
   563			/* Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo */
   564			"  mov $38, %%rdx;"
   565			"  mulxq 32(%1), %%r8, %%r13;"
   566			"  xor %%rcx, %%rcx;"
   567			"  adoxq 0(%1), %%r8;"
   568			"  mulxq 40(%1), %%r9, %%r12;"
   569			"  adcx %%r13, %%r9;"
   570			"  adoxq 8(%1), %%r9;"
   571			"  mulxq 48(%1), %%r10, %%r13;"
   572			"  adcx %%r12, %%r10;"
   573			"  adoxq 16(%1), %%r10;"
   574			"  mulxq 56(%1), %%r11, %%rax;"
   575			"  adcx %%r13, %%r11;"
   576			"  adoxq 24(%1), %%r11;"
   577			"  adcx %%rcx, %%rax;"
   578			"  adox %%rcx, %%rax;"
   579			"  imul %%rdx, %%rax;"
   580	
   581			/* Step 2: Fold the carry back into dst */
   582			"  add %%rax, %%r8;"
   583			"  adcx %%rcx, %%r9;"
   584			"  movq %%r9, 8(%0);"
   585			"  adcx %%rcx, %%r10;"
   586			"  movq %%r10, 16(%0);"
   587			"  adcx %%rcx, %%r11;"
   588			"  movq %%r11, 24(%0);"
   589	
   590			/* Step 3: Fold the carry bit back in; guaranteed not to carry at this point */
   591			"  mov $0, %%rax;"
   592			"  cmovc %%rdx, %%rax;"
   593			"  add %%rax, %%r8;"
   594			"  movq %%r8, 0(%0);"
   595		: "+&r" (tmp), "+&r" (f), "+&r" (out)
   596		:
   597		: "%rax", "%rcx", "%rdx", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "memory", "cc"
   598		);
   599	}
   600	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35620 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread
* arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
@ 2020-05-01  0:51 kbuild test robot
  0 siblings, 0 replies; 10+ messages in thread
From: kbuild test robot @ 2020-05-01  0:51 UTC (permalink / raw)
  To: Jason A. Donenfeld
  Cc: kbuild-all, clang-built-linux, linux-kernel, Herbert Xu

[-- Attachment #1: Type: text/plain, Size: 6243 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   c45e8bccecaf633480d378daff11e122dfd5e96d
commit: 07b586fe06625b0b610dc3d3a969c51913d143d4 crypto: x86/curve25519 - replace with formally verified implementation
date:   3 months ago
config: x86_64-randconfig-a002-20200501 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 1ccde533425a4ba9d379510206ad680ff9702129)
reproduce:
        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
        git checkout 07b586fe06625b0b610dc3d3a969c51913d143d4
        # 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: kbuild test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
                   "  movq 0(%1), %%rdx;"                                       /* f[0] */
                   ^
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
>> arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available
   9 errors generated.

vim +518 arch/x86/crypto/curve25519-x86_64.c

   509	
   510	/* Computes the square of a field element: out <- f * f
   511	 * Uses the 8-element buffer tmp for intermediate results */
   512	static inline void fsqr(u64 *out, const u64 *f, u64 *tmp)
   513	{
   514		asm volatile(
   515			/* Compute the raw multiplication: tmp <- f * f */
   516	
   517			/* Step 1: Compute all partial products */
 > 518			"  movq 0(%1), %%rdx;"                                       /* f[0] */
   519			"  mulxq 8(%1), %%r8, %%r14;"      "  xor %%r15, %%r15;"     /* f[1]*f[0] */
   520			"  mulxq 16(%1), %%r9, %%r10;"     "  adcx %%r14, %%r9;"     /* f[2]*f[0] */
   521			"  mulxq 24(%1), %%rax, %%rcx;"    "  adcx %%rax, %%r10;"    /* f[3]*f[0] */
   522			"  movq 24(%1), %%rdx;"                                      /* f[3] */
   523			"  mulxq 8(%1), %%r11, %%r12;"     "  adcx %%rcx, %%r11;"    /* f[1]*f[3] */
   524			"  mulxq 16(%1), %%rax, %%r13;"    "  adcx %%rax, %%r12;"    /* f[2]*f[3] */
   525			"  movq 8(%1), %%rdx;"             "  adcx %%r15, %%r13;"    /* f1 */
   526			"  mulxq 16(%1), %%rax, %%rcx;"    "  mov $0, %%r14;"        /* f[2]*f[1] */
   527	
   528			/* Step 2: Compute two parallel carry chains */
   529			"  xor %%r15, %%r15;"
   530			"  adox %%rax, %%r10;"
   531			"  adcx %%r8, %%r8;"
   532			"  adox %%rcx, %%r11;"
   533			"  adcx %%r9, %%r9;"
   534			"  adox %%r15, %%r12;"
   535			"  adcx %%r10, %%r10;"
   536			"  adox %%r15, %%r13;"
   537			"  adcx %%r11, %%r11;"
   538			"  adox %%r15, %%r14;"
   539			"  adcx %%r12, %%r12;"
   540			"  adcx %%r13, %%r13;"
   541			"  adcx %%r14, %%r14;"
   542	
   543			/* Step 3: Compute intermediate squares */
   544			"  movq 0(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[0]^2 */
   545			                           "  movq %%rax, 0(%0);"
   546			"  add %%rcx, %%r8;"       "  movq %%r8, 8(%0);"
   547			"  movq 8(%1), %%rdx;"     "  mulx %%rdx, %%rax, %%rcx;"    /* f[1]^2 */
   548			"  adcx %%rax, %%r9;"      "  movq %%r9, 16(%0);"
   549			"  adcx %%rcx, %%r10;"     "  movq %%r10, 24(%0);"
   550			"  movq 16(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[2]^2 */
   551			"  adcx %%rax, %%r11;"     "  movq %%r11, 32(%0);"
   552			"  adcx %%rcx, %%r12;"     "  movq %%r12, 40(%0);"
   553			"  movq 24(%1), %%rdx;"    "  mulx %%rdx, %%rax, %%rcx;"    /* f[3]^2 */
   554			"  adcx %%rax, %%r13;"     "  movq %%r13, 48(%0);"
   555			"  adcx %%rcx, %%r14;"     "  movq %%r14, 56(%0);"
   556	
   557			/* Line up pointers */
   558			"  mov %0, %1;"
   559			"  mov %2, %0;"
   560	
   561			/* Wrap the result back into the field */
   562	
   563			/* Step 1: Compute dst + carry == tmp_hi * 38 + tmp_lo */
   564			"  mov $38, %%rdx;"
   565			"  mulxq 32(%1), %%r8, %%r13;"
   566			"  xor %%rcx, %%rcx;"
   567			"  adoxq 0(%1), %%r8;"
   568			"  mulxq 40(%1), %%r9, %%r12;"
   569			"  adcx %%r13, %%r9;"
   570			"  adoxq 8(%1), %%r9;"
   571			"  mulxq 48(%1), %%r10, %%r13;"
   572			"  adcx %%r12, %%r10;"
   573			"  adoxq 16(%1), %%r10;"
   574			"  mulxq 56(%1), %%r11, %%rax;"
   575			"  adcx %%r13, %%r11;"
   576			"  adoxq 24(%1), %%r11;"
   577			"  adcx %%rcx, %%rax;"
   578			"  adox %%rcx, %%rax;"
   579			"  imul %%rdx, %%rax;"
   580	
   581			/* Step 2: Fold the carry back into dst */
   582			"  add %%rax, %%r8;"
   583			"  adcx %%rcx, %%r9;"
   584			"  movq %%r9, 8(%0);"
   585			"  adcx %%rcx, %%r10;"
   586			"  movq %%r10, 16(%0);"
   587			"  adcx %%rcx, %%r11;"
   588			"  movq %%r11, 24(%0);"
   589	
   590			/* Step 3: Fold the carry bit back in; guaranteed not to carry at this point */
   591			"  mov $0, %%rax;"
   592			"  cmovc %%rdx, %%rax;"
   593			"  add %%rax, %%r8;"
   594			"  movq %%r8, 0(%0);"
   595		: "+&r" (tmp), "+&r" (f), "+&r" (out)
   596		:
   597		: "%rax", "%rcx", "%rdx", "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15", "memory", "cc"
   598		);
   599	}
   600	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 35460 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-05-10  8:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 12:32 arch/x86/crypto/curve25519-x86_64.c:518:3: error: inline assembly requires more registers than available kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-05-10  8:30 kernel test robot
2021-04-22  2:20 kernel test robot
2021-04-05 22:49 kernel test robot
2021-03-19 21:03 kernel test robot
2020-07-12  3:36 kernel test robot
2020-07-04 20:40 kernel test robot
2020-06-18 14:53 kernel test robot
2020-05-18 17:42 kbuild test robot
2020-05-01  0:51 kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).