[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/7] target-arm: use correct do_interrupt handle
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 1/7] target-arm: use correct do_interrupt handler for AArch64 user mode |
Date: |
Mon, 5 May 2014 17:15:02 +0100 |
On 5 May 2014 17:00, Rob Herring <address@hidden> wrote:
> From: Rob Herring <address@hidden>
>
> User mode emulation should never get interrupts and thus should not
> use the system emulation exception handler function.
This is true, but arm_cpu_do_interrupt() is also a system
emulation exception handler function, so it's no better.
I assume we're doing this because we're about to add
code to aarch64_cpu_do_interrupt() which doesn't compile
in user mode, though you don't mention this in the commit
message.
> @@ -187,7 +187,11 @@ static void aarch64_cpu_class_init(ObjectClass *oc, void
> *data)
> {
> CPUClass *cc = CPU_CLASS(oc);
>
> +#if defined(CONFIG_USER_ONLY)
> + cc->do_interrupt = arm_cpu_do_interrupt;
> +#else
> cc->do_interrupt = aarch64_cpu_do_interrupt;
> +#endif
I think you can simply only do the assignment ifndef
CONFIG_USER_ONLY (which will leave the pointer NULL
for user-mode) -- it will never be called (and if it does
it'll be easier to find the bug if it's a segfault than if it
tries to execute the 32 bit system mode interrupt code...)
thanks
-- PMM