All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org,
	Sean Christopherson <sean.j.christopherson@intel.com>,
	Andi Kleen <ak@linux.intel.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: [intel-tdx:guest 52/126] arch/x86/kernel/acpi/boot.c:366:2: error: call to __compiletime_assert_231 declared with 'error' attribute: Need native word sized stores/loads for atomicity.
Date: Fri, 1 Oct 2021 19:30:58 +0800	[thread overview]
Message-ID: <202110011948.2kHXi3CT-lkp@intel.com> (raw)

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

tree:   https://github.com/intel/tdx.git guest
head:   00e7708dd946e76b7a5e973162ae71111ca32aea
commit: e9bff1eb5c1a34cb670fafd2b7a091ccfa626b66 [52/126] x86/acpi, x86/boot: Add multiprocessor wake-up support
config: i386-randconfig-a015-20211001 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 962e503cc8bc411f7523cc393acae8aae425b1c4)
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/tdx/commit/e9bff1eb5c1a34cb670fafd2b7a091ccfa626b66
        git remote add intel-tdx https://github.com/intel/tdx.git
        git fetch --no-tags intel-tdx guest
        git checkout e9bff1eb5c1a34cb670fafd2b7a091ccfa626b66
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

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/kernel/acpi/boot.c:366:2: error: call to __compiletime_assert_231 declared with 'error' attribute: Need native word sized stores/loads for atomicity.
           smp_store_release(&acpi_mp_wake_mailbox->wakeup_vector, start_ip);
           ^
   include/asm-generic/barrier.h:138:33: note: expanded from macro 'smp_store_release'
   #define smp_store_release(p, v) __smp_store_release(p, v)
                                   ^
   arch/x86/include/asm/barrier.h:65:2: note: expanded from macro '__smp_store_release'
           compiletime_assert_atomic_type(*p);                             \
           ^
   include/linux/compiler_types.h:325:2: note: expanded from macro 'compiletime_assert_atomic_type'
           compiletime_assert(__native_word(t),                            \
           ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:303:4: note: expanded from macro '__compiletime_assert'
                           prefix ## suffix();                             \
                           ^
   <scratch space>:189:1: note: expanded from here
   __compiletime_assert_231
   ^
   1 error generated.


vim +/error +366 arch/x86/kernel/acpi/boot.c

   333	
   334	static int acpi_wakeup_cpu(int apicid, unsigned long start_ip)
   335	{
   336		u8 timeout = 0xFF;
   337	
   338		/* Remap mailbox memory only for the first call to acpi_wakeup_cpu() */
   339		if (physids_empty(apic_id_wakemap)) {
   340			acpi_mp_wake_mailbox = memremap(acpi_mp_wake_mailbox_paddr,
   341							sizeof(*acpi_mp_wake_mailbox),
   342							MEMREMAP_WB);
   343		}
   344	
   345		/*
   346		 * According to the ACPI specification r6.4, sec 5.2.12.19, the
   347		 * mailbox-based wakeup mechanism cannot be used more than once
   348		 * for the same CPU, so skip sending wake commands to already
   349		 * awake CPU.
   350		 */
   351		if (physid_isset(apicid, apic_id_wakemap)) {
   352			pr_err("CPU already awake (APIC ID %x), skipping wakeup\n",
   353			       apicid);
   354			return -EINVAL;
   355		}
   356	
   357		/*
   358		 * Mailbox memory is shared between firmware and OS. Firmware will
   359		 * listen on mailbox command address, and once it receives the wakeup
   360		 * command, CPU associated with the given apicid will be booted. So,
   361		 * the value of apic_id and wakeup_vector has to be set before updating
   362		 * the wakeup command. So use smp_store_release to let the compiler know
   363		 * about it and preserve the order of writes.
   364		 */
   365		smp_store_release(&acpi_mp_wake_mailbox->apic_id, apicid);
 > 366		smp_store_release(&acpi_mp_wake_mailbox->wakeup_vector, start_ip);
   367		smp_store_release(&acpi_mp_wake_mailbox->command,
   368				  ACPI_MP_WAKE_COMMAND_WAKEUP);
   369	
   370		/*
   371		 * After writing wakeup command, wait for maximum timeout of 0xFF
   372		 * for firmware to reset the command address back zero to indicate
   373		 * the successful reception of command.
   374		 * NOTE: 255 as timeout value is decided based on our experiments.
   375		 *
   376		 * XXX: Change the timeout once ACPI specification comes up with
   377		 *      standard maximum timeout value.
   378		 */
   379		while (READ_ONCE(acpi_mp_wake_mailbox->command) && timeout--)
   380			cpu_relax();
   381	
   382		if (timeout) {
   383			/*
   384			 * If the CPU wakeup process is successful, store the
   385			 * status in apic_id_wakemap to prevent re-wakeup
   386			 * requests.
   387			 */
   388			physid_set(apicid, apic_id_wakemap);
   389			return 0;
   390		}
   391	
   392		/* If timed out (timeout == 0), return error */
   393		return -EIO;
   394	}
   395	

---
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: 40607 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [intel-tdx:guest 52/126] arch/x86/kernel/acpi/boot.c:366:2: error: call to __compiletime_assert_231 declared with 'error' attribute: Need native word sized stores/loads for atomicity.
Date: Fri, 01 Oct 2021 19:30:58 +0800	[thread overview]
Message-ID: <202110011948.2kHXi3CT-lkp@intel.com> (raw)

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

tree:   https://github.com/intel/tdx.git guest
head:   00e7708dd946e76b7a5e973162ae71111ca32aea
commit: e9bff1eb5c1a34cb670fafd2b7a091ccfa626b66 [52/126] x86/acpi, x86/boot: Add multiprocessor wake-up support
config: i386-randconfig-a015-20211001 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 962e503cc8bc411f7523cc393acae8aae425b1c4)
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/tdx/commit/e9bff1eb5c1a34cb670fafd2b7a091ccfa626b66
        git remote add intel-tdx https://github.com/intel/tdx.git
        git fetch --no-tags intel-tdx guest
        git checkout e9bff1eb5c1a34cb670fafd2b7a091ccfa626b66
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

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/kernel/acpi/boot.c:366:2: error: call to __compiletime_assert_231 declared with 'error' attribute: Need native word sized stores/loads for atomicity.
           smp_store_release(&acpi_mp_wake_mailbox->wakeup_vector, start_ip);
           ^
   include/asm-generic/barrier.h:138:33: note: expanded from macro 'smp_store_release'
   #define smp_store_release(p, v) __smp_store_release(p, v)
                                   ^
   arch/x86/include/asm/barrier.h:65:2: note: expanded from macro '__smp_store_release'
           compiletime_assert_atomic_type(*p);                             \
           ^
   include/linux/compiler_types.h:325:2: note: expanded from macro 'compiletime_assert_atomic_type'
           compiletime_assert(__native_word(t),                            \
           ^
   note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
   include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:303:4: note: expanded from macro '__compiletime_assert'
                           prefix ## suffix();                             \
                           ^
   <scratch space>:189:1: note: expanded from here
   __compiletime_assert_231
   ^
   1 error generated.


vim +/error +366 arch/x86/kernel/acpi/boot.c

   333	
   334	static int acpi_wakeup_cpu(int apicid, unsigned long start_ip)
   335	{
   336		u8 timeout = 0xFF;
   337	
   338		/* Remap mailbox memory only for the first call to acpi_wakeup_cpu() */
   339		if (physids_empty(apic_id_wakemap)) {
   340			acpi_mp_wake_mailbox = memremap(acpi_mp_wake_mailbox_paddr,
   341							sizeof(*acpi_mp_wake_mailbox),
   342							MEMREMAP_WB);
   343		}
   344	
   345		/*
   346		 * According to the ACPI specification r6.4, sec 5.2.12.19, the
   347		 * mailbox-based wakeup mechanism cannot be used more than once
   348		 * for the same CPU, so skip sending wake commands to already
   349		 * awake CPU.
   350		 */
   351		if (physid_isset(apicid, apic_id_wakemap)) {
   352			pr_err("CPU already awake (APIC ID %x), skipping wakeup\n",
   353			       apicid);
   354			return -EINVAL;
   355		}
   356	
   357		/*
   358		 * Mailbox memory is shared between firmware and OS. Firmware will
   359		 * listen on mailbox command address, and once it receives the wakeup
   360		 * command, CPU associated with the given apicid will be booted. So,
   361		 * the value of apic_id and wakeup_vector has to be set before updating
   362		 * the wakeup command. So use smp_store_release to let the compiler know
   363		 * about it and preserve the order of writes.
   364		 */
   365		smp_store_release(&acpi_mp_wake_mailbox->apic_id, apicid);
 > 366		smp_store_release(&acpi_mp_wake_mailbox->wakeup_vector, start_ip);
   367		smp_store_release(&acpi_mp_wake_mailbox->command,
   368				  ACPI_MP_WAKE_COMMAND_WAKEUP);
   369	
   370		/*
   371		 * After writing wakeup command, wait for maximum timeout of 0xFF
   372		 * for firmware to reset the command address back zero to indicate
   373		 * the successful reception of command.
   374		 * NOTE: 255 as timeout value is decided based on our experiments.
   375		 *
   376		 * XXX: Change the timeout once ACPI specification comes up with
   377		 *      standard maximum timeout value.
   378		 */
   379		while (READ_ONCE(acpi_mp_wake_mailbox->command) && timeout--)
   380			cpu_relax();
   381	
   382		if (timeout) {
   383			/*
   384			 * If the CPU wakeup process is successful, store the
   385			 * status in apic_id_wakemap to prevent re-wakeup
   386			 * requests.
   387			 */
   388			physid_set(apicid, apic_id_wakemap);
   389			return 0;
   390		}
   391	
   392		/* If timed out (timeout == 0), return error */
   393		return -EIO;
   394	}
   395	

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

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

             reply	other threads:[~2021-10-01 11:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-01 11:30 kernel test robot [this message]
2021-10-01 11:30 ` [intel-tdx:guest 52/126] arch/x86/kernel/acpi/boot.c:366:2: error: call to __compiletime_assert_231 declared with 'error' attribute: Need native word sized stores/loads for atomicity kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202110011948.2kHXi3CT-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ak@linux.intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=rjw@rjwysocki.net \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=sean.j.christopherson@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.