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

Re: [PATCH 1/4] x86/cpufeature: Rework {boot_,}cpu_has()


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 19 May 2023 16:24:09 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=HNP+hd6PJCKQUi6fnXVetMNIKRZNgvYVVI0wBMveiV0=; b=SI/11bbarwkNm+CNG1+epwpbB3U0QKgoF97xYTOLKN129rGub3KYvgt5+acbr89LLm5PQm2HPUv9BVaooLa8ffxnW0/aWaRJ5OGTBC3beWxrd2Xsm7Q3qxQgUkqrIZcWn+BngmUjk4/nq1Akxwc8GDoq6p760WBN55DhtnBEP2gP7ggkXOfWwxICtKflMpNAl8EUii4mt6Ii+E/ZJI+JO+uGt5JD2pnW1dmhOZi9SLfvtPCKRRqUXH8lwdUktH/QX5adDDQtfG6/CPNn+i00Jrf9Ckct/rPtLukNKXFRzEYrNJ4cg6sxjTd/RwUdvPHEWuDWonFCRmmfO5L/mZWhQw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HkWfVYTjbq8epxVTY/cT7C5jrROlxxX+VD6Rf2puIOaIB7hDtKCmkTMnXAEWd2Fdqt0SQdtcnKn1Nry0zp3m/I+ZRTS0zVIkvt0szQHtmN13lz+n8IzYxWcI5oKb8TQMYHc0zNOkjqRS9CY934XlvZYP4sGN3slpMwKWvOEVMbp0uWQCPaAjk2ObOrXmrPeQZN9bhtrJcx4Fy6Gsy8TNY9mqH0Da+eV5tcDH75FkTqv4Jp6QNPdDb8MDGju1fVLNY9AY3mA8ITcY9aRRyJTDHGab1GYFFJjoGoVK9uiHWG3xn8dROjSGPlXuTE3en4AMfdP7UoD6jilp8DuJb7DjCw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 19 May 2023 15:24:44 +0000
  • Ironport-data: A9a23:UZDHm65MjjnNsj6sghAvQQxRtBXGchMFZxGqfqrLsTDasY5as4F+v jAZX2uPO6mDMGv2c9tzb4zk/B4CuJSGxoM1SABs/ig1Hi5G8cbLO4+Ufxz6V8+wwm8vb2o8t plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraCYnsrLeNdYH9JoQp5nOIkiZJfj9G8Agec0 fv/uMSaM1K+s9JOGjt8B5mr9lU35JwehBtC5gZlPa0S7QeE/5UoJMl3yZ+ZfiOQrrZ8RoZWd 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5mq PopCBxSbSq4naGw0OiiRfBThtYkM5y+VG8fkikIITDxK98DGcyGb4CUoNhS0XE3m9xEGuvYa 4wBcz1zYR/cYhpJfFAKFJY5m+TujX76G9FagAvN+exrvC6Ml0otgdABM/KMEjCObexTklyVu STt+GPhDwtBHNee1SCE4jSngeqncSbTAdpCSObjrKU16LGV7lIRIUMQfwHgndb6pGGjA+9QC UUO5BN7+MDe82TuFLERRSaQonSJoxodUNp4CPAh5UeGza+8yxmdLngJSHhGctNOnN87Q3km2 0GEm/vtBCdzq/uFRHSF7LCWoDiufy8PIgc/iTQsSAIE55zvpd81hxeXEtJ7Svbp35vyBC36x C2MoG4mnbIPgMUX1qK9u1fanzaroZuPRQkwjunKYl+YAspCTNbNT+SVBZLztKkowFqxJrVZg EU5pg==
  • Ironport-hdrordr: A9a23:hIXrD69tdZxNQnfTLc5uk+HFdr1zdoMgy1knxilNoENuH/Bwxv rFoB1E73TJYVYqN03IV+rwQZVoMkmskqKdhrNhQItKPTOWwldASbsP0WKM+UyCJ8STzJ856U 4kSdkENDSSNykFsS+Z2mmF+r8bqbHokZxAx92ut0uFJTsaFJ2IhD0JbjpzfHcGIjWuSaBJdq Z1saF81kadkDksH4yG7j5vZZmwm/T70LbdJTIWDR8u7weDyRuu9b7BChCdmjsOTj9Vxr8m0G 7d1yj0/L+qvf2XwgLVkza71eUbpPLRjv94QOCcgMkcLTvhzi6ueYRaQrWH+Bwlve21714usd /U5zMtJd565X/9dny85THtxw7j+jAz7GKK8y7UvVLT5ejCAB4qActIgoxUNjPf9kobpdl5lI ZGxXiQuZZ7BQ7J2H2V3amDazha0m6P5VYym+8aiHJSFaMYdb9qtIQauGdYCo0JEi7W4J0uVM NuEMbfzvBLdk7yVQGTgkBfhPiXGlgjFBaPRUYP/uSTzjhthXh8i3AVwcQO901wg64Vet1h3a DpI65onLZBQos9dqRmHtoMRsOxFyjkXQ/MGHj6GyWmKIg3f1b277Ln6rQ84++nPLYSyoEppZ jHWFRE8UYvZkPVD9GU1pEjyGGNfIyEZ0Wu9ihi3ek9hlWlL4CbdRFrCWpe3fdIms9vQfEyAJ 2ISdVr6/yKFxqbJW8G5Xy5Z3BoEwhsbCQkgKdLZ7uwmLO6FmTLjJ2sTB+BHsulLR8UHkXCP1 AkYB/fYO1902HDYA6MvPGWYQKjRnDC
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 17/05/2023 3:01 pm, Jan Beulich wrote:
> On 16.05.2023 16:53, Andrew Cooper wrote:
>> --- a/xen/arch/x86/include/asm/cpufeature.h
>> +++ b/xen/arch/x86/include/asm/cpufeature.h
>> @@ -7,6 +7,7 @@
>>  #define __ASM_I386_CPUFEATURE_H
>>  
>>  #include <xen/const.h>
>> +#include <xen/stdbool.h>
>>  #include <asm/cpuid.h>
> This isn't needed up here, and ...
>
>> @@ -17,7 +18,6 @@
>>  #define X86_FEATURE_ALWAYS      X86_FEATURE_LM
>>  
>>  #ifndef __ASSEMBLY__
>> -#include <xen/bitops.h>
> ... putting it here would (a) eliminate a header dependency for
> assembly sources including this file (perhaps indirectly) and (b)
> eliminate the risk of a build breakage if something was added to
> that header which isn't valid assembly.

b) That's a weak argument for headers in general, but you're saying it
about our copy of stdbool.h which probably the least likely header for
that ever to be true.

a) Not really, because cpuid.h pulls in a reasonable chunk of the world,
including types.h and therefore stdbool.h.  cpuid.h is necessary to make
the X86_FEATURE_ALWAYS -> X86_FEATURE_LM, which is used by asm for
alternatives.

I'm tempted to just omit it.  cpufeature.h has one of the most tangled
set of headers we've got, and I can't find any reasonable way to make it
less bad.

> Preferably with the adjustment
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Thanks,

~Andrew



 


Rackspace

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