Skip to content

Save and restore the R5900 specific register extensions #5

Open
@frno7

Description

@frno7

The R5900 extends the MIPS general purpose registers (GPRs) from 64 bits to 128 bits. The upper 64 bits of the GPRs are used by the R5900 specific quad load/store (LQ/SQ) and multimedia instructions (MMIs).

The special HI1 and LO1 registers, which are the upper 64 bits of each of the 128-bit HI and LO registers, are used by the R5900 specific multiply and divide instructions, such as MULT1, MULTU1, DIV1, DIVU1, MADD1 and MADDU1, as well as MFHI1, MFLO1, MTHI1 and MTLO1.

Finally, a R5900 specific shift amount (SA) register contains the shift amount for the 256-bit funnel shift instruction QFSRV.

To use the instructions mentioned above in user space, these R5900 specific registers must be saved and restored appropriately by the kernel when switching contexts. If the registers are not saved and restored, they ought to be cleared to avoid leaking information between processes.

Will these registers be saved and restored for both the o32 and the n32 Linux ABIs? It would be most useful and least surprising to support both ABIs. Of particular note is that the MMIs cannot be disabled by the kernel. The MMIs would therefore appear to mostly work, even when the kernel actually does not save and restore the registers. Problems would manifest as random register corruptions, that can be very difficult and frustrating to find.

See appendix B in the TX79 manual.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions