qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-2.5 2/2] target-arm: Report S/NS status in t


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH for-2.5 2/2] target-arm: Report S/NS status in the CPU debug logs
Date: Thu, 29 Oct 2015 15:21:54 +0000

On 29 October 2015 at 15:15, Alex Bennée <address@hidden> wrote:
>
> Peter Maydell <address@hidden> writes:
>
>> If this CPU supports EL3, enhance the printing of the current
>> CPU mode in debug logging to distinguish S from NS modes as
>> appropriate.
>>
>> Signed-off-by: Peter Maydell <address@hidden>
>> ---
>>  target-arm/translate-a64.c | 11 ++++++++++-
>>  target-arm/translate.c     | 12 +++++++++++-
>>  2 files changed, 21 insertions(+), 2 deletions(-)
>>
>> diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c
>> index ccefa7b..8ebdcb7 100644
>> --- a/target-arm/translate-a64.c
>> +++ b/target-arm/translate-a64.c
>> @@ -127,6 +127,7 @@ void aarch64_cpu_dump_state(CPUState *cs, FILE *f,
>>      uint32_t psr = pstate_read(env);
>>      int i;
>>      int el = arm_current_el(env);
>> +    const char *ns_status;
>>
>>      cpu_fprintf(f, "PC=%016"PRIx64"  SP=%016"PRIx64"\n",
>>              env->pc, env->xregs[31]);
>> @@ -138,12 +139,20 @@ void aarch64_cpu_dump_state(CPUState *cs, FILE *f,
>>              cpu_fprintf(f, " ");
>>          }
>>      }
>> -    cpu_fprintf(f, "\nPSTATE=%08x %c%c%c%c EL%d%c\n",
>> +
>> +    if (arm_feature(env, ARM_FEATURE_EL3) && el != 3) {
>> +        ns_status = env->cp15.scr_el3 & SCR_NS ? "NS " : "S ";
>> +    } else {
>> +        ns_status = "";
>> +    }
>
> Looks fine to me. I might of gone for a default:
>
> const char *ns_status = "legacy";
> ...
>     if (arm_feature(env, ARM_FEATURE_EL3) && el != 3) {
>         ns_status = env->cp15.scr_el3 & SCR_NS ? "NS " : "S ";
>     }

We don't want to print "legacy", as that is just confusing
for CPUs which don't have TrustZone. "" is the right
value there.

thanks
-- PMM



reply via email to

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