[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 10/14] cpus: add handle_interrupt to the CpusAccel interfa
From: |
Richard Henderson |
Subject: |
Re: [PATCH v5 10/14] cpus: add handle_interrupt to the CpusAccel interface |
Date: |
Fri, 14 Aug 2020 14:01:01 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 8/12/20 11:32 AM, Claudio Fontana wrote:
> +static void generic_handle_interrupt(CPUState *cpu, int mask)
> +{
> + cpu->interrupt_request |= mask;
> +
> + if (!qemu_cpu_is_self(cpu)) {
> + qemu_cpu_kick(cpu);
> + }
> +}
> +
> +void cpu_interrupt(CPUState *cpu, int mask)
> +{
> + if (cpus_accel && cpus_accel->handle_interrupt) {
> + cpus_accel->handle_interrupt(cpu, mask);
> + } else {
> + generic_handle_interrupt(cpu, mask);
> + }
> +}
First, by this point you have converted all of the accelerators, so I would
expect cpus_accel to always be non-null. I would expect a patch immediately
preceding this one to place an assert to that effect somewhere in the startup
code, and to remove all of the checks.
Second, I would prefer that all methods be non-null, so that you don't need to
check that either. This patch would add generic_handle_interrupt (perhaps
named cpus_accel_default_handle_interrupt declared in sysemu/cpus.h?) to the
CpusAccel structure of all except TCG.
Similarly for all other methods that are checking non-null-ness of the method
pointer. Perhaps assert non-null for each method in cpus_register_accel().
r~
- Re: [PATCH v5 07/14] cpus: extract out whpx-specific code to target/i386/, (continued)
- [PATCH v5 08/14] cpus: extract out hvf-specific code to target/i386/hvf/, Claudio Fontana, 2020/08/12
- [PATCH v5 05/14] cpus: extract out kvm-specific code to accel/kvm, Claudio Fontana, 2020/08/12
- [PATCH v5 12/14] whpx: remove whpx specific functions from global includes, Claudio Fontana, 2020/08/12
- [PATCH v5 14/14] kvm: remove kvm specific functions from global includes, Claudio Fontana, 2020/08/12
- [PATCH v5 10/14] cpus: add handle_interrupt to the CpusAccel interface, Claudio Fontana, 2020/08/12
- Re: [PATCH v5 10/14] cpus: add handle_interrupt to the CpusAccel interface,
Richard Henderson <=
- [PATCH v5 13/14] hax: remove hax specific functions from global includes, Claudio Fontana, 2020/08/12
- Re: [PATCH v5 00/14] QEMU cpus.c refactoring part2, no-reply, 2020/08/13