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

Re: [XEN PATCH][for-4.19 v6 2/8] x86: add deviation for asm-only functions


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 2 Nov 2023 14:27:30 +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=ajsHny3y5i9coSLg7K60qJWyHmWCIPz1/9pdrtL8pAs=; b=CHCRFD2D9nEpXEhME/3Q0emZe+DIK89fkLxh+f8FibFuN59GZ19xUU0AcBHJO1fh1e6EQv7IbHY3j0V9JvIkcJJ7tUHbA1V8ZE0MmkQ5y5Oy8CQ6H1KGKFys8CIz8Jzte3HQddIi064xiHLxQFecyQWy80ySXHpHT5vcEaaXuiuv39lSrpCniUmc2/kWNab4YeQPcTvwCETnUYj/psX5ex6z4qG7LoLVq/peF7ZO4l6/091j9uuoZ70J6Yl1i0OaKFeHmNx6+VJ1q4PJvaeUSEO5bh4bFkP3Jb8xZ2MzN+soPZxKz56qSRT9VwsGgIfHK6nv2DAHVLh9M1SQjmLhNg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IYvX+/gzK+APhROE7OBTedZxCL+V+slcL42/NpK41dDdCJkA6gTx1jdrDPteFxXJmKEGjyODY6l5tr+J/9f2mdpfLM1HqlajLpiBGyNZNmxXVdope9mweRxfMK20jnvO6zUjivzMHw3tkTMiTFLVLlCtfoqF1E0BmqdBK2KI0MVAWkWrHD6/JKKHLYvPT7nKvMGyjbqeJAEXSil1MEKmB3oOTJDJujg9QlRY5W8kFstr4y7f+xZOiPxPMo2N2IzSeo5TvqgJVFPsSAhoaDtcLgzDl1iOZzYE1qpQ2WUwhMJmw6Rb/mymclf28spt+PiRAHd1cUFilm4jWq3XbtgJiw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, michal.orzel@xxxxxxx, xenia.ragiadakou@xxxxxxx, ayan.kumar.halder@xxxxxxx, consulting@xxxxxxxxxxx, andrew.cooper3@xxxxxxxxxx, roger.pau@xxxxxxxxxx, Simone Ballarin <simone.ballarin@xxxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>
  • Delivery-date: Thu, 02 Nov 2023 13:27:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 02.11.2023 00:10, Stefano Stabellini wrote:
> On Wed, 1 Nov 2023, Nicola Vetrini wrote:
>> As stated in rules.rst, functions used only in asm modules
>> are allowed to have no prior declaration visible when being
>> defined, hence these functions are marked with an
>> 'asmlinkage' macro, which is then deviated for MISRA C:2012
>> Rule 8.4.
>>
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>
>> ---
>> Changes in v3:
>> - added SAF deviations for vmx counterparts to svm functions.
>> Changes in v5:
>> - drop SAF deviations in favour of the pseudo-attribute asmlinkage
>> Changes in v6:
>> - conditioned asmlinkage definition to make it overridable;
>> - move the pseudo-attribute after the return type
>> ---
>>  automation/eclair_analysis/ECLAIR/deviations.ecl | 9 +++++++++
>>  docs/misra/deviations.rst                        | 6 ++++++
>>  xen/arch/x86/hvm/svm/intr.c                      | 2 +-
>>  xen/arch/x86/hvm/svm/nestedsvm.c                 | 2 +-
>>  xen/arch/x86/hvm/svm/svm.c                       | 4 ++--
>>  xen/arch/x86/hvm/vmx/intr.c                      | 2 +-
>>  xen/arch/x86/hvm/vmx/vmx.c                       | 4 ++--
>>  xen/arch/x86/hvm/vmx/vvmx.c                      | 2 +-
>>  xen/arch/x86/traps.c                             | 2 +-
>>  xen/arch/x86/x86_64/traps.c                      | 2 +-
>>  xen/include/xen/compiler.h                       | 5 +++++
>>  11 files changed, 30 insertions(+), 10 deletions(-)
>>
>> diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl 
>> b/automation/eclair_analysis/ECLAIR/deviations.ecl
>> index fa56e5c00a27..06619ecf7e8d 100644
>> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
>> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
>> @@ -163,6 +163,15 @@ Therefore the absence of prior declarations is safe."
>>  -config=MC3R1.R8.4,reports+={safe, "first_area(any_loc(file(gcov)))"}
>>  -doc_end
>>  
>> +-doc_begin="Recognize the occurrence of current_stack_pointer as a 
>> declaration."
>> +-file_tag+={asm_defns, "^xen/arch/x86/include/asm/asm_defns\\.h$"}
>> +-config=MC3R1.R8.4,declarations+={safe, 
>> "loc(file(asm_defns))&&^current_stack_pointer$"}
>> +-doc_end
>> +
>> +-doc_begin="asmlinkage is a marker to indicate that the function is only 
>> used to interface with asm modules."
>> +-config=MC3R1.R8.4,declarations+={safe,"loc(text(^(?s).*asmlinkage.*$, 
>> -1..0))"}
>> +-doc_end
>> +
>>  -doc_begin="The following variables are compiled in multiple translation 
>> units
>>  belonging to different executables and therefore are safe."
>>  -config=MC3R1.R8.6,declarations+={safe, 
>> "name(current_stack_pointer||bsearch||sort)"}
>> diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
>> index 8511a189253b..d468da2f5ce9 100644
>> --- a/docs/misra/deviations.rst
>> +++ b/docs/misra/deviations.rst
>> @@ -133,6 +133,12 @@ Deviations related to MISRA C:2012 Rules:
>>         configuration. Therefore, the absence of prior declarations is safe.
>>       - Tagged as `safe` for ECLAIR.
>>  
>> +   * - R8.4
>> +     - Functions and variables used only by asm modules are either marked 
>> with
>> +       the `asmlinkage` macro or with a SAF-1-safe textual deviation
>> +       (see safe.json).
>> +     - Tagged as `safe` for ECLAIR.
> 
> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>

Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
with ...

> If Julien prefers a different wording I could modify on commit as needed

... wording clarified along the lines of his subsequent reply. Yet better
would be, as also suggested by him, to accompany this with a 2nd patch
replacing the now deprecated SAF-* comments.

Jan



 


Rackspace

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