Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Aug 2010 12:50:57 +0530
From:      "Jayachandran C." <c.jayachandran@gmail.com>
To:        "M. Warner Losh" <imp@bsdimp.com>
Cc:        freebsd-mips@freebsd.org
Subject:   Re: SMP support for n64 patch.
Message-ID:  <AANLkTikfQ2FokHv5khjUkBjOaxVMdcQfYS5xK_U_xUX0@mail.gmail.com>
In-Reply-To: <20100812.010121.123339447223515204.imp@bsdimp.com>
References:  <AANLkTimQVoRTc3CHNGHNAS2-PRqiZ8BiStekp6tj1Qc4@mail.gmail.com> <20100812.010121.123339447223515204.imp@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Aug 12, 2010 at 12:31 PM, M. Warner Losh <imp@bsdimp.com> wrote:
> In message: <AANLkTimQVoRTc3CHNGHNAS2-PRqiZ8BiStekp6tj1Qc4@mail.gmail.com=
>
> =A0 =A0 =A0 =A0 =A0 =A0"Jayachandran C." <c.jayachandran@gmail.com> write=
s:
> : I've attached a patch that enables SMP support for N64 builds (I can
> : get XLR come up multi-user with 32 cpus with this).
> :
> : I ended up making KX bit in status register set when you are in
> : userspace, since the PCPU area is now mapped in XKSEG. =A0The PCPU area
> : needs to be accessed in =A0I have reverted the earlier change that
> : enabled KX on kernel entry from userspace since that is no longer
> : needed.
> :
> : Please let me know your comments.
>
> If I understand correctly, and I'm sure the pedants will tell me
> otherwise, the KX bit means that a legal reference to a kernel address
> is made, it will be interpreted as a 64-bit address when KX is set,
> and a 32-bit address when it is clear.
>
> It does not grant any additional access to the kernel memory that
> isn't already granted by the TLB entries, correct? =A0It doesn't grant
> access to the kernel memory, correct?

My understanding is this, but I was not able to find any reference
that says exactly that (so was not sure if some MIPS implementations
have issues here).

> But I'm a little confused. =A0I'm reading through section 4.5 of the
> Privileged Resources Architecture document from mips
> (MD00091-2B-MIPS74PRA-AFP-02.50.pdf) and table 4-1 suggests that
> running with it in user mode won't change what can be accessed. =A0So
> why would it need to be turned on at all in user mode? =A0Rather than
> the xtlb routine being called for the refill for a kernel address, it
> will fault instead.
>
> Or is this an optimization for the xtlb handler which needs to get to
> pcpu data?

Yes, otherwise I need to add code to the XTLB handler to enable KX
(which will involve read and write to status register and the related
hazards).  Enabling KX everywhere, including userspace avoids this.

JC.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTikfQ2FokHv5khjUkBjOaxVMdcQfYS5xK_U_xUX0>