Linux Kernel Selftest development
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: Naresh Kamboju <naresh.kamboju@linaro.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:KERNEL SELFTEST FRAMEWORK"
	<linux-kselftest@vger.kernel.org>, <lkft-triage@lists.linaro.org>,
	"Linux Regressions" <regressions@lists.linux.dev>
Cc: Fenghua Yu <fenghua.yu@intel.com>, Shuah Khan <shuah@kernel.org>,
	"Anders Roxell" <anders.roxell@linaro.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Dan Carpenter" <dan.carpenter@linaro.org>
Subject: Re: selftests: resctrl: cat_test.c: In function 'noncont_cat_run_test': ../kselftest.h:74:9: error: impossible constraint in 'asm' 74 | __asm__ __volatile__ ("cpuid\n\t"
Date: Thu, 18 Apr 2024 10:14:02 -0700	[thread overview]
Message-ID: <5e5d138f-c9f0-4d0a-b116-8dd6879c7872@intel.com> (raw)
In-Reply-To: <CA+G9fYvJ7=rahqJ9g35=XzEvAq9+zAiq8PNhBE-ceb2EED2gnA@mail.gmail.com>



On 4/18/2024 2:37 AM, Naresh Kamboju wrote:
> The Linux next building selftests with gcc-13 found these build warnings
> and errors.
> 
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> 
> Build log:
> ---------
> Path:
> selftests/resctrl/resctrl_tests/
> 
> In file included from resctrl.h:24,
>                  from cat_test.c:11:
> cat_test.c: In function 'noncont_cat_run_test':
> ../kselftest.h:74:9: error: impossible constraint in 'asm'
>    74 |         __asm__ __volatile__ ("cpuid\n\t"
>          \
>       |         ^~~~~~~
> cat_test.c:308:17: note: in expansion of macro '__cpuid_count'
>   308 |                 __cpuid_count(0x10, 1, eax, ebx, ecx, edx);
>       |                 ^~~~~~~~~~~~~
> ../kselftest.h:74:9: error: impossible constraint in 'asm'
>    74 |         __asm__ __volatile__ ("cpuid\n\t"
>          \
>       |         ^~~~~~~
> cat_test.c:310:17: note: in expansion of macro '__cpuid_count'
>   310 |                 __cpuid_count(0x10, 2, eax, ebx, ecx, edx);
>       |                 ^~~~~~~~~~~~~
> 

This is unexpected to me. kselftest.h intends to and still does define
__cpuid_count() exactly the same as gcc does (in gcc/config/i386/cpuid.h):


 255 #define __cpuid_count(level, count, a, b, c, d)                         \
 256   __asm__ __volatile__ ("cpuid\n\t"                                     \
 257                         : "=a" (a), "=b" (b), "=c" (c), "=d" (d)        \
 258                         : "0" (level), "2" (count))

Reinette

      reply	other threads:[~2024-04-18 17:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-18  9:37 selftests: resctrl: cat_test.c: In function 'noncont_cat_run_test': ../kselftest.h:74:9: error: impossible constraint in 'asm' 74 | __asm__ __volatile__ ("cpuid\n\t" Naresh Kamboju
2024-04-18 17:14 ` Reinette Chatre [this message]

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=5e5d138f-c9f0-4d0a-b116-8dd6879c7872@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=anders.roxell@linaro.org \
    --cc=arnd@arndb.de \
    --cc=dan.carpenter@linaro.org \
    --cc=fenghua.yu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=lkft-triage@lists.linaro.org \
    --cc=naresh.kamboju@linaro.org \
    --cc=regressions@lists.linux.dev \
    --cc=shuah@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox