[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.
- Re: [Qemu-devel] [PATCH v4 18/29] target-ppc: Refactor class init for POWER7/8, (continued)
- [Qemu-devel] [PATCH v4 20/29] target-ppc: Add POWER8's FSCR SPR, Alexey Kardashevskiy, 2014/06/03
- [Qemu-devel] [PATCH v4 13/29] target-ppc: Move POWER8 TCE Address control (TAR) to a helper, Alexey Kardashevskiy, 2014/06/03
- [Qemu-devel] [PATCH v4 24/29] KVM: target-ppc: Enable TM state migration, Alexey Kardashevskiy, 2014/06/03
- [Qemu-devel] [PATCH v4 09/29] target-ppc: Introduce and reuse generalized init_proc_book3s_64(), Alexey Kardashevskiy, 2014/06/03
- [Qemu-devel] [PATCH v4 21/29] target-ppc: Enable FSCR facility check for TAR, Alexey Kardashevskiy, 2014/06/03
- [Qemu-devel] [PATCH v4 27/29] target-ppc: Enable DABRX SPR and limit it to <=POWER7, Alexey Kardashevskiy, 2014/06/03
- [Qemu-devel] [PATCH v4 23/29] target-ppc: Add POWER8's TM SPRs, Alexey Kardashevskiy, 2014/06/03
[Qemu-devel] [PATCH v4 29/29] spapr_hcall: Add address-translation-mode-on-interrupt resource in H_SET_MODE, Alexey Kardashevskiy, 2014/06/03