[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 3/5] x86: allow Kconfig control over psABI level


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 14 Aug 2023 08:44:35 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JmztOBmdaISWMnJO/1SPl2bcLligfuvd0lOQEiLCnHM=; b=DnCwsXH+amwka50Rzn8Hw35b6hPN15jldcivCKtI85fxgcvNiHHjRJF3lCefHbslY2sAIzJH/qWr/uRobuaT7FlYy9JWJjSvi+GFjTqqIE6avH4eyCEJ6PZ6xD+jo7eX5b16QCVwOJw/ifl9pttRibJgHwDwJ+iamsEhNzlrojI5tpTNFBUMuYFKFksaZH97nmASuZV+qhSYoUbSYzfaPrAMw3ZS1d5CFmXov7+z42Ct927spoqp1lIGcCA1SfC4A+8tPMPyndnLcii2DO9fR+qfWyiOuI/WeNP8hsq+ZBGPRy7fmsqHfna9/h4R9Mtx1892MECn6na22VUJFoi42g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D5Eo8G/fl/B4uwCKYEwkF+H5IjSn22zTaF24hICrp8jzNk3Fw4kMTu/BwpHPuWTJp/hrC347OGLT7qoZ4bhoB1zIbbRyPVKnXMsntaqIwZ6EK2EDmwWkGqNpR1uNaeWuRF9bW+A7hvOfb4GAsbsfbVk1Is52XzS+BM3DXuDW9vVWCK4cB2N1uACGK3KZSIcWU62v2rYY7KXaZuIzur2kyDKwqXogOf/ZU/gaotDSTqEtgh03ihNPim7fLhx8UQSolFNX2CM38XifD+O8Z20YqNbdR0fqfwqLsbgDOIOSNsgPkckmBb7pwRJAR5MhiB/rj7DhxYZQIWjj6H6eU/Zzdw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 14 Aug 2023 06:44:54 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 11.08.2023 16:59, Anthony PERARD wrote:
> On Wed, Jul 26, 2023 at 12:34:15PM +0200, Jan Beulich wrote:
>> --- a/xen/arch/x86/arch.mk
>> +++ b/xen/arch/x86/arch.mk
>> @@ -36,6 +36,29 @@ CFLAGS += -mno-red-zone -fpic
>>  # the SSE setup for variadic function calls.
>>  CFLAGS += -mno-mmx -mno-sse $(call cc-option,$(CC),-mskip-rax-setup)
>>  
>> +# Enable the selected baseline ABI, if supported by the compiler.
>> +x86-64-$(CONFIG_X86_64_BASELINE) :=
>> +x86-64-$(CONFIG_X86_64_V2) := x86-64-v2
>> +x86-64-$(CONFIG_X86_64_V3) := x86-64-v3
>> +
>> +ifneq ($(x86-64-y),)
>> +CFLAGS-psabi := $(call cc-option,$(CC),-march=$(x86-64-y))
>> +
>> +ifeq ($(CFLAGS-psabi),)
>> +# Fall back to using the subset of -m... options that are of interest.
>> +x86-64-v2 := -mpopcnt -mcx16
>> +x86-64-v3 := $(x86-64-v2) -mbmi -mbmi2 -mlzcnt -mmovbe -mxsave
>> +$(call cc-options-add,CFLAGS-psabi,CC,$($(x86-64-y)))
>> +
>> +ifneq ($(strip $(CFLAGS-psabi)),$($(x86-64-y)))
>> +$(warning Options not recognized by $(CC): $(filter-out 
>> $(CFLAGS-psabi),$($(x86-64-y))))
>> +XEN_CONFIG_UNSATISFIED += X86_64_Vn
> 
> I think I understand Andrew's point on the previous version of this
> patch. Here, we barely just print a warning if the compiler isn't
> capable to do what we ask, then do the build and maybe print something
> after the fact. So we can end up with a build of Xen with an embedded
> .config which says X86_64_V3 where in fact it's only a build with the
> baseline ABI.

Which isn't really a problem, is it? Even if passed the respective
option, the compiler may equally choose to use none of the thus
available insns. (It won't typically, but it still could.)

> Can't we just fail the build right here instead?

Whether to do so is not the user's choice (see patch 2). See also
both post-commit-message remarks there.

> I don't see any need to let Kconfig know if the compiler can do
> x86-64-vX or not, beside only presenting actual available options in
> `make *config`, and it would override options selected by editing
> .config directly.

I'm afraid I don't understand what you're suggesting here that I do
differently.

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.