@@ -1927,6 +1927,8 @@ const uint8_t rdtsc_insn[2] = { 0x0f, 0x31 };
19271927static const uint8_t rdtscp_insn[] = { 0x0f , 0x01 , 0xf9 };
19281928static const uint8_t tpause_insn[] = { 0x66 , 0x0f , 0xae , 0xf0 };
19291929static const uint8_t tpause_rex_insn[] = { 0x66 , 0x41 , 0x0f , 0xae , 0xf0 };
1930+ static const uint8_t umwait_insn[] = { 0xf2 , 0x0f , 0xae , 0xf0 };
1931+ static const uint8_t umwait_rex_insn[] = { 0xf2 , 0x41 , 0x0f , 0xae , 0xf0 };
19301932static const uint8_t cpuid_insn[] = { 0x0f , 0xa2 };
19311933static const uint8_t int3_insn[] = { 0xcc };
19321934static const uint8_t pushf_insn[] = { 0x9c };
@@ -1973,13 +1975,19 @@ SpecialInst special_instruction_at(Task* t, remote_code_ptr ip) {
19731975 if (!memcmp (insn, tpause_rex_insn, sizeof (tpause_rex_insn))) {
19741976 return {SpecialInstOpcode::X86_TPAUSE_REX };
19751977 }
1978+ if (!memcmp (insn, umwait_rex_insn, sizeof (umwait_rex_insn))) {
1979+ return {SpecialInstOpcode::X86_UMWAIT_REX };
1980+ }
19761981 }
19771982 if (len >= sizeof (tpause_insn)) {
19781983 // Mask off the register selector.
19791984 insn[3 ] &= ~0x07 ;
19801985 if (!memcmp (insn, tpause_insn, sizeof (tpause_insn))) {
19811986 return {SpecialInstOpcode::X86_TPAUSE };
19821987 }
1988+ if (!memcmp (insn, umwait_insn, sizeof (umwait_insn))) {
1989+ return {SpecialInstOpcode::X86_UMWAIT };
1990+ }
19831991 }
19841992 } else if (t->arch () == aarch64) {
19851993 uint8_t insn[4 ];
@@ -2020,6 +2028,10 @@ size_t special_instruction_len(SpecialInstOpcode insn) {
20202028 return sizeof (tpause_insn);
20212029 } else if (insn == SpecialInstOpcode::X86_TPAUSE_REX ) {
20222030 return sizeof (tpause_rex_insn);
2031+ } else if (insn == SpecialInstOpcode::X86_UMWAIT ) {
2032+ return sizeof (umwait_insn);
2033+ } else if (insn == SpecialInstOpcode::X86_UMWAIT_REX ) {
2034+ return sizeof (umwait_rex_insn);
20232035 } else if (insn == SpecialInstOpcode::ARM_MRS_CNTFRQ_EL0 ||
20242036 insn == SpecialInstOpcode::ARM_MRS_CNTVCT_EL0 ||
20252037 insn == SpecialInstOpcode::ARM_MRS_CNTVCTSS_EL0 ) {
0 commit comments