Re: [Xen-devel] [PATCH v3 2/3] x86/svm: Drop enum instruction_index and simplify svm_get_insn_len()

2019-01-31 Thread Jan Beulich
>>> On 31.01.19 at 19:07, wrote: > On 07/01/2019 10:30, Jan Beulich wrote: > On 31.12.18 at 12:37, wrote: >>> Passing a 32-bit integer index into an array with entries containing less >>> than >>> 32 bits of data is wasteful, and creates an unnecessary error condition of >>> passing an

Re: [Xen-devel] [PATCH v3 2/3] x86/svm: Drop enum instruction_index and simplify svm_get_insn_len()

2019-01-31 Thread Andrew Cooper
On 07/01/2019 10:30, Jan Beulich wrote: On 31.12.18 at 12:37, wrote: >> Passing a 32-bit integer index into an array with entries containing less >> than >> 32 bits of data is wasteful, and creates an unnecessary error condition of >> passing an out-of-range index. >> >> The width of the

Re: [Xen-devel] [PATCH v3 2/3] x86/svm: Drop enum instruction_index and simplify svm_get_insn_len()

2019-01-07 Thread Jan Beulich
>>> On 31.12.18 at 12:37, wrote: > Passing a 32-bit integer index into an array with entries containing less than > 32 bits of data is wasteful, and creates an unnecessary error condition of > passing an out-of-range index. > > The width of the X86EMUL_OPC() encoding is at most 24 bits, which

Re: [Xen-devel] [PATCH v3 2/3] x86/svm: Drop enum instruction_index and simplify svm_get_insn_len()

2019-01-04 Thread Jan Beulich
>>> On 31.12.18 at 12:57, wrote: > On 31/12/2018 11:37, Andrew Cooper wrote: >> +/* >> + * Encoding for svm_get_insn_len(). We take X86EMUL_OPC() for the main >> + * opcode, shifted left to make room for the ModRM byte. >> + */ >> +#define INSTR_ENC(opc, modrm) (((unsigned int)(opc) << 8) |

Re: [Xen-devel] [PATCH v3 2/3] x86/svm: Drop enum instruction_index and simplify svm_get_insn_len()

2018-12-31 Thread Andrew Cooper
On 31/12/2018 11:37, Andrew Cooper wrote: > +/* > + * Encoding for svm_get_insn_len(). We take X86EMUL_OPC() for the main > + * opcode, shifted left to make room for the ModRM byte. > + */ > +#define INSTR_ENC(opc, modrm) (((unsigned int)(opc) << 8) | (modrm)) > +#define MODRM(mod, reg, rm)

[Xen-devel] [PATCH v3 2/3] x86/svm: Drop enum instruction_index and simplify svm_get_insn_len()

2018-12-31 Thread Andrew Cooper
Passing a 32-bit integer index into an array with entries containing less than 32 bits of data is wasteful, and creates an unnecessary error condition of passing an out-of-range index. The width of the X86EMUL_OPC() encoding is at most 24 bits, which leaves room for a modrm byte. Drop opc_tab[]