Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Feb 2014 12:03:47 -0600
From:      Stacey Son <sson@FreeBSD.org>
To:        "freebsd-mips@freebsd.org" <freebsd-mips@freebsd.org>
Subject:   [RFC] Enable use of UserLocal Register (ULRI) if detected (patches)
Message-ID:  <D964DBB1-3727-4B8A-B4E3-50FD8A300818@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
Hi all:

Below are some links to patches that enables the use of the UserLocal =
Register Implementation (ULRI) for the Thread Local Storage (TLS) =
pointer. =20

The first code change is for the user level code to use the 'rdhwr $29' =
instruction to retrieve the TLS pointer instead of using the =
sysarch(MIPS_GET_TLS,...) system call.  For hardware that supports this =
instruction this should be much faster since it doesn't require the =
overhead of a system call.  For hardware that doesn't support this =
instruction the 'rdhwr $29' instruction is emulated by the trap() =
handler in sys/mips/mips/trap.c and the overhead should be about the =
same. (Actually, some quick micro benchmarks indicate that emulating the =
 'rdhwr' instruction is slightly faster than the sysarch() system call.) =
 For the patch, see:=20

http://people.freebsd.org/~sson/mips/ulri/ulri_user.diff

The next code change probes for the UserLocal Register Implementation =
(ULRI) and, if found, will enable it (or actually disable it if not =
found) in the kernel code.  sysarch(MIPS_SET_TLS,...) calls also update =
the UserLocal register as well. For the patch, see:

http://people.freebsd.org/~sson/mips/ulri/ulri_kernel.diff

The final patch is for qemu system-mode that adds support for the ULRI:

http://people.freebsd.org/~sson/mips/ulri/ulri_qemu.diff

For more information about the ULRI see "MIPS Architecture for =
Programmers Volume III"  section 9.9 UserLocal Register (CP0 Register 4, =
Select 2).

Best Regards,

-stacey.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D964DBB1-3727-4B8A-B4E3-50FD8A300818>