Lines Matching refs:op
487 #define __put_user_asmx(x, addr, err, op, cr) \ argument
489 "1: " op " %2,0,%3\n" \
503 #define __get_user_asmx(x, addr, err, op) \ argument
505 "1: "op" %1,0,%2\n" \
518 #define __cacheop_user_asmx(addr, err, op) \ argument
520 "1: "op" 0,%1\n" \
642 int __kprobes analyse_instr(struct instruction_op *op, struct pt_regs *regs, in analyse_instr() argument
651 op->type = COMPUTE; in analyse_instr()
656 op->type = BRANCH; in analyse_instr()
670 op->type = SYSCALL; in analyse_instr()
672 op->type = UNKNOWN; in analyse_instr()
676 op->type = BRANCH; in analyse_instr()
698 op->type = BRANCH; in analyse_instr()
711 op->type = RFI; in analyse_instr()
715 op->type = BARRIER; in analyse_instr()
741 op->type = BARRIER; in analyse_instr()
756 op->type = BARRIER; in analyse_instr()
946 op->type = MFMSR; in analyse_instr()
947 op->reg = rd; in analyse_instr()
952 op->type = MTMSR; in analyse_instr()
953 op->reg = rd; in analyse_instr()
954 op->val = 0xffffffff & ~(MSR_ME | MSR_LE); in analyse_instr()
960 op->type = MTMSR; in analyse_instr()
961 op->reg = rd; in analyse_instr()
965 op->val = imm; in analyse_instr()
999 op->type = MFSPR; in analyse_instr()
1000 op->reg = rd; in analyse_instr()
1001 op->spr = spr; in analyse_instr()
1019 op->type = MTSPR; in analyse_instr()
1020 op->val = regs->gpr[rd]; in analyse_instr()
1021 op->spr = spr; in analyse_instr()
1299 op->type = MKOP(CACHEOP, DCBST, 0); in analyse_instr()
1300 op->ea = xform_ea(instr, regs); in analyse_instr()
1304 op->type = MKOP(CACHEOP, DCBF, 0); in analyse_instr()
1305 op->ea = xform_ea(instr, regs); in analyse_instr()
1309 op->type = MKOP(CACHEOP, DCBTST, 0); in analyse_instr()
1310 op->ea = xform_ea(instr, regs); in analyse_instr()
1311 op->reg = rd; in analyse_instr()
1315 op->type = MKOP(CACHEOP, DCBTST, 0); in analyse_instr()
1316 op->ea = xform_ea(instr, regs); in analyse_instr()
1317 op->reg = rd; in analyse_instr()
1321 op->type = MKOP(CACHEOP, ICBI, 0); in analyse_instr()
1322 op->ea = xform_ea(instr, regs); in analyse_instr()
1331 op->type = UNKNOWN; in analyse_instr()
1332 op->update_reg = ra; in analyse_instr()
1333 op->reg = rd; in analyse_instr()
1334 op->val = regs->gpr[rd]; in analyse_instr()
1340 op->ea = xform_ea(instr, regs); in analyse_instr()
1343 op->type = MKOP(LARX, 0, 4); in analyse_instr()
1347 op->type = MKOP(STCX, 0, 4); in analyse_instr()
1352 op->type = MKOP(LARX, 0, 8); in analyse_instr()
1356 op->type = MKOP(STCX, 0, 8); in analyse_instr()
1361 op->type = MKOP(LOAD, u, 8); in analyse_instr()
1367 op->type = MKOP(LOAD, u, 4); in analyse_instr()
1372 op->type = MKOP(LOAD, u, 1); in analyse_instr()
1380 op->type = MKOP(LOAD_VMX, 0, 16); in analyse_instr()
1387 op->type = MKOP(STORE_VMX, 0, 16); in analyse_instr()
1394 op->type = MKOP(STORE, u, 8); in analyse_instr()
1400 op->type = MKOP(STORE, u, 4); in analyse_instr()
1405 op->type = MKOP(STORE, u, 1); in analyse_instr()
1410 op->type = MKOP(LOAD, u, 2); in analyse_instr()
1416 op->type = MKOP(LOAD, SIGNEXT | u, 4); in analyse_instr()
1422 op->type = MKOP(LOAD, SIGNEXT | u, 2); in analyse_instr()
1427 op->type = MKOP(STORE, u, 2); in analyse_instr()
1432 op->type = MKOP(LOAD, BYTEREV, 8); in analyse_instr()
1437 op->type = MKOP(LOAD_MULTI, 0, regs->xer & 0x7f); in analyse_instr()
1441 op->type = MKOP(LOAD, BYTEREV, 4); in analyse_instr()
1447 op->type = MKOP(LOAD_MULTI, 0, rb); in analyse_instr()
1448 op->ea = 0; in analyse_instr()
1450 op->ea = truncate_if_32bit(regs->msr, in analyse_instr()
1459 op->type = MKOP(LOAD_FP, u, 4); in analyse_instr()
1466 op->type = MKOP(LOAD_FP, u, 8); in analyse_instr()
1473 op->type = MKOP(STORE_FP, u, 4); in analyse_instr()
1480 op->type = MKOP(STORE_FP, u, 8); in analyse_instr()
1486 op->type = MKOP(STORE, BYTEREV, 8); in analyse_instr()
1487 op->val = byterev_8(regs->gpr[rd]); in analyse_instr()
1492 op->type = MKOP(STORE_MULTI, 0, regs->xer & 0x7f); in analyse_instr()
1496 op->type = MKOP(STORE, BYTEREV, 4); in analyse_instr()
1497 op->val = byterev_4(regs->gpr[rd]); in analyse_instr()
1503 op->type = MKOP(STORE_MULTI, 0, rb); in analyse_instr()
1504 op->ea = 0; in analyse_instr()
1506 op->ea = truncate_if_32bit(regs->msr, in analyse_instr()
1511 op->type = MKOP(LOAD, BYTEREV, 2); in analyse_instr()
1515 op->type = MKOP(STORE, BYTEREV, 2); in analyse_instr()
1516 op->val = byterev_2(regs->gpr[rd]); in analyse_instr()
1524 op->reg = rd | ((instr & 1) << 5); in analyse_instr()
1525 op->type = MKOP(LOAD_VSX, u, 16); in analyse_instr()
1532 op->reg = rd | ((instr & 1) << 5); in analyse_instr()
1533 op->type = MKOP(STORE_VSX, u, 16); in analyse_instr()
1542 op->type = MKOP(LOAD, u, 4); in analyse_instr()
1543 op->ea = dform_ea(instr, regs); in analyse_instr()
1548 op->type = MKOP(LOAD, u, 1); in analyse_instr()
1549 op->ea = dform_ea(instr, regs); in analyse_instr()
1554 op->type = MKOP(STORE, u, 4); in analyse_instr()
1555 op->ea = dform_ea(instr, regs); in analyse_instr()
1560 op->type = MKOP(STORE, u, 1); in analyse_instr()
1561 op->ea = dform_ea(instr, regs); in analyse_instr()
1566 op->type = MKOP(LOAD, u, 2); in analyse_instr()
1567 op->ea = dform_ea(instr, regs); in analyse_instr()
1572 op->type = MKOP(LOAD, SIGNEXT | u, 2); in analyse_instr()
1573 op->ea = dform_ea(instr, regs); in analyse_instr()
1578 op->type = MKOP(STORE, u, 2); in analyse_instr()
1579 op->ea = dform_ea(instr, regs); in analyse_instr()
1585 op->type = MKOP(LOAD_MULTI, 0, 4 * (32 - rd)); in analyse_instr()
1586 op->ea = dform_ea(instr, regs); in analyse_instr()
1590 op->type = MKOP(STORE_MULTI, 0, 4 * (32 - rd)); in analyse_instr()
1591 op->ea = dform_ea(instr, regs); in analyse_instr()
1599 op->type = MKOP(LOAD_FP, u, 4); in analyse_instr()
1600 op->ea = dform_ea(instr, regs); in analyse_instr()
1607 op->type = MKOP(LOAD_FP, u, 8); in analyse_instr()
1608 op->ea = dform_ea(instr, regs); in analyse_instr()
1615 op->type = MKOP(STORE_FP, u, 4); in analyse_instr()
1616 op->ea = dform_ea(instr, regs); in analyse_instr()
1623 op->type = MKOP(STORE_FP, u, 8); in analyse_instr()
1624 op->ea = dform_ea(instr, regs); in analyse_instr()
1630 op->ea = dsform_ea(instr, regs); in analyse_instr()
1633 op->type = MKOP(LOAD, 0, 8); in analyse_instr()
1636 op->type = MKOP(LOAD, UPDATE, 8); in analyse_instr()
1639 op->type = MKOP(LOAD, SIGNEXT, 4); in analyse_instr()
1645 op->ea = dsform_ea(instr, regs); in analyse_instr()
1648 op->type = MKOP(STORE, 0, 8); in analyse_instr()
1651 op->type = MKOP(STORE, UPDATE, 8); in analyse_instr()
1674 op->type = INTERRUPT | 0x700; in analyse_instr()
1675 op->val = SRR1_PROGPRIV; in analyse_instr()
1679 op->type = INTERRUPT | 0x700; in analyse_instr()
1680 op->val = SRR1_PROGTRAP; in analyse_instr()
1685 op->type = INTERRUPT | 0x800; in analyse_instr()
1691 op->type = INTERRUPT | 0xf20; in analyse_instr()
1697 op->type = INTERRUPT | 0xf40; in analyse_instr()
1769 struct instruction_op op; in emulate_step() local
1775 r = analyse_instr(&op, regs, instr); in emulate_step()
1780 size = GETSIZE(op.type); in emulate_step()
1781 switch (op.type & INSTR_TYPE_MASK) { in emulate_step()
1783 if (!address_ok(regs, op.ea, 8)) in emulate_step()
1785 switch (op.type & CACHEOP_MASK) { in emulate_step()
1787 __cacheop_user_asmx(op.ea, err, "dcbst"); in emulate_step()
1790 __cacheop_user_asmx(op.ea, err, "dcbf"); in emulate_step()
1793 if (op.reg == 0) in emulate_step()
1794 prefetchw((void *) op.ea); in emulate_step()
1797 if (op.reg == 0) in emulate_step()
1798 prefetch((void *) op.ea); in emulate_step()
1801 __cacheop_user_asmx(op.ea, err, "icbi"); in emulate_step()
1811 if (op.ea & (size - 1)) in emulate_step()
1814 if (!address_ok(regs, op.ea, size)) in emulate_step()
1819 __get_user_asmx(val, op.ea, err, "lwarx"); in emulate_step()
1822 __get_user_asmx(val, op.ea, err, "ldarx"); in emulate_step()
1828 regs->gpr[op.reg] = val; in emulate_step()
1834 if (op.ea & (size - 1)) in emulate_step()
1837 if (!address_ok(regs, op.ea, size)) in emulate_step()
1842 __put_user_asmx(op.val, op.ea, err, "stwcx.", cr); in emulate_step()
1845 __put_user_asmx(op.val, op.ea, err, "stdcx.", cr); in emulate_step()
1859 err = read_mem(®s->gpr[op.reg], op.ea, size, regs); in emulate_step()
1861 if (op.type & SIGNEXT) in emulate_step()
1862 do_signext(®s->gpr[op.reg], size); in emulate_step()
1863 if (op.type & BYTEREV) in emulate_step()
1864 do_byterev(®s->gpr[op.reg], size); in emulate_step()
1873 err = do_fp_load(op.reg, do_lfs, op.ea, size, regs); in emulate_step()
1875 err = do_fp_load(op.reg, do_lfd, op.ea, size, regs); in emulate_step()
1882 err = do_vec_load(op.reg, do_lvx, op.ea & ~0xfUL, regs); in emulate_step()
1889 err = do_vsx_load(op.reg, do_lxvd2x, op.ea, regs); in emulate_step()
1895 rd = op.reg; in emulate_step()
1900 err = read_mem(®s->gpr[rd], op.ea, nb, regs); in emulate_step()
1905 op.ea += 4; in emulate_step()
1913 if ((op.type & UPDATE) && size == sizeof(long) && in emulate_step()
1914 op.reg == 1 && op.update_reg == 1 && in emulate_step()
1916 op.ea >= regs->gpr[1] - STACK_INT_FRAME_SIZE) { in emulate_step()
1917 err = handle_stack_update(op.ea, regs); in emulate_step()
1920 err = write_mem(op.val, op.ea, size, regs); in emulate_step()
1928 err = do_fp_store(op.reg, do_stfs, op.ea, size, regs); in emulate_step()
1930 err = do_fp_store(op.reg, do_stfd, op.ea, size, regs); in emulate_step()
1937 err = do_vec_store(op.reg, do_stvx, op.ea & ~0xfUL, regs); in emulate_step()
1944 err = do_vsx_store(op.reg, do_stxvd2x, op.ea, regs); in emulate_step()
1950 rd = op.reg; in emulate_step()
1958 err = write_mem(val, op.ea, nb, regs); in emulate_step()
1961 op.ea += 4; in emulate_step()
1967 regs->gpr[op.reg] = regs->msr & MSR_MASK; in emulate_step()
1971 val = regs->gpr[op.reg]; in emulate_step()
1976 regs->msr = (regs->msr & ~op.val) | (val & op.val); in emulate_step()
2009 if (op.type & UPDATE) in emulate_step()
2010 regs->gpr[op.update_reg] = op.ea; in emulate_step()