Re: register x18

From: Andrew Turner <>
Date: Fri, 16 Jul 2021 14:51:33 +0200
> On 16 Jul 2021, at 13:08, wrote:
>> On 16. Jul 2021, at 04:06, Mark Millard < <>> wrote:
>> On 2021-Jul-15, at 17:40, Michael Tuexen <tuexen at> wrote:
>>> Dear all,
>>> register x18 seems to be special. What is it used for in FreeBSD?
>>> Best regards
>>> Michael
>> reports:
>> 	• X18 is the platform register and is reserved for the use of platform ABIs. This is an adional temporary register on platforms that don't assign a special meaning to it.
>> So, special, yes. But I do not know what the "platform ABI" usage
>> for it might be on FreeBSD. So, for the most part, this does not
>> well-answer your question. Sorry.
> Yepp, I found the above text. However, x18 seems to be used when accessing
> global variables. I am looking at a panic, where the system panics on accessing
> global variable, which can be controlled by sysctl.
> It seems that x18 does not have the expected value, but it is also not set in
> the function...

X18 is used to store the pointer to the pcpu data It should only ever be set when we enter the kernel from userland by the exception handler.

Received on Fri Jul 16 2021 - 12:51:33 UTC

Original text of this message