Received: from eggs.gnu.org ([2001:4830:134:3::10]:38617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eGlj3-0003Tm-Gf for qemu-devel@nongnu.org; Mon, 20 Nov 2017 08:03:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eGlix-0005sf-PQ for qemu-devel@nongnu.org; Mon, 20 Nov 2017 08:03:01 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:55670 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eGlix-0005sV-L5 for qemu-devel@nongnu.org; Mon, 20 Nov 2017 08:02:55 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vAKCxCvX118036 for ; Mon, 20 Nov 2017 08:02:51 -0500 Received: from e06smtp12.uk.ibm.com (e06smtp12.uk.ibm.com [195.75.94.108]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ebwjdqjjr-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 20 Nov 2017 08:02:50 -0500 Received: from localhost by e06smtp12.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 20 Nov 2017 13:02:47 -0000 References: <20171120123525.147663-1-borntraeger@de.ibm.com> <20171120123525.147663-2-borntraeger@de.ibm.com> <3cf122b0-b258-136c-a33d-770ca51638f4@redhat.com> From: Christian Borntraeger Date: Mon, 20 Nov 2017 14:02:42 +0100 MIME-Version: 1.0 In-Reply-To: <3cf122b0-b258-136c-a33d-770ca51638f4@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Message-Id: Subject: Re: [Qemu-devel] [PATCH 1/2] s390x/migration: use zero flag parameter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth , Cornelia Huck Cc: qemu-devel , qemu-s390x , Halil Pasic , Alexander Graf , Richard Henderson , Jens Freimann On 11/20/2017 02:01 PM, Thomas Huth wrote: > 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 >> --- >> 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 > > BTW, should we have a check in the kernel that flags is properly set to > zero? We should have one. Doing that now will break old QEMUs :-/