[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] s390x/migration: use zero flag parameter
From: |
Thomas Huth |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] s390x/migration: use zero flag parameter |
Date: |
Mon, 20 Nov 2017 14:01:29 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
On 20.11.2017 13:35, Christian Borntraeger wrote:
> valgrind pointed out that we call KVM_S390_GET_IRQ_STATE with an
> undefined value for flags. Right now this is unused, but we
> better play safe.
>
> Signed-off-by: Christian Borntraeger <address@hidden>
> ---
> target/s390x/kvm.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c
> index 343fcec..b0439a1 100644
> --- a/target/s390x/kvm.c
> +++ b/target/s390x/kvm.c
> @@ -2069,7 +2069,10 @@ int kvm_s390_set_cpu_state(S390CPU *cpu, uint8_t
> cpu_state)
>
> void kvm_s390_vcpu_interrupt_pre_save(S390CPU *cpu)
> {
> - struct kvm_s390_irq_state irq_state;
> + struct kvm_s390_irq_state irq_state = {
> + .buf = (uint64_t) cpu->irqstate,
> + .len = VCPU_IRQ_BUF_SIZE,
> + };
> CPUState *cs = CPU(cpu);
> int32_t bytes;
>
> @@ -2077,9 +2080,6 @@ void kvm_s390_vcpu_interrupt_pre_save(S390CPU *cpu)
> return;
> }
>
> - irq_state.buf = (uint64_t) cpu->irqstate;
> - irq_state.len = VCPU_IRQ_BUF_SIZE;
> -
> bytes = kvm_vcpu_ioctl(cs, KVM_S390_GET_IRQ_STATE, &irq_state);
> if (bytes < 0) {
> cpu->irqstate_saved_size = 0;
>
Reviewed-by: Thomas Huth <address@hidden>
BTW, should we have a check in the kernel that flags is properly set to
zero?
Thomas