Re: [Qemu-devel] [PATCH 12/17] target-openrisc: Enable m[tf]spr from user mode

2015-09-15 Thread Bastian Koppelmann
On 09/14/2015 07:11 PM, Richard Henderson wrote: On 09/13/2015 01:34 AM, Bastian Koppelmann wrote: Looking at the article, user mode seems to be optional, so I'm not against it, but it does look weird. How does ork1sim do it? It's haphazard. There are checks for supervisor in the l_mtspr and

Re: [Qemu-devel] [PATCH 12/17] target-openrisc: Enable m[tf]spr from user mode

2015-09-14 Thread Richard Henderson
On 09/13/2015 01:34 AM, Bastian Koppelmann wrote: > Looking at the article, user mode seems to be optional, so I'm not against it, > but it does look weird. How does ork1sim do it? It's haphazard. There are checks for supervisor in the l_mtspr and l_mfspr insns, but not other uses of the sprs, su

Re: [Qemu-devel] [PATCH 12/17] target-openrisc: Enable m[tf]spr from user mode

2015-09-13 Thread Bastian Koppelmann
On 09/06/2015 10:36 PM, Richard Henderson wrote: On Sep 5, 2015 14:35, Bastian Koppelmann wrote: IIRC a lot of the registers are supervisor only, e.g. VR, NPC or SR and the manual is fairly clear about that. User mode cpu ought not to read these registers unconditionally. When I last discuss

Re: [Qemu-devel] [PATCH 12/17] target-openrisc: Enable m[tf]spr from user mode

2015-09-06 Thread Richard Henderson
On Sep 5, 2015 14:35, Bastian Koppelmann wrote: > IIRC a lot of the registers are supervisor only, e.g. VR, NPC or SR and > the manual is fairly clear about that. User mode cpu ought not to read > these registers unconditionally. When I last discussed this on the openrisc list, back in March,

Re: [Qemu-devel] [PATCH 12/17] target-openrisc: Enable m[tf]spr from user mode

2015-09-05 Thread Bastian Koppelmann
On 09/03/2015 02:17 AM, Richard Henderson wrote: -if (dc->mem_idx == MMU_USER_IDX) { -gen_illegal_exception(dc); -return; +{ +TCGv_i32 tmp = tcg_temp_new_i32(); +tcg_gen_trunc_tl_i32(tmp, cpu_R[ra]); +tcg_gen_ori_i32(tmp,

[Qemu-devel] [PATCH 12/17] target-openrisc: Enable m[tf]spr from user mode

2015-09-02 Thread Richard Henderson
The architecture manual doesn't say these opcodes are user only. Leaving them disabled excludes user mode from accessing interesting SPRs like MACLO/MACHI. Signed-off-by: Richard Henderson --- target-openrisc/helper.h | 4 +-- target-openrisc/sys_helper.c | 77 +-