[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202212141025.6iR1ex8g-lkp@intel.com>
Date: Wed, 14 Dec 2022 10:23:54 +0800
From: kernel test robot <lkp@...el.com>
To: Janis Schoetterl-Glausch <scgl@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Janosch Frank <frankja@...ux.ibm.com>,
Claudio Imbrenda <imbrenda@...ux.ibm.com>,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>
Cc: oe-kbuild-all@...ts.linux.dev,
Janis Schoetterl-Glausch <scgl@...ux.ibm.com>,
David Hildenbrand <david@...hat.com>,
Jonathan Corbet <corbet@....net>, kvm@...r.kernel.org,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-kselftest@...r.kernel.org, linux-s390@...r.kernel.org,
Paolo Bonzini <pbonzini@...hat.com>,
Shuah Khan <skhan@...uxfoundation.org>,
Sven Schnelle <svens@...ux.ibm.com>
Subject: Re: [PATCH v4 1/9] KVM: s390: Extend MEM_OP ioctl by storage key
checked cmpxchg
Hi Janis,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on 739ad2e4e15b585a0eaf98b7bdee62b2dd9588c9]
url: https://github.com/intel-lab-lkp/linux/commits/Janis-Schoetterl-Glausch/KVM-s390-Extend-MEM_OP-ioctl-by-storage-key-checked-cmpxchg/20221214-005540
base: 739ad2e4e15b585a0eaf98b7bdee62b2dd9588c9
patch link: https://lore.kernel.org/r/20221213165405.2953539-2-scgl%40linux.ibm.com
patch subject: [PATCH v4 1/9] KVM: s390: Extend MEM_OP ioctl by storage key checked cmpxchg
config: s390-randconfig-r004-20221213
compiler: s390-linux-gcc (GCC) 12.1.0
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
# https://github.com/intel-lab-lkp/linux/commit/4e0991bd47ba30c7588e042da7a84d84b9f84056
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Janis-Schoetterl-Glausch/KVM-s390-Extend-MEM_OP-ioctl-by-storage-key-checked-cmpxchg/20221214-005540
git checkout 4e0991bd47ba30c7588e042da7a84d84b9f84056
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All errors (new ones prefixed by >>):
s390-linux-ld: arch/s390/kvm/gaccess.o: in function `__cmpxchg_user_key':
>> arch/s390/include/asm/uaccess.h:410: undefined reference to `__ashlti3'
>> s390-linux-ld: arch/s390/include/asm/uaccess.h:411: undefined reference to `__ashlti3'
s390-linux-ld: arch/s390/include/asm/uaccess.h:458: undefined reference to `__ashlti3'
s390-linux-ld: arch/s390/include/asm/uaccess.h:459: undefined reference to `__ashlti3'
vim +410 arch/s390/include/asm/uaccess.h
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 396
4148575abe1e14 Heiko Carstens 2022-11-02 397 static __always_inline int __cmpxchg_user_key(unsigned long address, void *uval,
4148575abe1e14 Heiko Carstens 2022-11-02 398 __uint128_t old, __uint128_t new,
4148575abe1e14 Heiko Carstens 2022-11-02 399 unsigned long key, int size)
4148575abe1e14 Heiko Carstens 2022-11-02 400 {
4148575abe1e14 Heiko Carstens 2022-11-02 401 int rc = 0;
4148575abe1e14 Heiko Carstens 2022-11-02 402
4148575abe1e14 Heiko Carstens 2022-11-02 403 switch (size) {
4148575abe1e14 Heiko Carstens 2022-11-02 404 case 1: {
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 405 unsigned int prev, shift, mask, _old, _new;
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 406 unsigned long count;
4148575abe1e14 Heiko Carstens 2022-11-02 407
4148575abe1e14 Heiko Carstens 2022-11-02 408 shift = (3 ^ (address & 3)) << 3;
4148575abe1e14 Heiko Carstens 2022-11-02 409 address ^= address & 3;
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 @410 _old = (old & 0xff) << shift;
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 @411 _new = (new & 0xff) << shift;
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 412 mask = ~(0xff << shift);
4148575abe1e14 Heiko Carstens 2022-11-02 413 asm volatile(
4148575abe1e14 Heiko Carstens 2022-11-02 414 " spka 0(%[key])\n"
4148575abe1e14 Heiko Carstens 2022-11-02 415 " sacf 256\n"
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 416 " llill %[count],%[max_loops]\n"
4148575abe1e14 Heiko Carstens 2022-11-02 417 "0: l %[prev],%[address]\n"
4148575abe1e14 Heiko Carstens 2022-11-02 418 "1: nr %[prev],%[mask]\n"
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 419 " xilf %[mask],0xffffffff\n"
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 420 " or %[new],%[prev]\n"
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 421 " or %[prev],%[tmp]\n"
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 422 "2: lr %[tmp],%[prev]\n"
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 423 "3: cs %[prev],%[new],%[address]\n"
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 424 "4: jnl 5f\n"
4148575abe1e14 Heiko Carstens 2022-11-02 425 " xr %[tmp],%[prev]\n"
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 426 " xr %[new],%[tmp]\n"
4148575abe1e14 Heiko Carstens 2022-11-02 427 " nr %[tmp],%[mask]\n"
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 428 " jnz 5f\n"
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 429 " brct %[count],2b\n"
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 430 "5: sacf 768\n"
4148575abe1e14 Heiko Carstens 2022-11-02 431 " spka %[default_key]\n"
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 432 EX_TABLE_UA_LOAD_REG(0b, 5b, %[rc], %[prev])
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 433 EX_TABLE_UA_LOAD_REG(1b, 5b, %[rc], %[prev])
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 434 EX_TABLE_UA_LOAD_REG(3b, 5b, %[rc], %[prev])
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 435 EX_TABLE_UA_LOAD_REG(4b, 5b, %[rc], %[prev])
4148575abe1e14 Heiko Carstens 2022-11-02 436 : [rc] "+&d" (rc),
4148575abe1e14 Heiko Carstens 2022-11-02 437 [prev] "=&d" (prev),
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 438 [address] "+Q" (*(int *)address),
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 439 [tmp] "+&d" (_old),
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 440 [new] "+&d" (_new),
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 441 [mask] "+&d" (mask),
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 442 [count] "=a" (count)
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 443 : [key] "%[count]" (key << 4),
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 444 [default_key] "J" (PAGE_DEFAULT_KEY),
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 445 [max_loops] "J" (CMPXCHG_USER_KEY_MAX_LOOPS)
4148575abe1e14 Heiko Carstens 2022-11-02 446 : "memory", "cc");
4148575abe1e14 Heiko Carstens 2022-11-02 447 *(unsigned char *)uval = prev >> shift;
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 448 if (!count)
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 449 rc = -EAGAIN;
4148575abe1e14 Heiko Carstens 2022-11-02 450 return rc;
4148575abe1e14 Heiko Carstens 2022-11-02 451 }
4148575abe1e14 Heiko Carstens 2022-11-02 452 case 2: {
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 453 unsigned int prev, shift, mask, _old, _new;
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 454 unsigned long count;
4148575abe1e14 Heiko Carstens 2022-11-02 455
4148575abe1e14 Heiko Carstens 2022-11-02 456 shift = (2 ^ (address & 2)) << 3;
4148575abe1e14 Heiko Carstens 2022-11-02 457 address ^= address & 2;
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 458 _old = (old & 0xffff) << shift;
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 459 _new = (new & 0xffff) << shift;
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 460 mask = ~(0xffff << shift);
4148575abe1e14 Heiko Carstens 2022-11-02 461 asm volatile(
4148575abe1e14 Heiko Carstens 2022-11-02 462 " spka 0(%[key])\n"
4148575abe1e14 Heiko Carstens 2022-11-02 463 " sacf 256\n"
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 464 " llill %[count],%[max_loops]\n"
4148575abe1e14 Heiko Carstens 2022-11-02 465 "0: l %[prev],%[address]\n"
4148575abe1e14 Heiko Carstens 2022-11-02 466 "1: nr %[prev],%[mask]\n"
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 467 " xilf %[mask],0xffffffff\n"
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 468 " or %[new],%[prev]\n"
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 469 " or %[prev],%[tmp]\n"
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 470 "2: lr %[tmp],%[prev]\n"
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 471 "3: cs %[prev],%[new],%[address]\n"
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 472 "4: jnl 5f\n"
4148575abe1e14 Heiko Carstens 2022-11-02 473 " xr %[tmp],%[prev]\n"
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 474 " xr %[new],%[tmp]\n"
4148575abe1e14 Heiko Carstens 2022-11-02 475 " nr %[tmp],%[mask]\n"
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 476 " jnz 5f\n"
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 477 " brct %[count],2b\n"
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 478 "5: sacf 768\n"
4148575abe1e14 Heiko Carstens 2022-11-02 479 " spka %[default_key]\n"
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 480 EX_TABLE_UA_LOAD_REG(0b, 5b, %[rc], %[prev])
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 481 EX_TABLE_UA_LOAD_REG(1b, 5b, %[rc], %[prev])
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 482 EX_TABLE_UA_LOAD_REG(3b, 5b, %[rc], %[prev])
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 483 EX_TABLE_UA_LOAD_REG(4b, 5b, %[rc], %[prev])
4148575abe1e14 Heiko Carstens 2022-11-02 484 : [rc] "+&d" (rc),
4148575abe1e14 Heiko Carstens 2022-11-02 485 [prev] "=&d" (prev),
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 486 [address] "+Q" (*(int *)address),
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 487 [tmp] "+&d" (_old),
51098f0eb22e2f Janis Schoetterl-Glausch 2022-11-16 488 [new] "+&d" (_new),
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 489 [mask] "+&d" (mask),
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 490 [count] "=a" (count)
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 491 : [key] "%[count]" (key << 4),
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 492 [default_key] "J" (PAGE_DEFAULT_KEY),
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 493 [max_loops] "J" (CMPXCHG_USER_KEY_MAX_LOOPS)
4148575abe1e14 Heiko Carstens 2022-11-02 494 : "memory", "cc");
4148575abe1e14 Heiko Carstens 2022-11-02 495 *(unsigned short *)uval = prev >> shift;
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 496 if (!count)
739ad2e4e15b58 Janis Schoetterl-Glausch 2022-11-17 497 rc = -EAGAIN;
4148575abe1e14 Heiko Carstens 2022-11-02 498 return rc;
4148575abe1e14 Heiko Carstens 2022-11-02 499 }
4148575abe1e14 Heiko Carstens 2022-11-02 500 case 4: {
4148575abe1e14 Heiko Carstens 2022-11-02 501 unsigned int prev = old;
4148575abe1e14 Heiko Carstens 2022-11-02 502
4148575abe1e14 Heiko Carstens 2022-11-02 503 asm volatile(
4148575abe1e14 Heiko Carstens 2022-11-02 504 " spka 0(%[key])\n"
4148575abe1e14 Heiko Carstens 2022-11-02 505 " sacf 256\n"
4148575abe1e14 Heiko Carstens 2022-11-02 506 "0: cs %[prev],%[new],%[address]\n"
4148575abe1e14 Heiko Carstens 2022-11-02 507 "1: sacf 768\n"
4148575abe1e14 Heiko Carstens 2022-11-02 508 " spka %[default_key]\n"
4148575abe1e14 Heiko Carstens 2022-11-02 509 EX_TABLE_UA_LOAD_REG(0b, 1b, %[rc], %[prev])
4148575abe1e14 Heiko Carstens 2022-11-02 510 EX_TABLE_UA_LOAD_REG(1b, 1b, %[rc], %[prev])
4148575abe1e14 Heiko Carstens 2022-11-02 511 : [rc] "+&d" (rc),
4148575abe1e14 Heiko Carstens 2022-11-02 512 [prev] "+&d" (prev),
4148575abe1e14 Heiko Carstens 2022-11-02 513 [address] "+Q" (*(int *)address)
4148575abe1e14 Heiko Carstens 2022-11-02 514 : [new] "d" ((unsigned int)new),
4148575abe1e14 Heiko Carstens 2022-11-02 515 [key] "a" (key << 4),
4148575abe1e14 Heiko Carstens 2022-11-02 516 [default_key] "J" (PAGE_DEFAULT_KEY)
4148575abe1e14 Heiko Carstens 2022-11-02 517 : "memory", "cc");
4148575abe1e14 Heiko Carstens 2022-11-02 518 *(unsigned int *)uval = prev;
4148575abe1e14 Heiko Carstens 2022-11-02 519 return rc;
4148575abe1e14 Heiko Carstens 2022-11-02 520 }
4148575abe1e14 Heiko Carstens 2022-11-02 521 case 8: {
4148575abe1e14 Heiko Carstens 2022-11-02 522 unsigned long prev = old;
4148575abe1e14 Heiko Carstens 2022-11-02 523
4148575abe1e14 Heiko Carstens 2022-11-02 524 asm volatile(
4148575abe1e14 Heiko Carstens 2022-11-02 525 " spka 0(%[key])\n"
4148575abe1e14 Heiko Carstens 2022-11-02 526 " sacf 256\n"
4148575abe1e14 Heiko Carstens 2022-11-02 527 "0: csg %[prev],%[new],%[address]\n"
4148575abe1e14 Heiko Carstens 2022-11-02 528 "1: sacf 768\n"
4148575abe1e14 Heiko Carstens 2022-11-02 529 " spka %[default_key]\n"
4148575abe1e14 Heiko Carstens 2022-11-02 530 EX_TABLE_UA_LOAD_REG(0b, 1b, %[rc], %[prev])
4148575abe1e14 Heiko Carstens 2022-11-02 531 EX_TABLE_UA_LOAD_REG(1b, 1b, %[rc], %[prev])
4148575abe1e14 Heiko Carstens 2022-11-02 532 : [rc] "+&d" (rc),
4148575abe1e14 Heiko Carstens 2022-11-02 533 [prev] "+&d" (prev),
4148575abe1e14 Heiko Carstens 2022-11-02 534 [address] "+QS" (*(long *)address)
4148575abe1e14 Heiko Carstens 2022-11-02 535 : [new] "d" ((unsigned long)new),
4148575abe1e14 Heiko Carstens 2022-11-02 536 [key] "a" (key << 4),
4148575abe1e14 Heiko Carstens 2022-11-02 537 [default_key] "J" (PAGE_DEFAULT_KEY)
4148575abe1e14 Heiko Carstens 2022-11-02 538 : "memory", "cc");
4148575abe1e14 Heiko Carstens 2022-11-02 539 *(unsigned long *)uval = prev;
4148575abe1e14 Heiko Carstens 2022-11-02 540 return rc;
4148575abe1e14 Heiko Carstens 2022-11-02 541 }
4148575abe1e14 Heiko Carstens 2022-11-02 542 case 16: {
4148575abe1e14 Heiko Carstens 2022-11-02 543 __uint128_t prev = old;
4148575abe1e14 Heiko Carstens 2022-11-02 544
4148575abe1e14 Heiko Carstens 2022-11-02 545 asm volatile(
4148575abe1e14 Heiko Carstens 2022-11-02 546 " spka 0(%[key])\n"
4148575abe1e14 Heiko Carstens 2022-11-02 547 " sacf 256\n"
4148575abe1e14 Heiko Carstens 2022-11-02 548 "0: cdsg %[prev],%[new],%[address]\n"
4148575abe1e14 Heiko Carstens 2022-11-02 549 "1: sacf 768\n"
4148575abe1e14 Heiko Carstens 2022-11-02 550 " spka %[default_key]\n"
4148575abe1e14 Heiko Carstens 2022-11-02 551 EX_TABLE_UA_LOAD_REGPAIR(0b, 1b, %[rc], %[prev])
4148575abe1e14 Heiko Carstens 2022-11-02 552 EX_TABLE_UA_LOAD_REGPAIR(1b, 1b, %[rc], %[prev])
4148575abe1e14 Heiko Carstens 2022-11-02 553 : [rc] "+&d" (rc),
4148575abe1e14 Heiko Carstens 2022-11-02 554 [prev] "+&d" (prev),
4148575abe1e14 Heiko Carstens 2022-11-02 555 [address] "+QS" (*(__int128_t *)address)
4148575abe1e14 Heiko Carstens 2022-11-02 556 : [new] "d" (new),
4148575abe1e14 Heiko Carstens 2022-11-02 557 [key] "a" (key << 4),
4148575abe1e14 Heiko Carstens 2022-11-02 558 [default_key] "J" (PAGE_DEFAULT_KEY)
4148575abe1e14 Heiko Carstens 2022-11-02 559 : "memory", "cc");
4148575abe1e14 Heiko Carstens 2022-11-02 560 *(__uint128_t *)uval = prev;
4148575abe1e14 Heiko Carstens 2022-11-02 561 return rc;
4148575abe1e14 Heiko Carstens 2022-11-02 562 }
4148575abe1e14 Heiko Carstens 2022-11-02 563 }
4148575abe1e14 Heiko Carstens 2022-11-02 564 __cmpxchg_user_key_called_with_bad_pointer();
4148575abe1e14 Heiko Carstens 2022-11-02 565 return rc;
4148575abe1e14 Heiko Carstens 2022-11-02 566 }
4148575abe1e14 Heiko Carstens 2022-11-02 567
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (122052 bytes)
Powered by blists - more mailing lists