From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C864C4338F for ; Thu, 29 Jul 2021 16:30:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4AF4F60EC0 for ; Thu, 29 Jul 2021 16:30:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4AF4F60EC0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eeS3WOoXn+Tq3ABGrLuCC4PwKY4UEo5IxX3XMDnw2Vc=; b=L9NEmmfk9f5uvy nNpd4C7+J0Bu8SeJADcm6kLPfeLdcjBQ2pgVyUhhw5mi1rZEW+G2DkcQmabnl3UgTzVJKd1BsVg4Y xjttg4cZC7P5L+y3g5sB8EFufNlbJgMp9+xD2fufIGknXuwr029MpgB4flYhTjzdm1JFC9UjugfeC 5Sb19VunRwAbyhNHZt8khDhiJ6iOYIZk+QT6h0k5FOkeU8SmnHtrPqEOiJ5lxr1TVwsfbrGwDw7h4 t8uYvyyzwzh+d0XHMLD0lIPn4reDrPy1Kji3lSsM2v2BL/8OFD8v5G9eE/RmCi22wwS7aYoP/K66w KXbx3+0v6wMeG/R3fbOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m98u5-0055YC-V8; Thu, 29 Jul 2021 16:29:02 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m98u2-0055XF-EL for linux-arm-kernel@lists.infradead.org; Thu, 29 Jul 2021 16:29:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627576135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8XlvRujXH8fG7I60x6Lze35EmuQmao4vXlcoc/uU2No=; b=TAo0ySae52r+DMX6JyohJfKpQ1F6z8KojbLGeKzEC71Zl71+42hQ9hDR19oYGQKCVZoYRH 6TJClubrt8/0U//lG+slPmfcPtFSFWb3wiA4ecO8eFKmjPycEpYdPgKcrpYbOt0f57gLg+ KVBT5wtOOIApzQjwnJQ4dCaF3hRgBxs= Received: from mail-io1-f72.google.com (mail-io1-f72.google.com [209.85.166.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-361-DFUgNu4iMNSr4SJapH1Irw-1; Thu, 29 Jul 2021 12:22:30 -0400 X-MC-Unique: DFUgNu4iMNSr4SJapH1Irw-1 Received: by mail-io1-f72.google.com with SMTP id u22-20020a5d9f560000b02905058dc6c376so4145041iot.6 for ; Thu, 29 Jul 2021 09:22:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=8XlvRujXH8fG7I60x6Lze35EmuQmao4vXlcoc/uU2No=; b=gWpZM7PK0vuE9ha7Gx15/H2WG4NvMzX8hIIBV8ITKOAcG6AKbbYOes+AA4zRqD/XQW qCWbQOi1HPE6uwolQiGQrYCDRc0jKYyN+T50Ct4esysnaF8hhZfC5EIbt8gn6NLcreTK P1vcUXFK573q2sW0zuMew1W9ZBbuYQWKVitIgg2S9eua99MjazBy4BVHd3Fnh+iqKmWv Gl3qYt5fuVeT2Q+pKQQCWEWVfPpnS/W85XclmKYVqh3elAKslkHPFGO1bTSOZaRWh50n VvyazxgPzoWZLSumPFJLQGbLvJ4mirhPXQ6ZY3Twh1wk+WAM9uKU/Wgn3rl+LatzEw33 qDzw== X-Gm-Message-State: AOAM530m56z1t7W+A0ETfbo5vcoLz5X+ob9JnG0O+qqRUinP9wV+GkE8 A13+T8abGvBAmNzco5C62J5/NLRGoJz7R1gNncXrV/L49Dsi8jpeoO0t4mcawOal23AxuDWsNNT yZB+63hvP5GryyZduMZUNqv+ZhXclNjTOZFA= X-Received: by 2002:a92:d4c4:: with SMTP id o4mr4032646ilm.39.1627575749931; Thu, 29 Jul 2021 09:22:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4Fgu9rQ1o/mvPKtWpoTLqejJyf90dyQNVh+Lg+zjo1jBFHEmgfOa/z3eVTuadhwo9KRb6mQ== X-Received: by 2002:a92:d4c4:: with SMTP id o4mr4032632ilm.39.1627575749732; Thu, 29 Jul 2021 09:22:29 -0700 (PDT) Received: from gator ([140.82.166.162]) by smtp.gmail.com with ESMTPSA id p1sm1929221ilh.47.2021.07.29.09.22.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 09:22:29 -0700 (PDT) Date: Thu, 29 Jul 2021 18:22:26 +0200 From: Andrew Jones To: Oliver Upton Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, Paolo Bonzini , Sean Christopherson , Marc Zyngier , Peter Shier , Jim Mattson , David Matlack , Ricardo Koller , Jing Zhang , Raghavendra Rao Anata , James Morse , Alexandru Elisei , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v4 06/13] selftests: KVM: Fix kvm device helper ioctl assertions Message-ID: <20210729162226.a6csfjpzhhpdgv7o@gator> References: <20210729001012.70394-1-oupton@google.com> <20210729001012.70394-7-oupton@google.com> MIME-Version: 1.0 In-Reply-To: <20210729001012.70394-7-oupton@google.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=drjones@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210729_092858_604601_045DB287 X-CRM114-Status: GOOD ( 18.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jul 29, 2021 at 12:10:05AM +0000, Oliver Upton wrote: > The KVM_CREATE_DEVICE and KVM_{GET,SET}_DEVICE_ATTR ioctls are defined > to return a value of zero on success. As such, tighten the assertions in > the helper functions to only pass if the return code is zero. > > Suggested-by: Andrew Jones > Signed-off-by: Oliver Upton > --- > tools/testing/selftests/kvm/lib/kvm_util.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c > index 10a8ed691c66..0ffc2d39c80d 100644 > --- a/tools/testing/selftests/kvm/lib/kvm_util.c > +++ b/tools/testing/selftests/kvm/lib/kvm_util.c > @@ -1984,7 +1984,7 @@ int kvm_device_check_attr(int dev_fd, uint32_t group, uint64_t attr) > { > int ret = _kvm_device_check_attr(dev_fd, group, attr); > > - TEST_ASSERT(ret >= 0, "KVM_HAS_DEVICE_ATTR failed, rc: %i errno: %i", ret, errno); > + TEST_ASSERT(!ret, "KVM_HAS_DEVICE_ATTR failed, rc: %i errno: %i", ret, errno); > return ret; > } > > @@ -2008,7 +2008,7 @@ int kvm_create_device(struct kvm_vm *vm, uint64_t type, bool test) > ret = _kvm_create_device(vm, type, test, &fd); > > if (!test) { > - TEST_ASSERT(ret >= 0, > + TEST_ASSERT(!ret, > "KVM_CREATE_DEVICE IOCTL failed, rc: %i errno: %i", ret, errno); > return fd; > } > @@ -2036,7 +2036,7 @@ int kvm_device_access(int dev_fd, uint32_t group, uint64_t attr, > { > int ret = _kvm_device_access(dev_fd, group, attr, val, write); > > - TEST_ASSERT(ret >= 0, "KVM_SET|GET_DEVICE_ATTR IOCTL failed, rc: %i errno: %i", ret, errno); > + TEST_ASSERT(!ret, "KVM_SET|GET_DEVICE_ATTR IOCTL failed, rc: %i errno: %i", ret, errno); > return ret; > } > > -- > 2.32.0.432.gabb21c7263-goog > Reviewed-by: Andrew Jones _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel