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

Re: [XEN PATCH 05/13] automation/eclair: add deviation for usercopy.c


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Mon, 4 Sep 2023 12:43:39 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.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=rFklO5b2f6dOhFRf87IcVWpkw9/3z5lUCgxCbIbtKEw=; b=VWow8GoG7DgBhmVYywVKVgwVTAJEC/jL6d4tosymP2rlJKhgfA2Q+4Atf1MBtCUKE8JYmY/ZZFbfl4ipX/qQ/dCSI8b9bY1RDnpnnT1KeabiKu7PNNueKIfePIJNNZvib9uFET64WMAOgBGr1AB7nAMwskFecg74JFl18Iq8oqNRKXU0P8sV7oVCVrhO3O6rl58I65gXwx1OvzXVi5pUBeZBIXFFx/p5kRmUZewM4Ihwl2D4frskMa7L2VY6Fx+j8fYONEG8SIO+/lMrCnsOML8wDRht3s7ZcUjhRStEYmlFn4skmQTUv8npq4GlknFhqcWl+GdoxLcdaNdEkSVjrw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hQzoN/YmQBEBwa2GU50uFznCfssKwxp11kxGDPObqsWA1DyB07oLGNB4zVYTu5/EWqIl9byALfA4rb13wEZn5wHdndEMQIWfs1sAHHxiRkyqlLvVpj2PU5soLwnNghsl9J27j82JwNUQk8UjaOs6DtV3XugaN0iGeyoFjFrQKqZYZtY45XS/f+qBJ6zFz4UxNDphZkyEJ0horqV9NAo6VYsmvrYhGTMcjZ2Mk2ZeFkb1Aqi4Fjopg0LT9WGGW/3bySofW75nJ9iIm6iARwccH9hPyLbqBXifo/+Qo2g+4Q3fkCxrXiVI+1o56NQjmyJOlVPfGr/fbejicWqxwjHqcw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Simone Ballarin <simone.ballarin@xxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "consulting@xxxxxxxxxxx" <consulting@xxxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, "nicola.vetrini@xxxxxxxxxxx" <nicola.vetrini@xxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, "michal.orzel@xxxxxxx" <michal.orzel@xxxxxxx>
  • Delivery-date: Mon, 04 Sep 2023 12:44:37 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZ2b5Rm/+16tf7DEqQZJ2JP8GC+7AASiEAgApdMAA=
  • Thread-topic: [XEN PATCH 05/13] automation/eclair: add deviation for usercopy.c


> On 28 Aug 2023, at 23:27, Stefano Stabellini <sstabellini@xxxxxxxxxx> wrote:
> 
> +Nicola, Luca
> 
> On Mon, 28 Aug 2023, Simone Ballarin wrote:
>> xen/arch/x86/usercopy.c includes itself, so it is not supposed to
>> comply with Directive 4.10:
>> "Precautions shall be taken in order to prevent the contents of a
>> header file being included more than once"
>> 
>> This patch adds a deviation for the file.
>> 
>> Signed-off-by: Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
>> 
>> ---
>> automation/eclair_analysis/ECLAIR/deviations.ecl | 4 ++++
>> docs/misra/rules.rst                             | 2 ++
>> 2 files changed, 6 insertions(+)
>> 
>> diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl 
>> b/automation/eclair_analysis/ECLAIR/deviations.ecl
>> index 2681a4cff5..a7d4f29b43 100644
>> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
>> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
>> @@ -96,6 +96,10 @@ conform to the directive."
>> -config=MC3R1.D4.10,reports+={safe, "first_area(text(^ \\* In this case, no 
>> inclusion guards apply and the caller is responsible.*\\*/$, begin-1))"}
>> -doc_end
>> 
>> +-doc_begin="xen/arch/x86/usercopy.c includes itself: it is not supposed to 
>> comply with the directive"
>> +-config=MC3R1.D4.10,reports+={deliberate, 
>> "all_area(all_loc(file("^xen/arch/x86/usercopy\\.c$")))"}
>> +-doc_end
>> +
>> #
>> # Series 5.
>> #
>> diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
>> index 4b1a7b02b6..45e13d0302 100644
>> --- a/docs/misra/rules.rst
>> +++ b/docs/misra/rules.rst
>> @@ -62,6 +62,8 @@ maintainers if you want to suggest a change.
>>      - Files that are intended to be included more than once do not need to
>>        conform to the directive. Files that explicitly avoid inclusion guards
>>        under specific circumstances do not need to conform the directive.
>> +       xen/arch/x86/usercopy.c includes itself: it is not supposed to comply
>> +       with the directive.
> 
> 
> We need to find a consistent way to document this kind of deviations in
> a non-ECLAIR specific way, without adding the complete list of
> deviations to rules.rst.
> 
> Can we use safe.json and add an in-code comment at the top of
> usercopy.c? E.g.:
> 
> diff --git a/xen/arch/x86/usercopy.c b/xen/arch/x86/usercopy.c
> index b8c2d1cc0b..8bb591f472 100644
> --- a/xen/arch/x86/usercopy.c
> +++ b/xen/arch/x86/usercopy.c
> @@ -1,3 +1,4 @@
> +/* SAF-1-safe */
> /* 
>  * User address space access functions.
>  *
> 
> Otherwise, maybe we should extend safe.json to also have an extra field
> with a list of paths. For instance see "files" below:
> 
> {
>    "version": "1.0",
>    "content": [
>        {
>            "id": "SAF-0-safe",
>            "analyser": {
>                "eclair": "MC3R1.R8.6",
>                "coverity": "misra_c_2012_rule_8_6_violation"
>            },
>            "name": "Rule 8.6: linker script defined symbols",
>            "text": "It is safe to declare this symbol because it is defined 
> in the linker script."
>        },
>        {
>            "id": "SAF-1-safe",
>            "analyser": {
>                "eclair": "MC3R1.D4.10"
>            },
>            "name": "Dir 4.10: files that include themselves",
>            "text": "Files purposely written to include themselves are not 
> supposed to comply with D4.10.",
>            "files": ["xen/arch/x86/usercopy.c"]

Why couldn’t we do it without the “files” field? The presence of the tag in the 
file and the justification (I think)
are enough. 

>        },
>        {
>            "id": "SAF-2-safe",
>            "analyser": {},
>            "name": "Sentinel",
>            "text": "Next ID to be used"
>        }
>    ]
> }


 


Rackspace

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