On 10/15/21 11:30 AM, Warner Losh wrote:
    +    /*
    +     * Fall back to parsing instructions; will only be needed
    +     * for really ancient (pre-3.16) kernels.
    +     */
    +    insn = *(uint32_t *)host_signal_pc(uc);
    +
    +    return (insn & 0xbfff0000) == 0x0c000000   /* C3.3.1 */
    +        || (insn & 0xbfe00000) == 0x0c800000   /* C3.3.2 */
    +        || (insn & 0xbfdf0000) == 0x0d000000   /* C3.3.3 */
    +        || (insn & 0xbfc00000) == 0x0d800000   /* C3.3.4 */
    +        || (insn & 0x3f400000) == 0x08000000   /* C3.3.6 */
    +        || (insn & 0x3bc00000) == 0x39000000   /* C3.3.13 */
    +        || (insn & 0x3fc00000) == 0x3d800000   /* ... 128bit */
    +        /* Ignore bits 10, 11 & 21, controlling indexing.  */
    +        || (insn & 0x3bc00000) == 0x38000000   /* C3.3.8-12 */
    +        || (insn & 0x3fe00000) == 0x3c800000   /* ... 128bit */
    +        /* Ignore bits 23 & 24, controlling indexing.  */
    +        || (insn & 0x3a400000) == 0x28000000; /* C3.3.7,14-16 */
    +}

Oh, Warner, I was thinking about your query about sharing the instruction parsing code between *-user.

I was thinking that we should have, under e.g. user-only/, a library of stuff that could be referenced by *-user. One of these would be a simpler interface like

bool host_is_write_insn_at(void *pc);

We can hammer out details on that as you discover what you need in bsd-user.


r~

Reply via email to