From patchwork Sat Jun 1 10:16:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13682357 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A67AAC27C44 for ; Sat, 1 Jun 2024 10:17:33 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.734111.1140307 (Exim 4.92) (envelope-from ) id 1sDLnM-000631-3f; Sat, 01 Jun 2024 10:17:04 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 734111.1140307; Sat, 01 Jun 2024 10:17:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sDLnL-00062R-TL; Sat, 01 Jun 2024 10:17:03 +0000 Received: by outflank-mailman (input) for mailman id 734111; Sat, 01 Jun 2024 10:17:03 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sDLnL-0005zz-5C for xen-devel@lists.xenproject.org; Sat, 01 Jun 2024 10:17:03 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 1687f838-2000-11ef-90a1-e314d9c70b13; Sat, 01 Jun 2024 12:17:02 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id DF2F84EE0749; Sat, 1 Jun 2024 12:17:00 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 1687f838-2000-11ef-90a1-e314d9c70b13 From: Nicola Vetrini To: nicola.vetrini@bugseng.com, xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall Subject: [XEN PATCH 1/5] xen/domain: deviate violation of MISRA C Rule 20.12 Date: Sat, 1 Jun 2024 12:16:52 +0200 Message-Id: <843540164f7e8f910226e1ded05e153cb04c519d.1717236930.git.nicola.vetrini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 MISRA C Rule 20.12 states: "A macro parameter used as an operand to the # or ## operators, which is itself subject to further macro replacement, shall only be used as an operand to these operators". In this case, builds where CONFIG_DEBUG_LOCK_PROFILE=y the domain_lock macro is used both as a regular macro argument and as an operand for stringification in the expansion of macro spin_lock_init_prof. A SAF-x-safe deviation is introduced to justify this. No functional change. Signed-off-by: Nicola Vetrini --- docs/misra/safe.json | 8 ++++++++ xen/common/domain.c | 1 + 2 files changed, 9 insertions(+) diff --git a/docs/misra/safe.json b/docs/misra/safe.json index 9b13bcf71706..c213e0a0be3b 100644 --- a/docs/misra/safe.json +++ b/docs/misra/safe.json @@ -52,6 +52,14 @@ }, { "id": "SAF-6-safe", + "analyser": { + "eclair": "MC3R1.R20.12" + }, + "name": "MC3R1.R20.12: use of a macro argument that deliberately violates the Rule", + "text": "A macro parameter that is itself a macro is intentionally used within the macro both as a regular parameter and for text replacement." + }, + { + "id": "SAF-7-safe", "analyser": {}, "name": "Sentinel", "text": "Next ID to be used" diff --git a/xen/common/domain.c b/xen/common/domain.c index 67cadb7c3f4f..2c7168093734 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -632,6 +632,7 @@ struct domain *domain_create(domid_t domid, atomic_set(&d->refcnt, 1); RCU_READ_LOCK_INIT(&d->rcu_lock); + /* SAF-6-safe Rule 20.12 expansion of macro domain_lock in debug builds */ rspin_lock_init_prof(d, domain_lock); rspin_lock_init_prof(d, page_alloc_lock); spin_lock_init(&d->hypercall_deadlock_mutex); From patchwork Sat Jun 1 10:16:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13682356 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8ADF9C41513 for ; Sat, 1 Jun 2024 10:17:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.734113.1140327 (Exim 4.92) (envelope-from ) id 1sDLnR-0006Ym-Jf; Sat, 01 Jun 2024 10:17:09 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 734113.1140327; Sat, 01 Jun 2024 10:17:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sDLnR-0006Xx-EV; Sat, 01 Jun 2024 10:17:09 +0000 Received: by outflank-mailman (input) for mailman id 734113; Sat, 01 Jun 2024 10:17:08 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sDLnQ-0006UI-CG for xen-devel@lists.xenproject.org; Sat, 01 Jun 2024 10:17:08 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 17728f2e-2000-11ef-b4bb-af5377834399; Sat, 01 Jun 2024 12:17:05 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 54FFC4EE0748; Sat, 1 Jun 2024 12:17:02 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 17728f2e-2000-11ef-b4bb-af5377834399 From: Nicola Vetrini To: nicola.vetrini@bugseng.com, xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [XEN PATCH 2/5] x86/domain: deviate violation of MISRA C Rule 20.12 Date: Sat, 1 Jun 2024 12:16:53 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 MISRA C Rule 20.12 states: "A macro parameter used as an operand to the # or ## operators, which is itself subject to further macro replacement, shall only be used as an operand to these operators". In this case, builds where CONFIG_COMPAT=y the fpu_ctxt macro is used both as a regular macro argument and as an operand for stringification in the expansion of CHECK_FIELD_. This is deviated using a SAF-x-safe comment. No functional change. Signed-off-by: Nicola Vetrini Acked-by: Jan Beulich --- xen/arch/x86/domain.c | 1 + xen/arch/x86/domctl.c | 1 + 2 files changed, 2 insertions(+) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 536542841ef5..ccadfe0c9e70 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -1084,6 +1084,7 @@ void arch_domain_creation_finished(struct domain *d) #ifdef CONFIG_COMPAT #define xen_vcpu_guest_context vcpu_guest_context #define fpu_ctxt fpu_ctxt.x +/* SAF-6-safe Rule 20.12 expansion of macro fpu_ctxt with CONFIG_COMPAT */ CHECK_FIELD_(struct, vcpu_guest_context, fpu_ctxt); #undef fpu_ctxt #undef xen_vcpu_guest_context diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 9a72d57333e9..335aedf46d03 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1326,6 +1326,7 @@ long arch_do_domctl( #ifdef CONFIG_COMPAT #define xen_vcpu_guest_context vcpu_guest_context #define fpu_ctxt fpu_ctxt.x +/* SAF-6-safe Rule 20.12 expansion of macro fpu_ctxt with CONFIG_COMPAT */ CHECK_FIELD_(struct, vcpu_guest_context, fpu_ctxt); #undef fpu_ctxt #undef xen_vcpu_guest_context From patchwork Sat Jun 1 10:16:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13682354 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 460BBC25B76 for ; Sat, 1 Jun 2024 10:17:33 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.734112.1140323 (Exim 4.92) (envelope-from ) id 1sDLnR-0006VJ-Av; Sat, 01 Jun 2024 10:17:09 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 734112.1140323; Sat, 01 Jun 2024 10:17:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sDLnR-0006VA-6X; Sat, 01 Jun 2024 10:17:09 +0000 Received: by outflank-mailman (input) for mailman id 734112; Sat, 01 Jun 2024 10:17:08 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sDLnQ-0006UI-3u for xen-devel@lists.xenproject.org; Sat, 01 Jun 2024 10:17:08 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 184c05ed-2000-11ef-b4bb-af5377834399; Sat, 01 Jun 2024 12:17:05 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id D7E144EE074A; Sat, 1 Jun 2024 12:17:03 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 184c05ed-2000-11ef-b4bb-af5377834399 From: Nicola Vetrini To: nicola.vetrini@bugseng.com, xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, Jan Beulich , Andrew Cooper , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Subject: [XEN PATCH 3/5] x86: deviate violation of MISRA C Rule 20.12 Date: Sat, 1 Jun 2024 12:16:54 +0200 Message-Id: <475daa82f5be77644b1f32ecd3f6e66ccd9ac904.1717236930.git.nicola.vetrini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 MISRA C Rule 20.12 states: "A macro parameter used as an operand to the # or ## operators, which is itself subject to further macro replacement, shall only be used as an operand to these operators". When the second parameter of GET_SET_SHARED is a macro and is used as both a regular parameter and for token pasting the rule deliberately violated. A SAF-x-safe comment is used to deviate the usage. No functional change. Signed-off-by: Nicola Vetrini --- xen/arch/x86/include/asm/shared.h | 1 + 1 file changed, 1 insertion(+) diff --git a/xen/arch/x86/include/asm/shared.h b/xen/arch/x86/include/asm/shared.h index 60b67fa4b427..c26d4b2b3f0f 100644 --- a/xen/arch/x86/include/asm/shared.h +++ b/xen/arch/x86/include/asm/shared.h @@ -76,6 +76,7 @@ static inline void arch_set_##field(struct vcpu *v, \ GET_SET_SHARED(unsigned long, max_pfn) GET_SET_SHARED(xen_pfn_t, pfn_to_mfn_frame_list_list) +/* SAF-6-safe Rule 20.12: expansion of macro nmi_reason */ GET_SET_SHARED(unsigned long, nmi_reason) GET_SET_VCPU(unsigned long, cr2) From patchwork Sat Jun 1 10:16:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13682359 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 35702C25B76 for ; Sat, 1 Jun 2024 10:17:36 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.734114.1140343 (Exim 4.92) (envelope-from ) id 1sDLnS-0006zT-RF; Sat, 01 Jun 2024 10:17:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 734114.1140343; Sat, 01 Jun 2024 10:17:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sDLnS-0006wa-Mm; Sat, 01 Jun 2024 10:17:10 +0000 Received: by outflank-mailman (input) for mailman id 734114; Sat, 01 Jun 2024 10:17:09 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sDLnR-0006UI-Ca for xen-devel@lists.xenproject.org; Sat, 01 Jun 2024 10:17:09 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 19088332-2000-11ef-b4bb-af5377834399; Sat, 01 Jun 2024 12:17:06 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 4DBA14EE074B; Sat, 1 Jun 2024 12:17:05 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 19088332-2000-11ef-b4bb-af5377834399 From: Nicola Vetrini To: nicola.vetrini@bugseng.com, xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, Simone Ballarin , Doug Goldstein Subject: [XEN PATCH 4/5] automation/eclair_analysis: address remaining violations of MISRA C Rule 20.12 Date: Sat, 1 Jun 2024 12:16:55 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 The DEFINE macro in asm-offsets.c (for all architectures) still generates violations despite the file(s) being excluded from compliance, due to the fact that in its expansion it sometimes refers entities in non-excluded files. These corner cases are deviated by the configuration. No functional change. Signed-off-by: Nicola Vetrini Acked-by: Stefano Stabellini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl index cf62a874d928..f29db9e08248 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -483,6 +483,12 @@ leads to a violation of the Rule are deviated." -config=MC3R1.R20.12,macros+={deliberate, "name(GENERATE_CASE)&&loc(file(deliberate_generate_case))"} -doc_end +-doc_begin="The macro DEFINE is defined and used in excluded files asm-offsets.c. +This may still cause violations if entities outside these files are referred to +in the expansion." +-config=MC3R1.R20.12,macros+={deliberate, "name(DEFINE)&&loc(file(asm_offsets))"} +-doc_end + # # Series 21. # From patchwork Sat Jun 1 10:16:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Vetrini X-Patchwork-Id: 13682358 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7DF49C27C51 for ; Sat, 1 Jun 2024 10:17:34 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.734115.1140347 (Exim 4.92) (envelope-from ) id 1sDLnT-00072d-3o; Sat, 01 Jun 2024 10:17:11 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 734115.1140347; Sat, 01 Jun 2024 10:17:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sDLnT-000724-0F; Sat, 01 Jun 2024 10:17:11 +0000 Received: by outflank-mailman (input) for mailman id 734115; Sat, 01 Jun 2024 10:17:10 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sDLnS-0006UI-Cd for xen-devel@lists.xenproject.org; Sat, 01 Jun 2024 10:17:10 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 1a50d486-2000-11ef-b4bb-af5377834399; Sat, 01 Jun 2024 12:17:08 +0200 (CEST) Received: from nico.bugseng.com (unknown [46.228.253.194]) by support.bugseng.com (Postfix) with ESMTPSA id 85C6F4EE074C; Sat, 1 Jun 2024 12:17:06 +0200 (CEST) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 1a50d486-2000-11ef-b4bb-af5377834399 From: Nicola Vetrini To: nicola.vetrini@bugseng.com, xen-devel@lists.xenproject.org Cc: sstabellini@kernel.org, michal.orzel@amd.com, xenia.ragiadakou@amd.com, ayan.kumar.halder@amd.com, consulting@bugseng.com, Simone Ballarin , Doug Goldstein , Andrew Cooper , George Dunlap , Jan Beulich , Julien Grall Subject: [XEN PATCH 5/5] xen: fix MISRA regressions on rule 20.9 and 20.12 Date: Sat, 1 Jun 2024 12:16:56 +0200 Message-Id: <7d454066eb24e0515ff5b37864ed7a7ef5215dc5.1717236930.git.nicola.vetrini@bugseng.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 ea59e7d780d9 ("xen/bitops: Cleanup and new infrastructure ahead of rearrangements") introduced new violations on previously clean rules 20.9 and 20.12. The first is introduced because CONFIG_CC_IS_CLANG in xen/self-tests.h is not defined in the configuration under analysis. Using "defined()" instead avoids relying on the preprocessor's behaviour upon encountering an undedfined identifier and addresses the violation. The violation of Rule 20.12 is due to "val" being used both as an ordinary argument in macro RUNTIME_CHECK, and as a stringification operator. No functional change. Fixes: ea59e7d780d9 ("xen/bitops: Cleanup and new infrastructure ahead of rearrangements") Signed-off-by: Nicola Vetrini --- automation/eclair_analysis/ECLAIR/deviations.ecl | 2 +- xen/include/xen/self-tests.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl b/automation/eclair_analysis/ECLAIR/deviations.ecl index f29db9e08248..e2653f77eb2c 100644 --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -473,7 +473,7 @@ deliberate." -doc_begin="Uses of a macro parameter for ordinary expansion and as an operand to the # or ## operators within the following macros are deliberate, to provide useful diagnostic messages to the user." --config=MC3R1.R20.12,macros+={deliberate, "name(ASSERT||BUILD_BUG_ON||BUILD_BUG_ON_ZERO)"} +-config=MC3R1.R20.12,macros+={deliberate, "name(ASSERT||BUILD_BUG_ON||BUILD_BUG_ON_ZERO||RUNTIME_CHECK)"} -doc_end -doc_begin="The helper macro GENERATE_CASE may use a macro parameter for ordinary diff --git a/xen/include/xen/self-tests.h b/xen/include/xen/self-tests.h index 8410db7aaaae..42a4cc4d17fe 100644 --- a/xen/include/xen/self-tests.h +++ b/xen/include/xen/self-tests.h @@ -16,7 +16,7 @@ * Clang < 8 can't fold constants through static inlines, causing this to * fail. Simply skip it for incredibly old compilers. */ -#if !CONFIG_CC_IS_CLANG || CONFIG_CLANG_VERSION >= 80000 +#if !defined(CONFIG_CC_IS_CLANG) || CONFIG_CLANG_VERSION >= 80000 #define COMPILE_CHECK(fn, val, res) \ do { \ typeof(fn(val)) real = fn(val); \