diff options
Diffstat (limited to 'arch/x86/mm/pf_in.c')
| -rw-r--r-- | arch/x86/mm/pf_in.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/arch/x86/mm/pf_in.c b/arch/x86/mm/pf_in.c index 308e32570d84..38e6d174c497 100644 --- a/arch/x86/mm/pf_in.c +++ b/arch/x86/mm/pf_in.c | |||
| @@ -40,16 +40,16 @@ static unsigned char prefix_codes[] = { | |||
| 40 | static unsigned int reg_rop[] = { | 40 | static unsigned int reg_rop[] = { |
| 41 | 0x8A, 0x8B, 0xB60F, 0xB70F, 0xBE0F, 0xBF0F | 41 | 0x8A, 0x8B, 0xB60F, 0xB70F, 0xBE0F, 0xBF0F |
| 42 | }; | 42 | }; |
| 43 | static unsigned int reg_wop[] = { 0x88, 0x89 }; | 43 | static unsigned int reg_wop[] = { 0x88, 0x89, 0xAA, 0xAB }; |
| 44 | static unsigned int imm_wop[] = { 0xC6, 0xC7 }; | 44 | static unsigned int imm_wop[] = { 0xC6, 0xC7 }; |
| 45 | /* IA32 Manual 3, 3-432*/ | 45 | /* IA32 Manual 3, 3-432*/ |
| 46 | static unsigned int rw8[] = { 0x88, 0x8A, 0xC6 }; | 46 | static unsigned int rw8[] = { 0x88, 0x8A, 0xC6, 0xAA }; |
| 47 | static unsigned int rw32[] = { | 47 | static unsigned int rw32[] = { |
| 48 | 0x89, 0x8B, 0xC7, 0xB60F, 0xB70F, 0xBE0F, 0xBF0F | 48 | 0x89, 0x8B, 0xC7, 0xB60F, 0xB70F, 0xBE0F, 0xBF0F, 0xAB |
| 49 | }; | 49 | }; |
| 50 | static unsigned int mw8[] = { 0x88, 0x8A, 0xC6, 0xB60F, 0xBE0F }; | 50 | static unsigned int mw8[] = { 0x88, 0x8A, 0xC6, 0xB60F, 0xBE0F, 0xAA }; |
| 51 | static unsigned int mw16[] = { 0xB70F, 0xBF0F }; | 51 | static unsigned int mw16[] = { 0xB70F, 0xBF0F }; |
| 52 | static unsigned int mw32[] = { 0x89, 0x8B, 0xC7 }; | 52 | static unsigned int mw32[] = { 0x89, 0x8B, 0xC7, 0xAB }; |
| 53 | static unsigned int mw64[] = {}; | 53 | static unsigned int mw64[] = {}; |
| 54 | #else /* not __i386__ */ | 54 | #else /* not __i386__ */ |
| 55 | static unsigned char prefix_codes[] = { | 55 | static unsigned char prefix_codes[] = { |
| @@ -63,20 +63,20 @@ static unsigned char prefix_codes[] = { | |||
| 63 | static unsigned int reg_rop[] = { | 63 | static unsigned int reg_rop[] = { |
| 64 | 0x8A, 0x8B, 0xB60F, 0xB70F, 0xBE0F, 0xBF0F | 64 | 0x8A, 0x8B, 0xB60F, 0xB70F, 0xBE0F, 0xBF0F |
| 65 | }; | 65 | }; |
| 66 | static unsigned int reg_wop[] = { 0x88, 0x89 }; | 66 | static unsigned int reg_wop[] = { 0x88, 0x89, 0xAA, 0xAB }; |
| 67 | static unsigned int imm_wop[] = { 0xC6, 0xC7 }; | 67 | static unsigned int imm_wop[] = { 0xC6, 0xC7 }; |
| 68 | static unsigned int rw8[] = { 0xC6, 0x88, 0x8A }; | 68 | static unsigned int rw8[] = { 0xC6, 0x88, 0x8A, 0xAA }; |
| 69 | static unsigned int rw32[] = { | 69 | static unsigned int rw32[] = { |
| 70 | 0xC7, 0x89, 0x8B, 0xB60F, 0xB70F, 0xBE0F, 0xBF0F | 70 | 0xC7, 0x89, 0x8B, 0xB60F, 0xB70F, 0xBE0F, 0xBF0F, 0xAB |
| 71 | }; | 71 | }; |
| 72 | /* 8 bit only */ | 72 | /* 8 bit only */ |
| 73 | static unsigned int mw8[] = { 0xC6, 0x88, 0x8A, 0xB60F, 0xBE0F }; | 73 | static unsigned int mw8[] = { 0xC6, 0x88, 0x8A, 0xB60F, 0xBE0F, 0xAA }; |
| 74 | /* 16 bit only */ | 74 | /* 16 bit only */ |
| 75 | static unsigned int mw16[] = { 0xB70F, 0xBF0F }; | 75 | static unsigned int mw16[] = { 0xB70F, 0xBF0F }; |
| 76 | /* 16 or 32 bit */ | 76 | /* 16 or 32 bit */ |
| 77 | static unsigned int mw32[] = { 0xC7 }; | 77 | static unsigned int mw32[] = { 0xC7 }; |
| 78 | /* 16, 32 or 64 bit */ | 78 | /* 16, 32 or 64 bit */ |
| 79 | static unsigned int mw64[] = { 0x89, 0x8B }; | 79 | static unsigned int mw64[] = { 0x89, 0x8B, 0xAB }; |
| 80 | #endif /* not __i386__ */ | 80 | #endif /* not __i386__ */ |
| 81 | 81 | ||
| 82 | struct prefix_bits { | 82 | struct prefix_bits { |
| @@ -410,7 +410,6 @@ static unsigned long *get_reg_w32(int no, struct pt_regs *regs) | |||
| 410 | unsigned long get_ins_reg_val(unsigned long ins_addr, struct pt_regs *regs) | 410 | unsigned long get_ins_reg_val(unsigned long ins_addr, struct pt_regs *regs) |
| 411 | { | 411 | { |
| 412 | unsigned int opcode; | 412 | unsigned int opcode; |
| 413 | unsigned char mod_rm; | ||
| 414 | int reg; | 413 | int reg; |
| 415 | unsigned char *p; | 414 | unsigned char *p; |
| 416 | struct prefix_bits prf; | 415 | struct prefix_bits prf; |
| @@ -437,8 +436,13 @@ unsigned long get_ins_reg_val(unsigned long ins_addr, struct pt_regs *regs) | |||
| 437 | goto err; | 436 | goto err; |
| 438 | 437 | ||
| 439 | do_work: | 438 | do_work: |
| 440 | mod_rm = *p; | 439 | /* for STOS, source register is fixed */ |
| 441 | reg = ((mod_rm >> 3) & 0x7) | (prf.rexr << 3); | 440 | if (opcode == 0xAA || opcode == 0xAB) { |
| 441 | reg = arg_AX; | ||
| 442 | } else { | ||
| 443 | unsigned char mod_rm = *p; | ||
| 444 | reg = ((mod_rm >> 3) & 0x7) | (prf.rexr << 3); | ||
| 445 | } | ||
| 442 | switch (get_ins_reg_width(ins_addr)) { | 446 | switch (get_ins_reg_width(ins_addr)) { |
| 443 | case 1: | 447 | case 1: |
| 444 | return *get_reg_w8(reg, prf.rex, regs); | 448 | return *get_reg_w8(reg, prf.rex, regs); |
