qemu-devel
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]