[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 10/14] hvf: refactor cpuid code
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 10/14] hvf: refactor cpuid code |
Date: |
Tue, 29 Aug 2017 10:44:50 +0100 |
User-agent: |
Mutt/1.8.3 (2017-05-23) |
On Sun, Aug 27, 2017 at 08:56:50PM -0500, Sergio Andres Gomez Del Real wrote:
> This commit adds code to request the cpuid features supported by the
> host and hvf; it calls hvf_get_supported_cpuid if hvf is compiled with
> QEMU and enabled.
>
> Signed-off-by: Sergio Andres Gomez Del Real <address@hidden>
> ---
> cpus.c | 2 +
> include/qom/cpu.h | 6 +--
> include/sysemu/hvf.h | 18 ++++++---
> target/i386/cpu-qom.h | 4 +-
> target/i386/cpu.c | 108
> ++++++++++++++++++++++++++++++++++++++++----------
> target/i386/hvf-all.c | 20 +++++-----
> 6 files changed, 113 insertions(+), 45 deletions(-)
>
> diff --git a/cpus.c b/cpus.c
> index 6754ce17cc..2411dfcd3f 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -37,7 +37,9 @@
> #include "sysemu/hw_accel.h"
> #include "sysemu/kvm.h"
> #include "sysemu/hax.h"
> +#ifdef CONFIG_HVF
> #include "sysemu/hvf.h"
> +#endif
Please avoid #ifdefs. They are not necessary for kvm or hax.
> #include "qmp-commands.h"
> #include "exec/exec-all.h"
>
> diff --git a/include/qom/cpu.h b/include/qom/cpu.h
> index c46eb61240..ef74c2ce3c 100644
> --- a/include/qom/cpu.h
> +++ b/include/qom/cpu.h
> @@ -408,13 +408,9 @@ struct CPUState {
> */
> uint16_t pending_tlb_flush;
>
> - // HVF
> bool hvf_vcpu_dirty;
> uint64_t hvf_fd; // fd of vcpu created by HVF
> - // Supporting data structures for VMCS capabilities
> - // and x86 emulation state
> - struct hvf_vcpu_caps* hvf_caps;
> - struct hvf_x86_state* hvf_x86;
> + struct hvf_x86_state *hvf_x86;
Please squash this with the change that adds these fields. Patch series
should avoid "code churn" where code is added and then changed again in
the same patch series. Arrange the patch series in a logical order and
squash down commits using git-rebase -i so new code is introduced in its
final state. This makes review easier and the git commit history
cleaner (i.e. easier to bisect, backport, and use git-blame(1)).
There are more instances of code churn below.
- [Qemu-devel] [PATCH 04/14] hvf: add fields to CPUState and CPUX86State; add definitions, (continued)
- [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
- Re: [Qemu-devel] [PATCH 10/14] hvf: refactor cpuid code,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 14/14] hvf: inject General Protection Fault when vmexit through vmcall, Sergio Andres Gomez Del Real, 2017/08/27
- [Qemu-devel] [PATCH 13/14] hvf: refactor event injection code for hvf, Sergio Andres Gomez Del Real, 2017/08/27
- [Qemu-devel] [PATCH 12/14] hvf: move fields from CPUState to CPUX86State, Sergio Andres Gomez Del Real, 2017/08/27
- [Qemu-devel] [PATCH 02/14] hvf: add code base from Google's QEMU repository, Sergio Andres Gomez Del Real, 2017/08/28
- [Qemu-devel] [PATCH 07/14] hvf: run hvf code through checkpatch.pl and fix style issues, Sergio Andres Gomez Del Real, 2017/08/28
- Re: [Qemu-devel] [PATCH 00/14] add support for Hypervisor.framework in QEMU, no-reply, 2017/08/28
- Re: [Qemu-devel] [PATCH 00/14] add support for Hypervisor.framework in QEMU, Stefan Hajnoczi, 2017/08/29