Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752603AbcLYPuD (ORCPT ); Sun, 25 Dec 2016 10:50:03 -0500 Received: from mail.kernel.org ([198.145.29.136]:36534 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750860AbcLYPuB (ORCPT ); Sun, 25 Dec 2016 10:50:01 -0500 Date: Mon, 26 Dec 2016 00:49:47 +0900 From: Masami Hiramatsu To: Ricardo Neri Cc: Ingo Molnar , Thomas Gleixner , Borislav Petkov , Andy Lutomirski , Peter Zijlstra , linux-kernel@vger.kernel.org, x86@kernel.org, , , Andrew Morton , "H . Peter Anvin" , Brian Gerst , Chen Yucong , Chris Metcalf , Dave Hansen , Fenghua Yu , Huang Rui , Jiri Slaby , Jonathan Corbet , "Michael S . Tsirkin" , Paul Gortmaker , "Ravi V . Shankar" , Shuah Khan , Vlastimil Babka , Tony Luck , Paolo Bonzini , "Liang Z . Li" , Alexandre Julliard , Stas Sergeev Subject: Re: [v2 5/7] x86: Add emulation code for UMIP instructions Message-Id: <20161226004947.9503af5719927f7c042ca140@kernel.org> In-Reply-To: <20161224013745.108716-6-ricardo.neri-calderon@linux.intel.com> References: <20161224013745.108716-1-ricardo.neri-calderon@linux.intel.com> <20161224013745.108716-6-ricardo.neri-calderon@linux.intel.com> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 880 Lines: 38 On Fri, 23 Dec 2016 17:37:43 -0800 Ricardo Neri wrote: > +static int __identify_insn(struct insn *insn) > +{ > + /* by getting modrm we also get the opcode */ > + insn_get_modrm(insn); > + if (insn->opcode.bytes[0] != 0xf) > + return -EINVAL; > + > + if (insn->opcode.bytes[1] == 0x1) { > + switch (X86_MODRM_REG(insn->modrm.value)) { > + case 0: > + return UMIP_SGDT; > + case 1: > + return UMIP_SIDT; > + case 4: > + return UMIP_SMSW; > + default: > + return -EINVAL; > + } > + } else if (insn->opcode.bytes[1] == 0x0) { > + if (X86_MODRM_REG(insn->modrm.value) == 0) > + return UMIP_SLDT; > + else if (X86_MODRM_REG(insn->modrm.value) == 1) > + return UMIP_STR; > + else > + return -EINVAL; > + } gcc detected an error here, you may need return "-EINVAL". Thanks, -- Masami Hiramatsu