Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3812099pxv; Mon, 28 Jun 2021 13:33:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwczlm8NcGCDDp9FzbxpzNm/5UwdgBgbh5mpyqftaSBgks68zz+NVOj+wU8khhJYITig0Zj X-Received: by 2002:a05:6602:2043:: with SMTP id z3mr1040655iod.74.1624912385053; Mon, 28 Jun 2021 13:33:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624912385; cv=none; d=google.com; s=arc-20160816; b=Kj6rt/dN/pIrSnp+noyPHS95sPWD6m/IAFHnWYpDfwwuq2fJMkE5IcwHq/Jn3xf6W/ /opvHflzKen6KqNCNy/cc8w8UbG6/5iDda6unQUjXDJ5MXTVT37ARsgfZf6Lcn/6JQMv IFEND6D+YscgJsYHwqiOC4r/5YKxPTL174iu3pGnPw3hNYxOECRPOyS6zkxD1EP37blb idz/IvNKRvMhZCtcVS0SXLbXhyy2N5JjXfWrIog8FdqzZaBGsAUMCoO5zC5CUC2Tt+b9 XMuOmpzOb1KSjSZKBRBywbzmLHQ08TJWAdFMclHy6Hfq134dkyVwHh3CDg7VDncoFQ0d NJIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nEi4xIqqXX5PvLFUlFJOXfpiOcuQ1VO0rdjjdwXPhwA=; b=xniFnsDIs8rnEs8GHAbfnx9tn7L58NWgnqL5evEUJq59RZy1d4sKdbUHcMQgKZ8n9n lvfkvJjDr+/9vAERx7E7voOT5ckjvas1ECr6mA1v2ixGOSvMp1yD0p29rZz4okpYOLmt eS5WBelZ10HcH14EfpwWX0xhIi55TMYCWsdK0uX6YiNMi7WP3aoRJWUlHJxYI6MRe7Vb uARZIpE6vloFr1ow29rUw5IfA/E2baSAXvkUZcEbY7NRNIaEkuvYpziE/eWBPjiYKDkD OhS3SkfvPuGUukb2v2qFRSJA6fncVpm7oMzEd3/+aW7dVnWojh+/iPxugomUQY/Hayub hi1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DxJfjVvL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c9si17988138iom.40.2021.06.28.13.32.49; Mon, 28 Jun 2021 13:33:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DxJfjVvL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237324AbhF1PFl (ORCPT + 99 others); Mon, 28 Jun 2021 11:05:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:51374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236159AbhF1OqV (ORCPT ); Mon, 28 Jun 2021 10:46:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EE1EF61D18; Mon, 28 Jun 2021 14:34:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1624890876; bh=x/cTnFU7FnW/u2FVYFVcEmyJ6UDVKNwCF9ortI7Ugek=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DxJfjVvL8KpMQvyFMTxdNZHBMiFskndmpNz8fWXVEbLvCFv/Sd7iHHmD/9qCENUpH PfvkKn1Fc5rJID+NO1/k/KRyhysnHYY6j4pNxmRyyw8lShLyKzgvWUGgY87p9h9rp1 3dXYaDkzFHbN1xRsH7cv82XpOJeFF0UCVxV2jIvn1exCEsUD7gPqTFBwVl3i2hKYOS HvAwxVVSooUepLswYq0X7ginv7Wu9173TUV2hfpvqjVYJqUs/DC4HW0rmyu0AALoLN ADDnae0d9bc5gxtxyGBBn/lHad8O0QTORe3AfbgPXyZ5S1vPUFSIAnMfZ9darUl78q b/AePXwhTDNuA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Fuad Tabba , Paolo Bonzini , Sasha Levin Subject: [PATCH 4.19 102/109] KVM: selftests: Fix kvm_check_cap() assertion Date: Mon, 28 Jun 2021 10:32:58 -0400 Message-Id: <20210628143305.32978-103-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210628143305.32978-1-sashal@kernel.org> References: <20210628143305.32978-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.19.196-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-4.19.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 4.19.196-rc1 X-KernelTest-Deadline: 2021-06-30T14:32+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Fuad Tabba [ Upstream commit d8ac05ea13d789d5491a5920d70a05659015441d ] KVM_CHECK_EXTENSION ioctl can return any negative value on error, and not necessarily -1. Change the assertion to reflect that. Signed-off-by: Fuad Tabba Message-Id: <20210615150443.1183365-1-tabba@google.com> Signed-off-by: Paolo Bonzini Signed-off-by: Sasha Levin --- tools/testing/selftests/kvm/lib/kvm_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c index fb5d2d1e0c04..b138fd5e4620 100644 --- a/tools/testing/selftests/kvm/lib/kvm_util.c +++ b/tools/testing/selftests/kvm/lib/kvm_util.c @@ -55,7 +55,7 @@ int kvm_check_cap(long cap) exit(KSFT_SKIP); ret = ioctl(kvm_fd, KVM_CHECK_EXTENSION, cap); - TEST_ASSERT(ret != -1, "KVM_CHECK_EXTENSION IOCTL failed,\n" + TEST_ASSERT(ret >= 0, "KVM_CHECK_EXTENSION IOCTL failed,\n" " rc: %i errno: %i", ret, errno); close(kvm_fd); -- 2.30.2