[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>, Simone Ballarin <simone.ballarin@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 29 Aug 2023 08:41:56 +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=cdt52Zd0rhzcQIirpE8rCngyAlOaVmnPTk++CSVKb+0=; b=HPyETWeKwhUo1c+qd9VlYmXEFrs5tDstjsorLlTyk5e+bNtyq2NxZi0rRUF2Jtc+B+ElpC9B4crxf4Sz3uluV8TJ2sfEk1jDqiq7gEW+UnGfpQa44HVJXBqoNDsF++oXYP4tyK2CQdOgmGgi29Vf6Iz7PTjCt6RV0FGYJh+vDJyCdyoeaojkXaZws2ZN/GVqcyWxyeJxaJ85tTjyG3bYF+9/d9gsS7ZZAQRuU3Ve1f/2SajJjTUqIz4lJbvOzFpthX6AFjE708P3pK5zSq/5t8Ba1L5Jb5Drq1+5d8PSd0B0oDaNwgA6zb6brD04spD+hH/jFJXdCJWYPsF/Li/txg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dxlEwD9OwrssbY35I2k33g8FLVwCv8mXgv6nO3L70Z5PIenWcIKYvy9OJ/2ZX2AiUtCfBqC8CTpzwMx13nQwUzI17LZ2AncHcv8A6MF8XxNz6jj+1tGH+aHzIgnuCQnLXJ9rWn0aFfddfWZn1kcDFNa9w2uGw6dc16Sg2t8wGXgh+on2yT8LrCatrUI/FPa8Oj0Hy+9B8MHHHsxTay1DrUKBhFrY5c24FiPF0LK4vRYwiZ2eegBswghi1RKkU1IPM65BMCb3jwCm4dWVLYcUCR6lT/8ZJ6JLSEoz4xST/zp/pE3QSFBMuGzY+uvh8ReyyxvgtUtGeAxQoyIeEYApXQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, consulting@xxxxxxxxxxx, Doug Goldstein <cardoe@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, nicola.vetrini@xxxxxxxxxxx, Bertrand.Marquis@xxxxxxx, Luca.Fancellu@xxxxxxx, michal.orzel@xxxxxxx
  • Delivery-date: Tue, 29 Aug 2023 06:42:09 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 29.08.2023 00:27, Stefano Stabellini wrote:
> On Mon, 28 Aug 2023, Simone Ballarin wrote:
>> --- 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.

+1

Especially rules.rst should not be modified to add mention of individual
exceptions. That's simply not the purpose of the file, at least the way
I understand it.

> Can we use safe.json and add an in-code comment at the top of
> usercopy.c? E.g.:

Right, this ought to be the was to go. Question is whether ...

> 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 */

... this (or any other) placement of the comment will actually do (not
just for Eclair).

Jan

>  /* 
>   * 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"]
>         },
>         {
>             "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®.