question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong #UD conditions for instructions with mask-register

See original GitHub issue

Hi there,

while using some random data, I noticed XED beeing unable to decode certain instructions if one of the following conditions are met (64-bit mode):

EVEX
1. modrm.reg encodes a MASK register and EVEX.R   !=    0 (correct behavior)
2. modrm.reg encodes a MASK register and EVEX.R'  !=    0 (correct behavior)
3. modrm.rm  encodes a MASK register and EVEX.B   !=    0 (should be ignored)

VEX
4. VEX.vvvv  encodes a MASK register and VEX.vvvv != 1xxx
5. modrm.reg encodes a MASK register and VEX.R    !=    0 (might be correct)
6. modrm.rm  encodes a MASK register and VEX.B    !=    0

I did not find VEX-specific information about mask-register encoding, but according to table 2.33 (page 99) and table 2.39 (page 102/103) (Intel® 64 and IA-32 Architectures Software Developer’s Manual, March 2017) case 3. should not #UD for EVEX-instructions (EVEX.B is ignored instead).

Are these tables valid for VEX and MVEX instructions as well or do these ones follow different reg-encoding/#UD rules?

If they are valid, case 6. should be handled in the same way as case 3. and for case 4. only bits [2:0] are used, so I guess ignoring the most-significant bit of .vvvv should be the correct way of handling this one.

In addition EVEX.R' should always be ignored in non 64-bit modes and not cause a decoding-error.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
markcharneycommented, Jun 30, 2017

Thanks for looking at the old docs. Over the years, I’ve found enough errors in the docs that, when I can, I usually check the hardware directly or have someone look at the RTL for a couple of designs. I should have a more complete answer in a couple of days. For EVEX.vvvv, I believe the designs ignore EVEX.vvvv[3] in 32b mode but require that bit to be 1 in 64b mode. I’ll work with the doc people to have the VEX/EVEX #UD stuff improved for mask regs.

1reaction
markcharneycommented, Jan 13, 2018

I have implemented a small modification for the EVEX uses of GPR32_R and GPR64_R in mode64 patterns. I’ll push it next week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Counterfeit Respirators | NPPTL | NIOSH - CDC
Misrepresented respirators include all respirators that are falsely marketed and sold as NIOSH Approved respirators when they are not.
Read more >
Restrict data input by using validation rules - Microsoft Support
Validations rules help you check data as it is added to your Access desktop database which improves accuracy and consistency of data entry....
Read more >
1910.134 - Respiratory protection.
Filter or air purifying element means a component used in respirators to remove solid or liquid aerosols from the inspired air. Filtering facepiece...
Read more >
Mask Mythbusters: Common Questions about Kids & Face ...
covid-19~Cut through all the misinformation with these 5 common questions about kids and masks, along with evidence-based information that will put your ...
Read more >
“The target host does not support the virtual machine's current ...
To resolve CPU incompatibilities, use a cluster with Enhanced vMotion Compatibility (EVC) enabled. See KB article 1003212. Cause. The The target ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found