qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 21/29] target-ppc: Enable FSCR facility check


From: Tom Musta
Subject: Re: [Qemu-devel] [PATCH v4 21/29] target-ppc: Enable FSCR facility check for TAR
Date: Wed, 04 Jun 2014 07:25:51 -0500
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]