diff mbox

[2/2] x86/emulate: Resolve MISSING_BREAK issue in x86_decode()

Message ID 1475229664-10992-2-git-send-email-andrew.cooper3@citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Andrew Cooper Sept. 30, 2016, 10:01 a.m. UTC
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 <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>

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(-)

Comments

Jan Beulich Sept. 30, 2016, 10:06 a.m. UTC | #1
>>> On 30.09.16 at 12:01, <andrew.cooper3@citrix.com> wrote:
> 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 <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
Wei Liu Sept. 30, 2016, 11:20 a.m. UTC | #2
On Fri, Sep 30, 2016 at 04:06:57AM -0600, Jan Beulich wrote:
> >>> On 30.09.16 at 12:01, <andrew.cooper3@citrix.com> wrote:
> > 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 <andrew.cooper3@citrix.com>
> 
> Acked-by: Jan Beulich <jbeulich@suse.com>
> 

Series pushed.

> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel
diff mbox

Patch

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;