[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 3/3] WHPX: fix some compiler warnings
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v2 3/3] WHPX: fix some compiler warnings |
Date: |
Wed, 16 May 2018 12:13:08 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
On 15/05/2018 19:35, address@hidden wrote:
> From: Lucian Petrut <address@hidden>
>
> This patch fixes a few compiler warnings, especially in case of
> x86 targets, where the number of registers was not properly handled
> and could cause an overflow.
>
> Signed-off-by: Alessandro Pilotti <address@hidden>
> Signed-off-by: Justin Terry (VM) <address@hidden>
> Signed-off-by: Lucian Petrut <address@hidden>
> ---
> target/i386/whpx-all.c | 49 +++++++++++++++++++++++++++++++++++--------------
> 1 file changed, 35 insertions(+), 14 deletions(-)
>
> diff --git a/target/i386/whpx-all.c b/target/i386/whpx-all.c
> index 0a29d56..2fd3397 100644
> --- a/target/i386/whpx-all.c
> +++ b/target/i386/whpx-all.c
> @@ -226,24 +226,31 @@ static void whpx_set_registers(CPUState *cpu)
> struct whpx_vcpu *vcpu = get_whpx_vcpu(cpu);
> struct CPUX86State *env = (CPUArchState *)(cpu->env_ptr);
> X86CPU *x86_cpu = X86_CPU(cpu);
> - struct whpx_register_set vcxt = {0};
> + struct whpx_register_set vcxt;
> HRESULT hr;
> - int idx = 0;
> + int idx;
> + int idx_next;
> int i;
> int v86, r86;
>
> assert(cpu_is_stopped(cpu) || qemu_cpu_is_self(cpu));
>
> + memset(&vcxt, 0, sizeof(struct whpx_register_set));
This change does not seem like an improvement, can you send a patch with
the bugfix only?
Thanks,
Paolo