From nobody Sun Dec 22 17:49:18 2024 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=none dis=none) header.from=bugseng.com ARC-Seal: i=1; a=rsa-sha256; t=1728311384; cv=none; d=zohomail.com; s=zohoarc; b=i/2H4HfHYBomTDGcENhe8WXcJSC7YpPKi4LQ7DTnsAi8W7X/ugdcIP0aJsTvCGKTrkT4JZTsOPqdBdZYyA3g9umwPzx2Ta/ML7+I8EjOmQLFeNHgOGg2ZTSsDgIXESzyhM57p4byzLm3U+0ycZoRMDNm4aIWG9F98QBMR0GlgB0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1728311384; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Sb63wGxF5l/JLzmvq9+43G4p2T0xEoe4JnuEQCqdI2E=; b=ITUJ+hs+xtVJfZoKIAXOWAA32zYVSSyv5zyKcYJeIrsDEImDAHQITK+GLb8uZ60xitmdC4q50PMp8Ofu05XBBcB522cHUlwlw2a9BqwBOTsdN1Su8C1tPMiBVIp0oQZJRDlhgejUeKMcd49RrMU/Hac+X1jwQ98V/S9P3L9GMnk= 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=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1728311384506680.9753621166249; Mon, 7 Oct 2024 07:29:44 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.812105.1224820 (Exim 4.92) (envelope-from ) id 1sxojj-0004OG-Hj; Mon, 07 Oct 2024 14:29:23 +0000 Received: by outflank-mailman (output) from mailman id 812105.1224820; Mon, 07 Oct 2024 14:29:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sxojj-0004O9-Ej; Mon, 07 Oct 2024 14:29:23 +0000 Received: by outflank-mailman (input) for mailman id 812105; Mon, 07 Oct 2024 14:29:22 +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 1sxoXM-0002dC-8D for xen-devel@lists.xenproject.org; Mon, 07 Oct 2024 14:16:36 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id c16f7f91-84b6-11ef-99a2-01e77a169b0f; Mon, 07 Oct 2024 16:16:33 +0200 (CEST) Received: from truciolo.bugseng.com (unknown [37.162.58.49]) by support.bugseng.com (Postfix) with ESMTPSA id ACA1E4EE0743; Mon, 7 Oct 2024 16:16:32 +0200 (CEST) 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: c16f7f91-84b6-11ef-99a2-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1728310593; bh=pkehAqIigHugA14oiN/kSXZIjXGX6ygiIRmSA9aEPl0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DNsLZMClLCIOP+iP8GcTHaCg58dgwWfkO4r+WhG5ZXUvUN0XFBIc1ScaaIwfzRhfL /odxlPhj6dvIpEFtVIF20a88aIPFblEWcM9g0rkadhHOmkTB3USqkpTDp7NgUBeY98 MTLbB+0j3XluWB88FxHjz3xVp9fqLMQ6qyJPvbUu7PfiJqqityPafRMrZwu69ubTxE lIKwmy0JRR7Zzllp5I0yEmMUAevmpLiiC+TE4zq4Eu2Dx2CAwQheVCtNXeVZxWiLG0 152/2bXWyuG0avdiQDhlCSmOm7vhz6e0TVYB7cN0QiwA2KjZmGXLJRqaomAEafzt7V iRuv3ufAY364Q== From: Federico Serafini To: xen-devel@lists.xenproject.org Cc: consulting@bugseng.com, Federico Serafini , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [XEN PATCH v2 1/4] x86/emul: add defensive code Date: Mon, 7 Oct 2024 16:16:16 +0200 Message-ID: <063bd71b535825715bd54ee9238bec2fc87f0bba.1728308312.git.federico.serafini@bugseng.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @bugseng.com) X-ZM-MESSAGEID: 1728311385117116600 Content-Type: text/plain; charset="utf-8" Add defensive code after unreachable program points. This also meets the requirements to deviate violations of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". Signed-off-by: Federico Serafini Acked-by: Jan Beulich --- Changes in v2: - use goto unhandleable. --- xen/arch/x86/x86_emulate/x86_emulate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emul= ate/x86_emulate.c index 0ea0d5e67e..6b6b8c8fe4 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -6840,6 +6840,7 @@ x86_emulate( break; default: ASSERT_UNREACHABLE(); + goto unhandleable; } break; #ifdef HAVE_AS_SSE4_2 @@ -6868,6 +6869,7 @@ x86_emulate( # endif default: ASSERT_UNREACHABLE(); + goto unhandleable; } break; #endif --=20 2.43.0