[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20161226004947.9503af5719927f7c042ca140@kernel.org>
Date: Mon, 26 Dec 2016 00:49:47 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
Cc: Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...e.de>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
linux-kernel@...r.kernel.org, x86@...nel.org,
<linux-msdos@...r.kernel.org>, <wine-devel@...ehq.org>,
Andrew Morton <akpm@...ux-foundation.org>,
"H . Peter Anvin" <hpa@...or.com>, Brian Gerst <brgerst@...il.com>,
Chen Yucong <slaoub@...il.com>,
Chris Metcalf <cmetcalf@...lanox.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Fenghua Yu <fenghua.yu@...el.com>,
Huang Rui <ray.huang@....com>, Jiri Slaby <jslaby@...e.cz>,
Jonathan Corbet <corbet@....net>,
"Michael S . Tsirkin" <mst@...hat.com>,
Paul Gortmaker <paul.gortmaker@...driver.com>,
"Ravi V . Shankar" <ravi.v.shankar@...el.com>,
Shuah Khan <shuah@...nel.org>,
Vlastimil Babka <vbabka@...e.cz>,
Tony Luck <tony.luck@...el.com>,
Paolo Bonzini <pbonzini@...hat.com>,
"Liang Z . Li" <liang.z.li@...el.com>,
Alexandre Julliard <julliard@...ehq.org>,
Stas Sergeev <stsp@...t.ru>
Subject: Re: [v2 5/7] x86: Add emulation code for UMIP instructions
On Fri, 23 Dec 2016 17:37:43 -0800
Ricardo Neri <ricardo.neri-calderon@...ux.intel.com> 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 <mhiramat@...nel.org>
Powered by blists - more mailing lists