On Tue, May 13, 2014 at 2:06 PM, Jonas Bonn <[email protected]> wrote: > On 05/13/2014 12:51 PM, Stefan Kristiansson wrote: >> On Tue, May 13, 2014 at 1:46 PM, Jonas Bonn <[email protected]> wrote: >>> On 05/13/2014 12:17 PM, Stefan Kristiansson wrote: >>>> On Tue, May 13, 2014 at 9:09 AM, Stefan Kristiansson >>>> <[email protected]> wrote: >>> >>>> So, a piece of software that is only interested in 1) (i.e. Linux in >>>> this case) is completely free to omit 2) and read/write the additional >>>> GPR file with the l.mfspr and l.mtspr instructions. >>> >>> Which SPR's are that? As far as I recall, there's no way to access >>> other contexts' registers... and adding such a functionality is probably >>> against the spirit of this functionality. >>> >> >> /me thinks you recall wrong then ;) >> >> "6.4.3 Accessing Other Contexts’ Registers >> This operation can be done only in supervisor mode. In the basic >> instruction set we >> have the l.mtspr and l.mfspr instructions that are used to access >> shadowed registers." >> >> The GPR0-GPR511 SPR space addresses are: group 0, register 1024-1535. > > Aha... OK. I don't remember this at all. > > Is this a recent addition to the spec? >
Hmm, not sure. I can't remember any discussions about it so i assumed it always been there, but perhaps it's a recent one. > If you're going to implement two register files, then you might as well > use them fully. Linux could happily use a second register file for > running exceptions and it would save a bunch of register copying. > Ok, fair enough. The only reservation I have against implementing it fully in hardware, is that you are then forced to involve the SR[CID] connection back into not only the register file, but also into the MMU. (This is the heavy weightiness I've been speaking about earlier). Otoh, there might be interest in the CID stuff for the MMU as well... > The problem is rather the way FCS is spec'ed: > > i) We _do_ need to access user-context regs from exception-context > (apparently this is possible now...) > > ii) Nested exceptions really don't want to switch to a new register > file.. you really only want to switch between user-context regs and > supervisor context regs. > > I don't know if that's in the scope of FCS... I think that should be possible to achieve by turning off the CE bit on userspace->kernel transition and turn it back on on kernel->userspace transition Stefan _______________________________________________ OpenRISC mailing list [email protected] http://lists.openrisc.net/listinfo/openrisc
