Re: [PATCH v2 04/21] x86/insn: Add an insn_decode() API

2021-02-28 Thread Masami Hiramatsu
On Fri, 26 Feb 2021 19:30:06 +0100 Borislav Petkov wrote: > On Sat, Feb 27, 2021 at 12:45:06AM +0900, Masami Hiramatsu wrote: > > OK, but I think it should return -EINVAL or -EILSEQ for bad instruction. > > It does return -EINVAL when insn_complete() returns 0. > > > Here you return 1 for a bad

Re: [PATCH v2 04/21] x86/insn: Add an insn_decode() API

2021-02-26 Thread Borislav Petkov
On Sat, Feb 27, 2021 at 12:45:06AM +0900, Masami Hiramatsu wrote: > OK, but I think it should return -EINVAL or -EILSEQ for bad instruction. It does return -EINVAL when insn_complete() returns 0. > Here you return 1 for a bad opcode. Whoops, that's a leftover from the early version where it woul

Re: [PATCH v2 04/21] x86/insn: Add an insn_decode() API

2021-02-26 Thread Masami Hiramatsu
Hi Borislav, On Wed, 24 Feb 2021 12:02:16 +0100 Borislav Petkov wrote: > From: Borislav Petkov > > Users of the instruction decoder should use this to decode instruction > bytes. For that, have insn*() helpers return an int value to denote > success/failure. When there's an error fetching the

[PATCH v2 04/21] x86/insn: Add an insn_decode() API

2021-02-24 Thread Borislav Petkov
From: Borislav Petkov Users of the instruction decoder should use this to decode instruction bytes. For that, have insn*() helpers return an int value to denote success/failure. When there's an error fetching the next insn byte and the insn falls short, return -ENODATA to denote that. While at i