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

Re: [XEN PATCH v6 5/7] xen/x86: address violations of MISRA C:2012 Rule 7.2


  • To: Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 13 Sep 2023 11:53:53 +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=wrsb4kzwRVo3Pofm0OhR+ZGLA4UNrf6gXBrOLVhti4I=; b=NxwwJ3zkQwwpPdkobYaxkvkS71+Aov7LKLBScb7evW1fJZ5B/cTpJYZ7ViytlhTOw+MeFVqbnvcYBm+O151b+uUaPVqtKZ2PVmUrSTfmWb62+652Cziq8ger+WufZMlqZQrDiZSd+9aTLTWDNcbeMyyeOPKZ+2vCOxarTsrJntKZfMZFuC571MEVgXzE6REwR2NAbWH8fG63DhZ0zMdeb53/DtRwIxisyeIfT6GdVUbAaJ1ODdTe5uhKUlRIwFDMeMc/AaLt53jwgIpkssRoSterhLxMXi8kMYQuU+DT/mcHO+O5jiue5XLP9jVR9KJ1adzHDK0ldNL8Cg4nwC3dpw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gt2FGKUoI8LKUysHjlBs1gDUkxW4OAgqeoeoVGkCScA0rRkabdw8ZTc18KR8VGtLUZ3ImpF2gSs1GsXphqzOJbgFLTAaYLbzf3PI690PpXl64tJoemKE8YPHA1eZ7dyOFiwLSkMlb9SaZJ2hgmPAecWjA4uKdDbeuKmuVETtHB0roo8TQXsXJy2ieQrToCs8DqU/mBV/DO8HZKBeofKBH0UcZ11Ap8KWfBuCdOZjyOKmtF9YeKJ42gtGJsv9d8MBMn9RH5yCSan9hzFXx4/hR+C7Te89a+dxff95a0VnxbnNH+aKyeRgAmaW3s3t923R7TC07gmYfjLsRUaCztiSVA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: consulting@xxxxxxxxxxx, sstabellini@xxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 13 Sep 2023 09:54:05 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12.09.2023 17:39, Simone Ballarin wrote:
> --- a/xen/arch/x86/percpu.c
> +++ b/xen/arch/x86/percpu.c
> @@ -12,7 +12,7 @@ unsigned long __per_cpu_offset[NR_CPUS];
>   * possible #PF at (NULL + a little) which has security implications in the
>   * context of PV guests.
>   */
> -#define INVALID_PERCPU_AREA (0x8000000000000000L - (long)__per_cpu_start)
> +#define INVALID_PERCPU_AREA (0x8000000000000000UL - (long)__per_cpu_start)

Looking at this change the n-th , I can't help considering the result
inconsistent. Imo either the cast also wants changing, or the constant
wants to become -0x8000000000000000L (in whichever way is appropriate
to express it without violating any of the sometimes picky Misra rules;
maybe ~0x7fffffffffffffffL would work).

Jan



 


Rackspace

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