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

Re: MISRA: Compatible declarations for sort and bsearch


  • To: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 27 Nov 2023 15:59:01 +0100
  • 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=huXVDHiHts0e+I2NQzjcV9hrChBr6RWKEkS+mrK+Ge0=; b=fQm5im2dGd+Z2g6yMJ9r7fYhc0vDMatKPcAjghhtDID+rChmOxY+u6fkedurLtZgOd5jN6TC9Wo4t6LXWjhEmIG9Qc9DUW5SJZgXH6Vsq6k2jx+CtZbq/4XqD+r9NUVuRUg/tV9gdY95wqrm0rTFboDLNPk2PTlVEj2zKQq7FdDCuvrDchJzZlDSa8dTzl3LxLiQJLYiW+UJywjPRAV4CISDMqmcXYN30FRnpZLB7M2/MciqDVm5Vg57qdYNpkbrMyg1k9FiPXV5ebgyKf7KF0UKoAO7UQAkNoo3Qyc/xnisz6CqImzhpj3QOONNB7TyraOlW3zrTZ++GjcUrXo2cg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DD81iWiWbGbHjBIBakaOcZJjJYhRiy/2WEa1kMCOovaEayov0vZXLG4Q9zteAuktKBOFQvasAC/Lwhm3umWl/zsLj6PEgu71AMheYhdZPO+tQqwR6tGC1KQbiWYzElQBLTEH6I/zS+LQ/WWBX6lBWeRYIh0Q3fXLPfEXmbXRV0XHgcSj144QYdGkDPJYNkwZAU4BMR9y8YMuJsZo2oZOmkvsFKeAVIyyHhdyoG+Ba5QXc8JWTYWTUG+BFLr6rDCY5C9EsINcOVbopRzAsfv28+IsSzbjm7S2vnCGnOSFL3u0RyiBjtA8rliedBJiaSIW+pRekx7uHi5kK4/uPaD5lQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Autocrypt: addr=jbeulich@xxxxxxxx; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Andrew Cooper3 <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Xen Devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 27 Nov 2023 14:59:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 27.11.2023 15:32, Nicola Vetrini wrote:
> Still on the matter of Rule 8.4, though not related to bsearch or sort:
> 
> - the definition of do_mca in x86/cpu/mcheck/mca.c has the following 
> header:
>    #include <xen/hypercall.h> /* for do_mca */
>    which in turn leads to x86/include/asm/hypercall.h, which includes the 
> following:
>    #include <public/arch-x86/xen-mca.h> /* for do_mca */
> 
>    where I can't see a declaration for do_mca, as I would have expected. 
> I'd like to understand what's going on here, since I may be missing some 
> piece of information (perhaps something is generated during the build).

It can't possibly live in the public header. The comment simply went
stale with the auto-generation of headers; the decl is in hypercall-defs.h
now.

> - x86/traps.c do_general_protection may want a declaration in 
> x86/include/asm/traps.h, or perhaps it should gain the asmlinkage 
> attribute, given that it's used only by asm and the TU that defines it.

Neither is really attractive imo.

> - function test and variable data in x86/efi/check.c look like they 
> should not be MISRA compliant, so they may be added to the 
> exclude-list.json

This file isn't contributing to the final binary.

> - given the comment in xen/common/page_alloc.c for first_valid_mfn
> 
> /*
>   * first_valid_mfn is exported because it is use in ARM specific NUMA
>   * helpers. See comment in arch/arm/include/asm/numa.h.
>   */
> mfn_t first_valid_mfn = INVALID_MFN_INITIALIZER;
> 
> and the related ARM comment
> 
> /*
>   * TODO: make first_valid_mfn static when NUMA is supported on Arm, this
>   * is required because the dummy helpers are using it.
>   */
> extern mfn_t first_valid_mfn;
> 
> it should probably be deviated.

NUMA work is still in progress for Arm, I think, so I'd rather wait with
deviating.

> - compat_set_{px,cx}_pminfo in x86/x86_64/cpufreq.c are perhaps declared 
> with an autogenerated header?

I don't think so. Only top-level hypercall handlers would be. This works by
(perhaps even unintentional) trickery: xen/pmstat.h is included only after
set_{c,p}x_pminfo are re-defined to compat_set_{c,p}x_pminfo, so the same
declarations happen to serve two purposes (but of course don't provide the
intended caller/callee agreement).

Jan



 


Rackspace

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