qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [qemu-s390x] [PATCH v3 2/9] s390x/tcg: factor out and f


From: David Hildenbrand
Subject: Re: [Qemu-devel] [qemu-s390x] [PATCH v3 2/9] s390x/tcg: factor out and fix DATA exception injection
Date: Thu, 27 Sep 2018 14:16:19 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

On 26/09/2018 13:37, Thomas Huth wrote:
> On 2018-09-17 11:34, David Hildenbrand wrote:
>> The DXC is to be stored in the low core, and only in the FPC in case AFP
>> is enabled in CR0. Stub is not required in current code, but this way
>> we never run into problems.
>>
>> Reviewed-by: Richard Henderson <address@hidden>
>> Signed-off-by: David Hildenbrand <address@hidden>
>> ---
>>  target/s390x/cpu.h         |  1 +
>>  target/s390x/excp_helper.c | 23 +++++++++++++++++++++++
>>  target/s390x/fpu_helper.c  | 13 +++----------
>>  target/s390x/helper.h      |  1 +
>>  target/s390x/tcg-stub.c    |  5 +++++
>>  target/s390x/tcg_s390x.h   |  2 ++
>>  target/s390x/translate.c   | 19 +++++++++----------
>>  7 files changed, 44 insertions(+), 20 deletions(-)
>>
>> diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h
>> index 6f8861e554..5e50c3a303 100644
>> --- a/target/s390x/cpu.h
>> +++ b/target/s390x/cpu.h
>> @@ -322,6 +322,7 @@ extern const struct VMStateDescription vmstate_s390_cpu;
>>  #define CR0_LOWPROT             0x0000000010000000ULL
>>  #define CR0_SECONDARY           0x0000000004000000ULL
>>  #define CR0_EDAT                0x0000000000800000ULL
>> +#define CR0_AFP                 0x0000000000040000ULL
>>  #define CR0_EMERGENCY_SIGNAL_SC 0x0000000000004000ULL
>>  #define CR0_EXTERNAL_CALL_SC    0x0000000000002000ULL
>>  #define CR0_CKC_SC              0x0000000000000800ULL
>> diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c
>> index 5dab3387c3..2b23105f41 100644
>> --- a/target/s390x/excp_helper.c
>> +++ b/target/s390x/excp_helper.c
>> @@ -21,6 +21,7 @@
>>  #include "qemu/osdep.h"
>>  #include "cpu.h"
>>  #include "internal.h"
>> +#include "exec/helper-proto.h"
>>  #include "qemu/timer.h"
>>  #include "exec/exec-all.h"
>>  #include "exec/cpu_ldst.h"
>> @@ -61,6 +62,28 @@ void QEMU_NORETURN 
>> tcg_s390_program_interrupt(CPUS390XState *env, uint32_t code,
>>      cpu_loop_exit(cs);
>>  }
>>  
>> +void QEMU_NORETURN tcg_s390_data_exception(CPUS390XState *env, uint32_t dxc,
>> +                                           uintptr_t ra)
>> +{
>> +    g_assert(!(dxc & ~0xff));
> 
> I'd maybe rather use g_assert(dxc <= 0xff) instead (that's easier to read).
> 
>> +#if !defined(CONFIG_USER_ONLY)
>> +    /* Store the DXC into the lowcore */
>> +    stl_phys(CPU(s390_env_get_cpu(env))->as,
>> +             env->psa + offsetof(LowCore, data_exc_code), dxc);
>> +#endif
>> +
>> +    /* Store the DXC into the FPC if AFP is enabled */
>> +    if (env->cregs[0] & CR0_AFP) {
>> +        env->fpc = (env->fpc & ~0xff00) | (dxc << 8);
> You could use deposit32() here instead.
> 
>> +    }
>> +    tcg_s390_program_interrupt(env, PGM_DATA, ILEN_AUTO, ra);
>> +}
> [...]
> 
> Just nits ... patch looks also fine to me as it is:
> 

Both comments made perfect sense, thanks!


> Reviewed-by: Thomas Huth <address@hidden>
> 


-- 

Thanks,

David / dhildenb



reply via email to

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