aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/mm/kmemcheck/opcode.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/x86/mm/kmemcheck/opcode.c b/arch/x86/mm/kmemcheck/opcode.c
index a4100b6e783a..63c19e27aa6f 100644
--- a/arch/x86/mm/kmemcheck/opcode.c
+++ b/arch/x86/mm/kmemcheck/opcode.c
@@ -16,10 +16,17 @@ static bool opcode_is_prefix(uint8_t b)
16 || b == 0x67; 16 || b == 0x67;
17} 17}
18 18
19#ifdef CONFIG_X86_64
19static bool opcode_is_rex_prefix(uint8_t b) 20static bool opcode_is_rex_prefix(uint8_t b)
20{ 21{
21 return (b & 0xf0) == 0x40; 22 return (b & 0xf0) == 0x40;
22} 23}
24#else
25static bool opcode_is_rex_prefix(uint8_t b)
26{
27 return false;
28}
29#endif
23 30
24#define REX_W (1 << 3) 31#define REX_W (1 << 3)
25 32
@@ -40,7 +47,6 @@ void kmemcheck_opcode_decode(const uint8_t *op, unsigned int *size)
40 operand_size_override = 2; 47 operand_size_override = 2;
41 } 48 }
42 49
43#ifdef CONFIG_X86_64
44 /* REX prefix */ 50 /* REX prefix */
45 if (opcode_is_rex_prefix(*op)) { 51 if (opcode_is_rex_prefix(*op)) {
46 uint8_t rex = *op; 52 uint8_t rex = *op;
@@ -72,7 +78,6 @@ void kmemcheck_opcode_decode(const uint8_t *op, unsigned int *size)
72 return; 78 return;
73 } 79 }
74 } 80 }
75#endif
76 81
77 /* escape opcode */ 82 /* escape opcode */
78 if (*op == 0x0f) { 83 if (*op == 0x0f) {