From patchwork Tue Oct 10 09:57:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 13415110 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 A24DDCD6134 for ; Tue, 10 Oct 2023 09:58:09 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.614653.955866 (Exim 4.92) (envelope-from ) id 1qq9V1-0000Zs-0g; Tue, 10 Oct 2023 09:57:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 614653.955866; Tue, 10 Oct 2023 09:57:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qq9V0-0000Zl-T8; Tue, 10 Oct 2023 09:57:58 +0000 Received: by outflank-mailman (input) for mailman id 614653; Tue, 10 Oct 2023 09:57:57 +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 1qq9Uz-0000Zb-2G for xen-devel@lists.xenproject.org; Tue, 10 Oct 2023 09:57:57 +0000 Received: from esa2.hc3370-68.iphmx.com (esa2.hc3370-68.iphmx.com [216.71.145.153]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 7a83d517-6753-11ee-9b0d-b553b5be7939; Tue, 10 Oct 2023 11:57:54 +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: 7a83d517-6753-11ee-9b0d-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1696931874; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=XFUlfhoZvMHmB7+XO7vsO+/1R92MFgKP5/e539Ce+gM=; b=gMlxotDmq4ezxlMLKznTNv2vCPLFT29YlbGT67DdxZcahWMGRmafhO1g YV4/HEH7gH7cFDE40bCawl5KlMaA5yULKGehqpiPy8PKPrkCE2SXAoPQF fgRLLeT3pVfapRFzHlwB7ouPYgBH3DbPq55sHT0zjmdi01Fz24YRmgTmX 4=; X-CSE-ConnectionGUID: WeZzT1J/R/6c+wQWO38EQw== X-CSE-MsgGUID: 6dixwcayQP+jorURmse1mQ== Authentication-Results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none X-SBRS: 4.0 X-MesageID: 124981856 X-Ironport-Server: esa2.hc3370-68.iphmx.com X-Remote-IP: 162.221.159.70 X-Policy: $RELAYED X-ThreatScanner-Verdict: Negative IronPort-Data: A9a23:ZnkDLq7H718CBBQDGKxgbQxRtCvHchMFZxGqfqrLsTDasY5as4F+v mofCmqHa/+MMGfzct13Oozi9BsGu5SDzNM2GwBvrC8zHi5G8cbLO4+Ufxz6V8+wwm8vb2o8t plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRG/ykTraCY3gtLeNdYH9JoQp5nOIkiZJfj9G8Agec0 fv/uMSaM1K+s9JOGjt8B5mr9lU355wehBtC5gZlPKgS5AeH/5UoJMl3yZ+ZfiOQrrZ8RoZWd 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5my vEqOgxUTFe5wLy9g62Cdc431ukaM5y+VG8fkikIITDxCP8nRdbIQrnQ5M8e1z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YrOsxy73/LXmWtuhvrxizpzToo4W+K8y7+vVLT5eDpTjczC85MnrtDdArIzkI8sNZ3wM twrgakXtdsfEn9dOuU3amIazha0m6P5VYym+8aiHJSFaMYdb9qtIQauHhYFZ8RdRiKpLzORI NVbf301bJzSxe3fnrZtm5gzJiHRXIoBCqLRUAEp4i8zyVWtGoR9TpK+OUv2lM7sL4tQZhN4O rJdo5ykqtVc8MQZaVhQM8cXMqMDHDXSx6kChPDHb3eLtBUB5vxke+o3Fx13pD0RHUw9upvpH 0VaiIIiYYwE3ieRPFmkqc7sGGZfI16NQ6djf22rKIJzYEUf4CbexFqkjgV4pKdSsUkc4vmsr 6ISeRr6t/YXDPT8NVyrlbDs287EwhRbCXj0uxLFG5m5Pi7d7EDuoHgAb/uzZLWYH0ZZl8= X-Talos-CUID: 9a23:IlLW9WMvrJRXd+5DZyRV5nJNOIcfNSPWj2jpHGjjWUtQV+jA X-Talos-MUID: 9a23:mjNjnQQqZqI1mB4mRXSyiDByK8xh8p2WS0IKi6g8vtKJbClJbmI= X-IronPort-AV: E=Sophos;i="6.03,212,1694750400"; d="scan'208";a="124981856" From: Andrew Cooper To: Xen-devel CC: Andrew Cooper , Nicola Vetrini , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Wei Liu Subject: [PATCH for-4.19] x86/cpu-policy: Adjust CPUID_MAX_SERIALISED_LEAVES to placate MISRA Date: Tue, 10 Oct 2023 10:57:48 +0100 Message-ID: <20231010095748.1205365-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 MISRA doesn't like !!CONST being used in place of a 1 (Rule 10.1). Update the expression to just be a plain 1, which still matches the description. No functional change. Reported-by: Nicola Vetrini Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu CC: Nicola Vetrini After considering the comment several times, I've decided to leave it as is. It's slightly awkward grammar but it's ok. --- xen/include/xen/lib/x86/cpu-policy.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) base-commit: c035151902689aa5a3765aeb16fa52755917b9ca diff --git a/xen/include/xen/lib/x86/cpu-policy.h b/xen/include/xen/lib/x86/cpu-policy.h index bab3eecda6c1..d5e447e9dc06 100644 --- a/xen/include/xen/lib/x86/cpu-policy.h +++ b/xen/include/xen/lib/x86/cpu-policy.h @@ -100,13 +100,14 @@ const char *x86_cpuid_vendor_to_str(unsigned int vendor); * interaction with the toolstack. (Sum of all leaves in each union, less the * entries in basic which sub-unions hang off of.) */ -#define CPUID_MAX_SERIALISED_LEAVES \ - (CPUID_GUEST_NR_BASIC + \ - CPUID_GUEST_NR_FEAT - !!CPUID_GUEST_NR_FEAT + \ - CPUID_GUEST_NR_CACHE - !!CPUID_GUEST_NR_CACHE + \ - CPUID_GUEST_NR_TOPO - !!CPUID_GUEST_NR_TOPO + \ - CPUID_GUEST_NR_XSTATE - !!CPUID_GUEST_NR_XSTATE + \ - CPUID_GUEST_NR_EXTD + 2 /* hv_limit and hv2_limit */ ) +#define CPUID_MAX_SERIALISED_LEAVES \ + (CPUID_GUEST_NR_BASIC + \ + CPUID_GUEST_NR_FEAT - 1 + \ + CPUID_GUEST_NR_CACHE - 1 + \ + CPUID_GUEST_NR_TOPO - 1 + \ + CPUID_GUEST_NR_XSTATE - 1 + \ + CPUID_GUEST_NR_EXTD + \ + 2 /* hv_limit and hv2_limit */ ) /* Maximum number of MSRs written when serialising a cpu_policy. */ #define MSR_MAX_SERIALISED_ENTRIES 2