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

Re: [XEN PATCH v2 02/10] misra: modify deviations for empty and generated headers


  • To: Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 12 Sep 2023 11:49:14 +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=Du8d1hhfOBMOkMiYhC8V8eRXVi7QybGpn33qI8OSCpI=; b=Cnlh078d02isuVCY471LCAXeqCVN9Mv+sOdlgIuUcq0yCX0+a2vAl9WAUS76rqg/gWKHbr7gHgc9uTo/RX2T7DOH8K6b3KN/zoX99IWkBtZgl5zEh4vo1s0TSaRco0m93Hq+MbdUF/ZP4q+Wfg+EmsqWgNimAv6vUpEynA79RUFzVnECtrCpbXi0EBRdimOd5sVQeBHy1L3oqfX0g5/NMReYD1HYABIuiuNrb+I4JukYhA9o7odhv7pwLmz9lKDDskCFfwML1W8Iob5AoAENbLnwHmo7GXMJAMIofYnh7VgmL20WJym9ciFCGFvHcoy+9VgpRyObQBbFgYk01jLmrA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tp18ZnJZoxb35tUj2PuLlBppdcd9OlV8RA3ckHqGV3UsnA0GWGy63ORtvvPOEfGW8kcF7HwWPxZlWckQnOkWQvuJqE9dMh1PSQGgtGQghw//qkd5i34bWzrBmB+oJJ6rPfp7yv/zyJ3MxwPyYrco9CFrwKTb6BPLbN7VSWfsD6QWlHiamwWXuckSggWJVcIU+r4n0PGeOGCLIj0A5ZAuw2zqLcwbB4wh0WwhYaAKPRzwuGrqYqg5PqpTZJ43tLoPGUWXjvIGI4SyL6xmCCS7OgfYEC+leaORlH+rC3Y+j1k+Wxe7waljB9kv0+zcBIpbWQtbxXxIQRrVkSJcCMDydw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: consulting@xxxxxxxxxxx, sstabellini@xxxxxxxxxx, Doug Goldstein <cardoe@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 12 Sep 2023 09:49:22 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 12.09.2023 11:36, Simone Ballarin wrote:
> This patch modifies deviations for Directive 4.10:
> "Precautions shall be taken in order to prevent the contents of
> a header file being included more than once"
> 
> This patch avoids the file-based deviation for empty headers, and
> replaces it with a comment-based one using the format specified in
> docs/misra/safe.json.
> 
> Generated headers are not generally safe against multi-inclusions,
> whether a header is safe depends on the nature of the generated code
> in the header. For that reason, this patch drops the deviation for
> generated headers.
> 
> Signed-off-by: Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
> 
> ---
> Changes in v2:
> - use the format introduced with doc/misra/safe.json instead of
>   a file-based deviation for empty headers
> - remove deviation for generated headers
> ---
>  automation/eclair_analysis/ECLAIR/deviations.ecl | 7 -------
>  docs/misra/safe.json                             | 8 ++++++++
>  xen/arch/arm/efi/runtime.h                       | 1 +
>  xen/include/Makefile                             | 2 +-
>  4 files changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl 
> b/automation/eclair_analysis/ECLAIR/deviations.ecl
> index d8170106b4..9313027af1 100644
> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
> @@ -78,13 +78,6 @@ inline functions."
>  -config=MC3R1.D4.9,macros+={deliberate, "loc(file(api:public))"}
>  -doc_end
>  
> --doc_begin="This header file is autogenerated or empty, therefore it poses no
> -risk if included more than once."
> --file_tag+={empty_header, "^xen/arch/arm/efi/runtime\\.h$"}
> --file_tag+={autogen_headers, 
> "^xen/include/xen/compile\\.h$||^xen/include/generated/autoconf.h$||^xen/include/xen/hypercall-defs.h$"}
> --config=MC3R1.D4.10,reports+={safe, 
> "all_area(all_loc(file(empty_header||autogen_headers)))"}
> --doc_end
> -
>  -doc_begin="Files that are intended to be included more than once do not 
> need to
>  conform to the directive."
>  -config=MC3R1.D4.10,reports+={safe, "first_area(text(^/\\* This file is 
> legitimately included multiple times\\. \\*/$, begin-4))"}
> diff --git a/docs/misra/safe.json b/docs/misra/safe.json
> index db438c9770..e8e200cb0a 100644
> --- a/docs/misra/safe.json
> +++ b/docs/misra/safe.json
> @@ -28,6 +28,14 @@
>          },
>          {
>              "id": "SAF-3-safe",

Noting this, ...

> +            "analyser": {
> +                "eclair": "MC3R1.D4.10"
> +            },
> +            "name": "Dir 4.10: empty headers",
> +            "text": "Empty headers pose no risk if included more than once."
> +        },
> +        {
> +            "id": "SAF-4-safe",
>              "analyser": {},
>              "name": "Sentinel",
>              "text": "Next ID to be used"
> --- a/xen/arch/arm/efi/runtime.h
> +++ b/xen/arch/arm/efi/runtime.h
> @@ -1 +1,2 @@
> +/* SAF-2-safe empty header */
>  /* Placeholder for ARM-specific runtime include/declarations */
> --- a/xen/include/Makefile
> +++ b/xen/include/Makefile
> @@ -53,7 +53,7 @@ cmd_compat_h = \
>      mv -f $@.new $@
>  
>  quiet_cmd_stub_h = GEN     $@
> -cmd_stub_h = echo '/* empty */' >$@
> +cmd_stub_h = echo '/* SAF-2-safe empty header */' >$@

... there's the same off-by-1 here as there was in patch 1.

Jan



 


Rackspace

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