From patchwork Fri Sep 30 10:01:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Cooper X-Patchwork-Id: 9357911 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2B5E560757 for ; Fri, 30 Sep 2016 10:03:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1AC7229F78 for ; Fri, 30 Sep 2016 10:03:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C717262AE; Fri, 30 Sep 2016 10:03:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9280B262AE for ; Fri, 30 Sep 2016 10:03:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bpud4-00051Z-Ov; Fri, 30 Sep 2016 10:01:18 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bpud3-00051T-6X for xen-devel@lists.xen.org; Fri, 30 Sep 2016 10:01:17 +0000 Received: from [85.158.137.68] by server-7.bemta-3.messagelabs.com id 32/AC-03271-BE73EE75; Fri, 30 Sep 2016 10:01:15 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupjkeJIrShJLcpLzFFi42JxWrohUve1+bt wg6uHxCyWfFzM4sDocXT3b6YAxijWzLyk/IoE1owlC90L7nJU3J+8mq2B8R5bFyMnh4SAv8Th 95/AbDYBfYndLz4xgdgiAuoSpzsusnYxcnAwC/hJHHrgCxIWFvCVePLwGiuIzSKgKvHvTgM7S AmvgKfEzf+sEBPlJM4f/8kMYnMKeEm8ODqJEcQWAip5Ouk9E4StJnGt/xI7iM0rIChxcuYTFh CbWUBC4uCLF8wQc7glbp+eyjyBkW8WkrJZSMoWMDKtYtQoTi0qSy3SNTLVSyrKTM8oyU3MzNE 1NDDWy00tLk5MT81JTCrWS87P3cQIDKd6BgbGHYytJ/wOMUpyMCmJ8soefRsuxJeUn1KZkVic EV9UmpNafIhRhoNDSYL3tNm7cCHBotT01Iq0zBxgYMOkJTh4lER4u0HSvMUFibnFmekQqVOMi lLivJzAeBASAElklObBtcGi6RKjrJQwLyMDA4MQT0FqUW5mCar8K0ZxDkYlYd55ION5MvNK4K a/AlrMBLQ4/+gbkMUliQgpqQZGzWl/3xvGTzrEPGXTs/7QVVsmlwvc9k7849H7fPUbJZEdwp6 HZcMYeUz2J6xZvjTp26V9FUxqYg9jirMd+MMPiM+3fflmo8yuit93z/LM+77qxrLTpat5/qky F0qcKVt9w0Yu5fwDo3v8vvXlr55U6Rxut/g1aWXaG+1LXszHhXfO3q3rYvq0UomlOCPRUIu5q DgRAI6UpCShAgAA X-Env-Sender: prvs=0746a37b4=Andrew.Cooper3@citrix.com X-Msg-Ref: server-5.tower-31.messagelabs.com!1475229672!60492788!2 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 8.84; banners=-,-,- X-VirusChecked: Checked Received: (qmail 53863 invoked from network); 30 Sep 2016 10:01:15 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-5.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 30 Sep 2016 10:01:15 -0000 X-IronPort-AV: E=Sophos;i="5.31,271,1473120000"; d="scan'208";a="381643769" From: Andrew Cooper To: Xen-devel Date: Fri, 30 Sep 2016 11:01:04 +0100 Message-ID: <1475229664-10992-2-git-send-email-andrew.cooper3@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1475229664-10992-1-git-send-email-andrew.cooper3@citrix.com> References: <1475229664-10992-1-git-send-email-andrew.cooper3@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Andrew Cooper , Jan Beulich Subject: [Xen-devel] [PATCH 2/2] x86/emulate: Resolve MISSING_BREAK issue in x86_decode() X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP Coverity doesn't appear to be able to spot that this is a terminal error path, but leave a comment to "fix" MISSING_BREAK. Signed-off-by: Andrew Cooper Acked-by: Jan Beulich --- CC: Jan Beulich This issue is newly exposed since splitting x86_decode() away from x86_emulate(). I seem to recall that Coverity has an upper bound of paths-per-function which it will tolerate (to avoid infinite loops), and the split allows double the exploration space. --- xen/arch/x86/x86_emulate/x86_emulate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/x86/x86_emulate/x86_emulate.c b/xen/arch/x86/x86_emulate/x86_emulate.c index 78b23a0..32e8b69 100644 --- a/xen/arch/x86/x86_emulate/x86_emulate.c +++ b/xen/arch/x86/x86_emulate/x86_emulate.c @@ -1891,7 +1891,7 @@ x86_decode( switch ( def_ad_bytes ) { default: - BUG(); + BUG(); /* Shouldn't be possible. */ case 2: if ( in_realmode(ctxt, ops) || (state->regs->eflags & EFLG_VM) ) break;