[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH v2] target/ppc: Allow privileged access to SPR_PCR
From: |
Joel Stanley |
Subject: |
Re: [Qemu-ppc] [PATCH v2] target/ppc: Allow privileged access to SPR_PCR |
Date: |
Mon, 4 Jun 2018 18:06:04 +0930 |
On 4 June 2018 at 17:34, David Gibson <address@hidden> wrote:
> On Thu, May 31, 2018 at 10:34:29PM +0930, Joel Stanley wrote:
>> @@ -98,6 +99,15 @@ void helper_store_ptcr(CPUPPCState *env, target_ulong val)
>> tlb_flush(CPU(cpu));
>> }
>> }
>> +
>> +void helper_store_pcr(CPUPPCState *env, target_ulong value)
>> +{
>> + if (value != 0) {
>> + error_report("Invalid PCR value 0x"TARGET_FMT_lx, value);
>> + return;
>> + }
>
> I don't see a lot of point to this check. For now the only user just
> clears the PCR, but why limit yourself to that explicitly?
As we're not emulating the features of the register when the value is
non-zero, I thought it would make make sense to do something.
I'll drop it in v3.
>
>> + env->spr[SPR_PCR] = value;
>
> You definitely should be masking against pcr_mask too.
Okay. Thanks for the review.
Cheers,
Joel