From nobody Fri Dec 19 16:06:31 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=citrix.com ARC-Seal: i=1; a=rsa-sha256; t=1746836358; cv=none; d=zohomail.com; s=zohoarc; b=RQBpLoP9mZe31hav6e/T/LjoAzGmvSxkcYU/0RmzPyoOjnj4jv9HelS/J3vvEUwW/zuAbvUAHZeBQk5RAZOClv9jcJ7Q5a1Pevh4wRuqJOQtYSTANoxcJkFy6CKkFHqQm/fiVOKPfb+jtdk26WunVlTR+Q0G9aC9Q12mQT+xOXo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1746836358; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WpsUSj92KqDrKgsNySV/kwZnYdiagcD3GXuPXffrzeA=; b=bYtHhjf3I4qgBXTs9odlRUMfspfcjAPXh+tOSClZiqi9KEFqZRaV9tHdO0oXEqbe21sSM9F9bEsCwir5FfcN6Mwr99RJUnj4E7RDaKxOD4a+9ZdnVCpLXfGbs6dmadoo+78qWoqcZxRPCTMQtlj9AVAa1iWhNBa7uWR9+jaH0DE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 174683635874051.34586605700986; Fri, 9 May 2025 17:19:18 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.980556.1367092 (Exim 4.92) (envelope-from ) id 1uDXvb-0005ih-Hz; Sat, 10 May 2025 00:18:55 +0000 Received: by outflank-mailman (output) from mailman id 980556.1367092; Sat, 10 May 2025 00:18:55 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uDXvb-0005ia-FM; Sat, 10 May 2025 00:18:55 +0000 Received: by outflank-mailman (input) for mailman id 980556; Sat, 10 May 2025 00:18:54 +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 1uDXva-0005iU-Dp for xen-devel@lists.xenproject.org; Sat, 10 May 2025 00:18:54 +0000 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [2a00:1450:4864:20::429]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 5a68d50f-2d34-11f0-9eb5-5ba50f476ded; Sat, 10 May 2025 02:18:52 +0200 (CEST) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3a1d8c0966fso1331966f8f.1 for ; Fri, 09 May 2025 17:18:52 -0700 (PDT) Received: from localhost.localdomain (host-92-26-98-202.as13285.net. [92.26.98.202]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a1f58f33b5sm4815178f8f.54.2025.05.09.17.18.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 May 2025 17:18:50 -0700 (PDT) X-Outflank-Mailman: Message body and most headers restored to incoming version 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: 5a68d50f-2d34-11f0-9eb5-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1746836332; x=1747441132; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=WpsUSj92KqDrKgsNySV/kwZnYdiagcD3GXuPXffrzeA=; b=UiufKp+DdsTKa+VGCp2iBAPr79VzQ7gHAnzRKtaAGiezwWAq0oAUK4OjQYD4yTAyHJ z/IQJSmXtrORDhVPL70JVaWobcDMkiqQRGh1QK340RDgm/uPTPBcG+ivyOSr3a1dex31 5G/+116P+H9EscLyseWux8Qm3j7FqdBdF0wtY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746836332; x=1747441132; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WpsUSj92KqDrKgsNySV/kwZnYdiagcD3GXuPXffrzeA=; b=pXZ/iNzOJn4NvAvmJOkt4k/MCQ92MGxlduAczJYG+QgB9wiphzvJX370r+KgqLECCS 8DyXRuvDPtkZsfAL0YPF7LJ1cD8uSrpqnj+0RcUgNoMYWZaDcIesiXkfhuwzDWUpBZwV GwUb8MIAcgHbHroqZYh1wjqCw7dYkkPdTg/NECMk13gR7E57G7bPujfUgHplRNIOkitr xOJ0nB0q3qxJ2UQEY01TuOSvE9P7RO0RjrK5xAaWKj/RzNXMqRxXbU/twfdZqumyCNOa 10AbyETL8BWsyH82k/LlVXW7NoZqKd6mtEyhowkor3/nK87dLrSQJfOpS2lM8sEQad0k n2SQ== X-Gm-Message-State: AOJu0YzSAyHOnGNqjRVF06MwA8Twb2Wp0ZQe1PN6u86NqB7914Nz8Jyw qZSXxTEUQS12rqNf2kE0CF9SbFY315IVUv0HQXIqpB0UmwzHSIoqoJmNFn1Pl/64FYsNkI/Yfnf S X-Gm-Gg: ASbGncvmV+iuM0QLp693+nDnZpxfxDAxLBE4LQuL+Srwu8kec7dytT+qz67GvXcW+u5 q6IYl4GLrrVyDaREm/a5HTyJ+htczthL5op78QuGitm1O3NLPkrlEnjbyX8FUSQxylaxz+7bAog TznmY40wun8a6ebxUHL+IKMp7ameO/OLWQaeWN2FMkxeJrUnWohTtLuhw+TPDMS5bBA43EYDXyc Q4A0JpRGi2c9zLthfpWstdF7F5/WpkAeaZ5qO+/bTtZAyBb0irXhl0wrtjMCOpB+TbV5zfGwUuL sCh0XJCazrR7f7akO8omYMsIxblONK46q61g8yOuLd7SPPBDAY8rxejemdxMFRCbCO2z9Nq6yES Cp01Cg9gzZliphuOsgizerllz X-Google-Smtp-Source: AGHT+IHWB7vCxOxRF+vH9VPWcZs/ZlaJZU2ELk53LgETMksHk2Ux/CQSUJCmcGuO/aBH/aY5tp13eQ== X-Received: by 2002:a05:6000:4007:b0:3a0:9f4c:ca85 with SMTP id ffacd0b85a97d-3a0b99078a9mr8014264f8f.10.1746836332012; Fri, 09 May 2025 17:18:52 -0700 (PDT) From: Andrew Cooper To: Xen-devel Cc: Andrew Cooper , Nicola Vetrini , Stefano Stabellini Subject: [PATCH] x86/emul: Work around MISRA R13.2 complaint Date: Sat, 10 May 2025 01:18:48 +0100 Message-Id: <20250510001848.2993380-1-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.39.5 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @citrix.com) X-ZM-MESSAGEID: 1746836359453116600 Content-Type: text/plain; charset="utf-8" Rule 13.2 states: "The value of an expression and its persistent side effec= ts shall be the same under all permitted evaluation orders". Eclair complains about a Rule 13.2 violations because validate_far_branch() assigns to rc, and the entirety of commit_far_branch() is also assigned to = rc. I'm unsure that the complaint is accurate, but rewriting commit_far_branch() to use the comma operator seems to make Eclair happy. Reported-by: Nicola Vetrini Signed-off-by: Andrew Cooper Reviewed-by: Stefano Stabellini --- CC: Stefano Stabellini CC: Nicola Vetrini --- xen/arch/x86/x86_emulate/x86_emulate.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emul= ate/x86_emulate.c index 8e14ebb35b0e..6ee64cb85987 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -333,12 +333,14 @@ do { = \ : (ip) > (cs)->limit, X86_EXC_GP, 0); \ }) =20 -#define commit_far_branch(cs, newip) ({ \ - validate_far_branch(cs, newip); \ - _regs.r(ip) =3D (newip); \ - singlestep =3D _regs.eflags & X86_EFLAGS_TF; \ - ops->write_segment(x86_seg_cs, cs, ctxt); \ -}) +#define commit_far_branch(cs, newip) ( \ + ({ \ + validate_far_branch(cs, newip); \ + _regs.r(ip) =3D (newip); \ + singlestep =3D _regs.eflags & X86_EFLAGS_TF; \ + }), \ + ops->write_segment(x86_seg_cs, cs, ctxt) \ + ) =20 int x86emul_get_fpu( enum x86_emulate_fpu_type type, base-commit: 9b3a02e66f058ebd77db6628e3144352857bdf2b --=20 2.39.5