From nobody Wed Nov 5 05:35:03 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=none dis=none) header.from=bugseng.com ARC-Seal: i=1; a=rsa-sha256; t=1725962982; cv=none; d=zohomail.com; s=zohoarc; b=Eqnjw0D5POWHUqvaFMIMRbmru+O76a14LwuqFaj0di1N5Kurlp4MbDx19YFgX8QTX3s1avsFZ9eKPmNPNlrlMKaWR/SuE0PetLR8vsEfuz6dzIW4lBScw1qHxirXK3McwVJjXM1Lx75ASmy2kdtlRMD9Gr1kzfOZ/NrHg23cVTE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725962982; 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=HVRzFSWINs7/USq8U/rDZFji1PfnQ9J2vcXSLeUdbhY=; b=WSC1RbuVkvYCwcbsCCJ1ai/SSvmDdzq8Vr4WukP261/KuA/GI62Dt/6XIhDJmVNPxDfOdpJacZ3HSnHjaM27xs0aFmxIZ+JFM+2csTmtw+Yjva244bDw4RCRzKDoVIO0YufgelS4oZLTpCUdqS7yC3g6txHsNBfOsytjCQQORso= 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 1725962982787842.6470664754794; Tue, 10 Sep 2024 03:09:42 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.795240.1204520 (Exim 4.92) (envelope-from ) id 1snxoH-0008FZ-Is; Tue, 10 Sep 2024 10:09:21 +0000 Received: by outflank-mailman (output) from mailman id 795240.1204520; Tue, 10 Sep 2024 10:09:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1snxoH-0008Cb-0k; Tue, 10 Sep 2024 10:09:21 +0000 Received: by outflank-mailman (input) for mailman id 795240; Tue, 10 Sep 2024 10:09:19 +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 1snxoF-0006in-7M for xen-devel@lists.xenproject.org; Tue, 10 Sep 2024 10:09:19 +0000 Received: from support.bugseng.com (mail.bugseng.com [162.55.131.47]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id bc8f407b-6f5c-11ef-99a1-01e77a169b0f; Tue, 10 Sep 2024 12:09:16 +0200 (CEST) Received: from truciolo.homenet.telecomitalia.it (host-79-37-206-90.retail.telecomitalia.it [79.37.206.90]) by support.bugseng.com (Postfix) with ESMTPSA id E10C04EE0CC2; Tue, 10 Sep 2024 12:09:15 +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: bc8f407b-6f5c-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bugseng.com; s=mail; t=1725962956; bh=7STVOBIhCgKWpEDLBjJ3I3pd4DCbTs6VnI7lN8dRmpo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NF75lBMMwFAKjJlCteFveEQkKfAAauNEwayIQPtDG4Zpta6Q5xTzOMoSNJ8SBTHWn KLDgdfAWHo+ohBzitH+cGqA1/xgmE0iwBs14q1VlFMhk+E11NWzVM9pRRQM7DhA/3Z xiVcCkpuF6C+TvkxWF/9c92T0jjjvDSxTI39zGTdvp1D9wgwaGEhwk+r1A54kfYYIl UAfFEZQCCrp1eX/2b979PNqS6Dnh38XYdYmlPHOta0lR+v65oYlvfeQwowX5CNfX/K WN68ZXCo5IaKbjbFGmQ6AcRh50JGIpAHZr3CvCQte4yQENrjb+lHknFVAYx2akS77y V9T39h1uLgt1w== 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?= Subject: [XEN PATCH 08/12] x86/emul: add defensive code Date: Tue, 10 Sep 2024 12:09:00 +0200 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @bugseng.com) X-ZM-MESSAGEID: 1725962983220116600 Content-Type: text/plain; charset="utf-8" Add defensive code after unreachable program points. This also meets the requirements to deviate a violation of MISRA C:2012 Rule 16.3: "An unconditional `break' statement shall terminate every switch-clause". Signed-off-by: Federico Serafini --- xen/arch/x86/x86_emulate/x86_emulate.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emul= ate/x86_emulate.c index e12fbe3100..2b03d65fce 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -6831,6 +6831,8 @@ x86_emulate( break; default: ASSERT_UNREACHABLE(); + rc =3D X86EMUL_UNHANDLEABLE; + goto done; } break; #ifdef HAVE_AS_SSE4_2 @@ -6859,6 +6861,8 @@ x86_emulate( # endif default: ASSERT_UNREACHABLE(); + rc =3D X86EMUL_UNHANDLEABLE; + goto done; } break; #endif --=20 2.34.1