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

Re: [PATCH v2.5 3/3] xen/types: Rework stdint vs __{u,s}$N types


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 4 Jul 2023 18:10:08 +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=OaOq7/wv29wZjSZRbL/M3qEI7N0Fz0HPjs+f+AcSvhQ=; b=jYeTxvuGJIQpn5IvbEXCpkj5qfunDy3JLSvieD4p2o4viTzlY+60BWvJwp4UC/5dlQWq9fsrWC1GkhM7CE2Wk0YEnXLkGpDrLpaR/ysfeqrRNTYEoHCA778IUW2Iumc2uRqPh/mueh00976y4K3XfSdTL/MTrPDNd1cMHkmfwwORBI2Nt+RAWE/pWyvINwuyMCa93VfePFAJ9rJsxIROXGGflobD7pA3YkpfR9z1XFjI2cU7ospPQJteg5LpAsqyxfqnXK56G1Z9giaBixOC5lr/rtH+noSe9LGiWzlV/O/BEsDzoQfEyd8B/Q981uoTDutRhdMJ3PGj1iS6vPe4Vg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n39cnCBrCDSGX9wet+s/jz0VuPslPIwvkN16Dz1PbFffNZCYiN4W6r1jiuFPoHN10tKTtWg/U67iFXi4od328aSCfPL26RoSm/UVANtrhAT8VcqbLAychuhSV/jsoY4uFmp/93QeG48wCadm/q5wdiRkIT132VM4VL1vSx0mRZgsiC2tuPlIeYK8IPdm8BlnzsGGFMtUjSHcbqA94VsL3r32RnaYZMkorsEhm9fAu0eiY3Sy+roLVyTdz1AO4M5+XJxzKAq1AteQ/HYPxXvFQKCxGxjhQpatlYer0wpfHp3GenlYM5LmVRefk+sV1MDcQJEtlFWM7iisP3g4Cm2rHA==
  • 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>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Shawn Anastasio <sanastasio@xxxxxxxxxxxxxxxxxxxxx>, Timothy Pearson <tpearson@xxxxxxxxxxxxxxxxxxxxx>, Roberto Bagnara <roberto.bagnara@xxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 04 Jul 2023 17:10:29 +0000
  • Ironport-data: A9a23:TFhjT6PCRY55hdbvrR1ql8FynXyQoLVcMsEvi/4bfWQNrUp31TFUy GJNC2zXP6uCMTOgc95waYvg8UID7JPVxt9nGwto+SlhQUwRpJueD7x1DKtS0wC6dZSfER09v 63yTvGacajYm1eF/k/F3oDJ9CU6jufQAOKnUoYoAwgpLSd8UiAtlBl/rOAwh49skLCRDhiE/ Nj/uKUzAnf8s9JPGjxSs/vrRC9H5qyo42tH5gBmPpingXeF/5UrJMNHTU2OByOQrrl8RoaSW +vFxbelyWLVlz9F5gSNy+uTnuUiG9Y+DCDW4pZkc/HKbitq/0Te5p0TJvsEAXq7vh3S9zxHJ HehgrTrIeshFvWkdO3wyHC0GQkmVUFN0OevzXRSLaV/ZqAJGpfh66wGMa04AWEX0sNZL3sQ0 vEYEj1OMSnSv9icmuqpT/Y506zPLOGzVG8ekldJ6GmFSNwAEdXESaiM4sJE1jAtgMwIBezZe 8cSdTtoalLHfgFLPVAUTpk5mY9EhFGmK2Ee9A3T+vZxvze7IA9ZidABNPL8fNCQSNoTtUGfv m/cpEzyAw0ANczZwj2Amp6prraWwX+nA99LRNVU8NZBvVO25jAJJicddlyrjsL+kFLvZvVQf hl8Fi0G6PJaGFaQZtv3UgC8oXWElgUBQNcWGOo/gCmSzoLE7gDfAXILJhZac8AvvsIyQT0s1 3eKksnvCDgpt6eaIVqf67OVoDWaKSUTa2gYakcscwwB5NXypZApuTjGRN1jDa2dg8X8HHf7x DXihCIznakJhMgHkaCy50nagimEr4LMCAUy423/VGWv5BJ0f46haomh73DU6P9BKMCSSVzpl HEAmtOC5eEUS5+XnSqGQf4lA72iof2CNVX0illpGZ4j+z2z+mWLcoVZ4TU4L0BsWu4DfTLqe 07S/wBM/phYPHitRaByaoO1Tc8tyMDIDt3jX+vIZ8FPZbBrfReb+ztjY0GR2W3gikkqnuc0P pLzWdq0AH8AEqNh5CC/X/say7ItySE4yG7JRJb0iR+g1NK2fnmfRK0ZNx2EZ+8/5bmNiA/I/ M1SMcTMwBJaOMXuby+S/YMNIFQiKXkgGYuwu8FRbvSEIAdtBCcmEfC5/F86U4lsnqAQnOGY+ Hi4AhNc0ACn2SKBLhiWYHd+br+pRYx4sX8wIS0rOxCvxmQnZoGsqqwYcvPbYIUayQCq9tYsJ 9FtRilKKq0npujvk9jFUaTAkQ==
  • Ironport-hdrordr: A9a23:qrav7aP+tXRmVMBcTv6jsMiBIKoaSvp037Dk7TEJdfU1SL3hqy nKpp4mPHDP+VMssR0b6LK90ey7MBDhHP1OgLX5X43SODUO0VHAROpfBMnZowEIcBeOkdK1u5 0QFZSWy+edMbG5t6vHCcWDfOrICePozJyV
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 04/07/2023 3:38 pm, Jan Beulich wrote:
> On 28.06.2023 16:54, Andrew Cooper wrote:
>> Xen uses the stdint types.  Rearrange the types headers to define the
>> compatibility __{u,s}$N types in terms of the stdint types, not the other way
>> around.
>>
>> All supported compilers on architectures other than x86 support the stdint
>> __*_TYPE__ macros.  Move these into a new xen/stdint.h to avoid them being
>> duplicated in each architecture.  For the very old x86 compilers, synthesize
>> suitable types using GCC internals.
>>
>> This cleanup has the side effect of removing all use of the undocumented
>> __signed__ GCC keyword.  This is a vestigial remnant of `gcc -traditional`
>> mode for dialetcs of C prior to the introduction of the signed keyword.
>>
>> No functional change.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

Thanks.

> with one further remark:
>
>> --- /dev/null
>> +++ b/xen/include/xen/stdint.h
>> @@ -0,0 +1,33 @@
>> +/* SPDX-License-Identifier: GPL-2.0-only */
>> +#ifndef __XEN_STDINT_H__
>> +#define __XEN_STDINT_H__
>> +
>> +#ifndef __INT8_TYPE__ /* GCC <= 4.4 */
>> +
>> +/*
>> + * Define the types using GCC internal notation.  Clang understands this 
>> too.
>> + * https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html
>> + */
>> +typedef   signed __attribute__((__mode__(QI)))     int8_t;
>> +typedef unsigned __attribute__((__mode__(QI)))    uint8_t;
>> +typedef   signed __attribute__((__mode__(HI)))    int16_t;
>> +typedef unsigned __attribute__((__mode__(HI)))   uint16_t;
>> +typedef   signed __attribute__((__mode__(SI)))    int32_t;
>> +typedef unsigned __attribute__((__mode__(SI)))   uint32_t;
>> +typedef   signed __attribute__((__mode__(DI)))    int64_t;
>> +typedef unsigned __attribute__((__mode__(DI)))   uint64_t;
> Much like you avoid "mode" potentially being the name of a visible macro,
> the mode identifiers themselves could in principle be, too. Being upper
> case names, perhaps there the risk is even slightly higher. Hence I'd
> prefer if you/we could use __QI__ and alike.

Fixed locally.  I won't resend for just this.

~Andrew



 


Rackspace

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