[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 3/5] target-arm: add hvc and smc exception em
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v2 3/5] target-arm: add hvc and smc exception emulation handling infrastructure |
Date: |
Mon, 1 Sep 2014 19:33:19 +0100 |
On 1 September 2014 19:01, Ard Biesheuvel <address@hidden> wrote:
> On 1 September 2014 13:55, Ard Biesheuvel <address@hidden> wrote:
>> @@ -3599,6 +3609,28 @@ void arm_cpu_do_interrupt(CPUState *cs)
>> mask = CPSR_A | CPSR_I | CPSR_F;
>> offset = 4;
>> break;
>> + case EXCP_HVC:
>> + if (arm_cpu_do_hvc(cs)) {
>> + return;
>> + }
>> + qemu_log_mask(LOG_GUEST_ERROR, "HVC not implemented on this CPU\n");
>> + goto hvc_unallocated;
>> + case EXCP_SMC:
>> + if (arm_cpu_do_smc(cs)) {
>> + return;
>> + }
>> + qemu_log_mask(LOG_GUEST_ERROR, "SMC not implemented on this CPU\n");
>> + hvc_unallocated:
>> + /* Treat as unallocated encoding */
>> + new_mode = ARM_CPU_MODE_UND;
>> + addr = 0x04;
>> + mask = CPSR_I;
>> + if (env->thumb) {
>> + offset = 2;
>> + } else {
>> + offset = 4;
>> + }
>> + break;
>
> Replying to self: I guess I forgot to set the correct ESR value here, would
> this
>
> env->cp15.esr_el[1] = syn_uncategorized();
>
> be sufficient?
That's not necessary in the AArch32 do_interrupt code:
AArch32 doesn't have a syndrome register, and the
esr_el[1] holds the AArch32 DFSR value. DFSR isn't
set on UNDEF exceptions, so we should leave esr_el[1]
unchanged.
thanks
-- PMM
- [Qemu-devel] [PATCH v2 0/5] ARM: add PSCI 0.2 support in TCG mode, Ard Biesheuvel, 2014/09/01
- [Qemu-devel] [PATCH v2 1/5] target-arm: add powered off cpu state, Ard Biesheuvel, 2014/09/01
- [Qemu-devel] [PATCH v2 2/5] target-arm: do not set do_interrupt handler for AArch64 user mode, Ard Biesheuvel, 2014/09/01
- [Qemu-devel] [PATCH v2 4/5] target-arm: add emulation of PSCI calls for system emulation, Ard Biesheuvel, 2014/09/01
- [Qemu-devel] [PATCH v2 3/5] target-arm: add hvc and smc exception emulation handling infrastructure, Ard Biesheuvel, 2014/09/01
- [Qemu-devel] [PATCH v2 5/5] arm/virt: enable PSCI emulation support for system emulation, Ard Biesheuvel, 2014/09/01
- Re: [Qemu-devel] [PATCH v2 0/5] ARM: add PSCI 0.2 support in TCG mode, Peter Maydell, 2014/09/01