Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1633467
| From | Borislav Petkov <bp@suse.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [v6 PATCH 06/21] x86/insn-eval: Add utility functions to get segment selector |
| Date | 2017-04-30 19:20 +0200 |
| Message-ID | <tC0FP-5WW-3@gated-at.bofh.it> (permalink) |
| References | <tixO1-76a-3@gated-at.bofh.it> <tiy7n-7dF-1@gated-at.bofh.it> <txxVM-4zJ-23@gated-at.bofh.it> <tAC2R-7gR-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Apr 26, 2017 at 01:44:43PM -0700, Ricardo Neri wrote:
> I regard that the role of this function is to obtain the the segment
> selector from either of the prefixes or inferred from the operands. It
> is the role of caller to determine if the segment selector should be
> ignored.
No, this is wrong. The function is called resolve_seg_selector() and it
gives you the segment selector. CS, DS, ES, and SS in 64-bit mode are
treated as null segments and your function should return/signal exactly
that, i.e, saying that those should be ignored in that case.
> I double-checked the latest version of the Intel Software Development
> manual [2], in the table 3-5 in section 3.7.4 mentions that DS is
> default segment for all data references, except string destinations. I
> tested this code with the UMIP-protected instructions and whenever I use
> %edi the default segment is %ds.
Yes, all correct. Except that we're adding a more-or-less generic x86
insn decoder so we should make it so...
> Is this example valid? The documentation of MOVS specifies that it
> always moves DS:(E)SI to ES:(E)DI.
... that the decoder should do exactly that:
if (MOVS and rDI)
return SEG_ES;
And you're handing in struct insn * so you can easily check which insn
you're looking at.
Thanks.
--
Regards/Gruss,
Boris.
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
--
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [v6 PATCH 06/21] x86/insn-eval: Add utility functions to get segment selector Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-04-26 22:50 +0200
Re: [v6 PATCH 06/21] x86/insn-eval: Add utility functions to get segment selector Borislav Petkov <bp@suse.de> - 2017-04-30 19:20 +0200
Re: [v6 PATCH 06/21] x86/insn-eval: Add utility functions to get segment selector Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2017-05-05 20:40 +0200
csiph-web