From patchwork Wed Sep 6 05:26:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijaya Kumar K X-Patchwork-Id: 9939933 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8955E60224 for ; Wed, 6 Sep 2017 05:27:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B2D528ABA for ; Wed, 6 Sep 2017 05:27:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FF5028ABC; Wed, 6 Sep 2017 05:27:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F2D5128ABA for ; Wed, 6 Sep 2017 05:27:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=JmWQYOUu+OSiZLUfSg+vVP08fl66/Ab5HhuYQoNlgEw=; b=NQs XyXOs1mg+UR/Flacy/JobaJuce4moiM5ldjYoY2F1kiyumGJTYKb4/S8o2JoWTuQr2sQKP8G4M0vz xPeypEFmEesmYHYBUqMMaBnCmRtlVikWRIpdFw3z+Wj/wFEgobNmft+m13HNI9XHO1ZxfLk8B/lZX pvzQZlTZu9N1aOGkpwoic49D4bTyd8suvFTe5GQubkRLs4QGmC6SaTJxKgo8cYwlGzMwx55m7nSjm JTr/3xwDog5cp3zV4Bgl54D6esC/rIk+NplVr0hlQKzgG+ij6xEjVEq8uIoUM8UZEr5BPDgUeEYOq DtcO9KjuDTI3vp4tiLFMdgTK2igtYPQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dpSrw-0002Tw-8B; Wed, 06 Sep 2017 05:27:20 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dpSrj-0002PH-D5 for linux-arm-kernel@lists.infradead.org; Wed, 06 Sep 2017 05:27:09 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 30DDA60241; Wed, 6 Sep 2017 05:26:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1504675606; bh=GEQjbH1Fbcc1JOxXlO/CnII8PVIhkcFpZ5CWCTD59Jk=; h=From:To:Cc:Subject:Date:From; b=Aij8Yej4rkckn4EHSwNyryEnxM8Tvx9EQDqrXwn8iY6LKcw+bKjuNQg0bA37nCgIa lv0X7UV4mj1ZwD2Xv5WR6Jxl45iBb6WLfBJpwINMNluZoaIfEWM9uGxaJnWpCoWJgr XTR1XOURS4vTZZwzf6BWHOHf5XVZR65tixuQyBZE= Received: from blr-ubuntu-126.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: vkilari@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id A3B7E60241; Wed, 6 Sep 2017 05:26:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1504675605; bh=GEQjbH1Fbcc1JOxXlO/CnII8PVIhkcFpZ5CWCTD59Jk=; h=From:To:Cc:Subject:Date:From; b=OoIiZrrbIk8s9AvBCiH6JDd3zDbA3xY7b2QoOGxWj3WaPoo9f5ef0Z3H8t7OtPiTb BXfJ9hZq6wv6nnFdyY1eoifXjOTVrZyZ8La4iYve8qr2dKvxaxJVmkSiaB0+3Pj/2W F5rjSAxB6IoHE6msFKzqfZ4epyLC0/vidPCULqt4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org A3B7E60241 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=vkilari@codeaurora.org From: Vijaya Kumar K To: kvmarm@lists.cs.columbia.edu, eric.auger@redhat.com, marc.zyngier@arm.com, cdall@linaro.org, andre.przywara@arm.com Subject: [PATCH] KVM: arm64: vgic-its: Fix wrong return value check in vgic_its_restore_device_tables Date: Wed, 6 Sep 2017 10:56:05 +0530 Message-Id: <1504675565-13641-1-git-send-email-vkilari@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170905_222707_519658_B279ECB6 X-CRM114-Status: UNSURE ( 8.97 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: vvenkat@codeaurora.org, Vijaya Kumar K , shankerd@codeaurora.org, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP scan_its_table() return 1 on success. In the function vgic_its_restore_device_tables() the return value of scan_its_table() is checked against success value and returns -EINVAL. Hence migration fails for VM with ITS. With this patch the failure return value is checked while returning -EINVAL. Signed-off-by: Vijaya Kumar K diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c index aa6b68d..63f8ac3 100644 --- a/virt/kvm/arm/vgic/vgic-its.c +++ b/virt/kvm/arm/vgic/vgic-its.c @@ -2142,7 +2142,7 @@ static int vgic_its_restore_device_tables(struct vgic_its *its) vgic_its_restore_dte, NULL); } - if (ret > 0) + if (ret <= 0) ret = -EINVAL; return ret;