[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 03/14] hvf: add conditional macros around hvf co
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 03/14] hvf: add conditional macros around hvf code in cpus.c |
Date: |
Tue, 29 Aug 2017 10:19:13 +0100 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
On Sun, Aug 27, 2017 at 08:56:43PM -0500, Sergio Andres Gomez Del Real wrote:
> @@ -900,6 +904,11 @@ void cpu_synchronize_all_states(void)
>
> CPU_FOREACH(cpu) {
> cpu_synchronize_state(cpu);
> +#ifdef CONFIG_HVF
> + if (hvf_enabled()) {
> + hvf_cpu_synchronize_state(cpu);
> + }
> +#endif
Searching for CONFIG_KVM and CONFIG_HAX in cpus.c produces no results.
How do they solve the same problem without using #ifdef? They define
nop stubs in "system/$ACCEL.h" so that cpus.c does not need #ifdefs.
Please follow the same approach for hvf. Using stubs avoids "bitrot"
because the cpus.c kvm/hax code is always compiled, even when the
feature is disabled. This way no compiler errors/warnings can hide in
the #ifdef regions that aren't compiled by most people.
Please avoid #ifdef whereever possible.
- [Qemu-devel] [PATCH 00/14] add support for Hypervisor.framework in QEMU, Sergio Andres Gomez Del Real, 2017/08/27
- [Qemu-devel] [PATCH 01/14] hvf: add support for Hypervisor.framework in the configure script, Sergio Andres Gomez Del Real, 2017/08/27
- [Qemu-devel] [PATCH 03/14] hvf: add conditional macros around hvf code in cpus.c, Sergio Andres Gomez Del Real, 2017/08/27
- Re: [Qemu-devel] [PATCH 03/14] hvf: add conditional macros around hvf code in cpus.c,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 04/14] hvf: add fields to CPUState and CPUX86State; add definitions, Sergio Andres Gomez Del Real, 2017/08/27
- [Qemu-devel] [PATCH 06/14] hvf: add compilation rules to Makefile.objs, Sergio Andres Gomez Del Real, 2017/08/27
- [Qemu-devel] [PATCH 05/14] hvf: use new helper functions for put/get xsave, Sergio Andres Gomez Del Real, 2017/08/27
- [Qemu-devel] [PATCH 08/14] apic: add function to apic that will be used by hvf, Sergio Andres Gomez Del Real, 2017/08/27
- [Qemu-devel] [PATCH 09/14] hvf: implement hvf_get_supported_cpuid, Sergio Andres Gomez Del Real, 2017/08/27
- [Qemu-devel] [PATCH 11/14] hvf: implement vga dirty page tracking, Sergio Andres Gomez Del Real, 2017/08/27
- [Qemu-devel] [PATCH 10/14] hvf: refactor cpuid code, Sergio Andres Gomez Del Real, 2017/08/27