On 6/3/2014 9:37 PM, Alexey Kardashevskiy wrote: > On 06/04/2014 03:08 AM, Tom Musta wrote: >> On 6/3/2014 4:27 AM, Alexey Kardashevskiy wrote: >>> This makes user-privileged read/write fail if TAR facility is not enabled >>> in FSCR.
[ ...] >>> >> >> There are potential impacts to user mode here. If I am reading correctly, >> TAR would not be accessible >> in user mode. > > > And this is bad why exactly? I definitely need to learn about linux-user > more... > Because TAR and bctar are Book I additions to ISA 2.07 and thus we can expect them to show up in applications. Since FSCR is not user-writeable, if FSCR[TAR] is initially zero, there is no means to enable access. Any application using bctar would not run. > >> An obvious fix would be to initialize FSCR to enable TAR access in the user >> mode build targets. > > > Like that? > > static void gen_spr_power8_fscr(CPUPPCState *env) > { > +#if defined(CONFIG_USER_ONLY) > + target_ulong initval = 1ULL << FSCR_TAR; > +#else > + target_ulong initval = 0; > +#endif > spr_register_kvm(env, SPR_FSCR, "FSCR", > SPR_NOACCESS, SPR_NOACCESS, > &spr_read_generic, &spr_write_generic, > - KVM_REG_PPC_FSCR, 0x00000000); > + KVM_REG_PPC_FSCR, initval); > } > > Yes. I believe that would work.