qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 11/13] hvf: move fields from CPUState to CPUX


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v2 11/13] hvf: move fields from CPUState to CPUX86State
Date: Thu, 31 Aug 2017 10:18:17 +0100
User-agent: Mutt/1.8.3 (2017-05-23)

On Wed, Aug 30, 2017 at 03:27:00AM -0500, Sergio Andres Gomez Del Real wrote:
> @@ -1187,11 +1190,15 @@ typedef struct CPUX86State {
>      int32_t interrupt_injected;
>      uint8_t soft_interrupt;
>      uint8_t has_error_code;
> +    uint32_t ins_len;

This field seems unused in this patch?

> @@ -678,15 +687,15 @@ int hvf_init_vcpu(CPUState *cpu)
>      sigdelset(&set, SIG_IPI);
>  
>      int r;
> -    init_emu(cpu);
> -    init_decoder(cpu);
> +    init_emu();
> +    init_decoder();
>      init_cpuid(cpu);
>  
>      hvf_state->hvf_caps = (struct hvf_vcpu_caps *)g_malloc0(sizeof(struct 
> hvf_vcpu_caps));
> -    cpu->hvf_x86 = (struct hvf_x86_state *)g_malloc0(sizeof(struct 
> hvf_x86_state));
> +    env->hvf_emul = (HVFX86EmulatorState 
> *)g_malloc0(sizeof(HVFX86EmulatorState));

Please use g_new0().  The cast isn't necessary because the C compiler
casts void * to any other pointer type without a warning:

  env->hvf_emul = g_new0(HVFX86EmulatorState, 1);

>  
>      r = hv_vcpu_create((hv_vcpuid_t *)&cpu->hvf_fd, HV_VCPU_DEFAULT);
> -    cpu->hvf_vcpu_dirty = 1;
> +    cpu->vcpu_dirty = 1;

cpu->vcpu_dirty is bool.  Please use true/false consistently instead of
1/0.

> @@ -356,13 +356,14 @@ typedef struct x68_segment_selector {
>      };
>  } __attribute__ ((__packed__)) x68_segment_selector;
>  
> -/* Definition of hvf_x86_state is here */
> -struct hvf_x86_state {
> -    int hlt;
> -    uint64_t init_tsc;
> +typedef struct lazy_flags {
> +    addr_t result;
> +    addr_t auxbits;
> +} lazy_flags;
>  
> +/* Definition of hvf_x86_state is here */

hvf_x86_state no longer exists.  This comment is outdated now?



reply via email to

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