From patchwork Sat Jul 29 00:36:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 13332812 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 79CBAC04A94 for ; Sat, 29 Jul 2023 00:38:58 +0000 (UTC) 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:Reply-To:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Message-ID :References:Mime-Version:In-Reply-To:Date:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ycxjw7nyEmbeP/A0y7glebQ5ReHY7UUw0agSRofGNYc=; b=zL3jPw4wPiCyi9 y/tstY7bR6KJX3hR4KzWijR8lrwqT8iRQDWBg7Jj6peoHsjVa70GhMfYilzkxEIfm8QMwTUzjr4qm 9VR+suPOPFD6+TmFzJ1uP6krFzogleknjvgRt8bJjAouQFcDLMTEi2SHPUT4hwWWo6hsQoFEXpJlU 6TVQqO0kvc8fYiaTb2mMZZmLh2pdtpJ7tgj606fQsZeY2f6lhdcYt4bxlG5Xabc++7o1XktWdlJVX eYrqNq4oj3de1l79cK+Vg8GQupPhnlI8AqrpxvC3EQiztXE/Gm9XTjf9FY5BSBXccfCqj7ceVztvI Mf89o0wcIBLYDihRhH9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qPXyQ-005dLp-1Z; Sat, 29 Jul 2023 00:38:22 +0000 Received: from mail-pl1-x649.google.com ([2607:f8b0:4864:20::649]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qPXxP-005cop-2I for linux-arm-kernel@lists.infradead.org; Sat, 29 Jul 2023 00:37:21 +0000 Received: by mail-pl1-x649.google.com with SMTP id d9443c01a7336-1bbb97d27d6so18294975ad.1 for ; Fri, 28 Jul 2023 17:37:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690591038; x=1691195838; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:from:to:cc:subject:date:message-id:reply-to; bh=ghJjf9GWvVyaghDwZhaADSILeZ7gBWODtxQxln/4ffA=; b=maWgMmnqFc3YTeKLPqw/lKtakn7FujXRZY95A1ym2PEZu5CChu6IlGjqWTu+fUFqQL zoq+6BxgefpGqPBhkpIA9667dZ0ojf+J1Z9g8FjcKPSeSiiOHzLvbec20n5BES71Jtqb wvnrEEbr8yJ15dxZILbTZTDn8ql6qUrqqLdFw8ll+n3b3Jqa/MAZ4S8/1ADT3yR/WcD5 Re4shMEJP08YXyczC/fKfFNAX1MK2uXOch7buigRGpuf+xzqNSnAndSw7DaifRC0T11w VSr3iLrJ71YH0QgsEEPIwCl3Lj/e6No/OylV6asvhU1jsps/crBGU7IBVbllYILPlaFg 1NNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591038; x=1691195838; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:reply-to:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ghJjf9GWvVyaghDwZhaADSILeZ7gBWODtxQxln/4ffA=; b=VVxYAorp7YkTHByKqXc61SrNvBYK42PznCUzaq0gBUlOoqoDAdKBpYyQ6z6Ilpe61G 29KC+05OopxKU4OeUl/52eA//D+ApVKrbZ/tn4n3EP6fBSUlzLiPmq9rB9SNQ21lts1x 0T4k8ctfBe2G8q9y90kqZsY8cqrMZjmTycjvbSuh19a12A7raCTzIN2MEdEklrR3myrv 6Wpzeanq556Wc68WXd1uhH2s6oJzTmlffyaowBJqA3sxpPt0v8I2Wylee9PxRMiTo1Ty 57teeKm3LYQHZixfeJCC7c699XSmUnHzLAXT2NkH9ljjqdnf5HaaQxd6meD66FB8lD/v Ndvg== X-Gm-Message-State: ABy/qLbSPhP+H+376FuQqp041rdoJYcXte9TjntUFmJSOXdTxvKT/8mr wUD+ksB/7WJwWb7NZ3bSlFVz/kHKJ04= X-Google-Smtp-Source: APBJJlG3mjhlyW9oaUgafKLtMp/fHKFVRqq4KJoWCUgnjv0myRLm2RNB2iWek9EwOxdFWO2/8Lf46iw8sZg= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:902:f683:b0:1b8:a54c:61ef with SMTP id l3-20020a170902f68300b001b8a54c61efmr12911plg.9.1690591038706; Fri, 28 Jul 2023 17:37:18 -0700 (PDT) Date: Fri, 28 Jul 2023 17:36:26 -0700 In-Reply-To: <20230729003643.1053367-1-seanjc@google.com> Mime-Version: 1.0 References: <20230729003643.1053367-1-seanjc@google.com> X-Mailer: git-send-email 2.41.0.487.g6d72f3e995-goog Message-ID: <20230729003643.1053367-18-seanjc@google.com> Subject: [PATCH v4 17/34] KVM: selftests: Convert s390's tprot test to printf style GUEST_ASSERT From: Sean Christopherson To: Paolo Bonzini , Marc Zyngier , Oliver Upton , Christian Borntraeger , Janosch Frank , Claudio Imbrenda Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Sean Christopherson , Thomas Huth , " =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= " , Aaron Lewis X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230728_173719_750666_DBE66373 X-CRM114-Status: GOOD ( 10.26 ) 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: , Reply-To: Sean Christopherson Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Convert s390's tprot test to printf-based GUEST_ASSERT. Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/s390x/tprot.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/kvm/s390x/tprot.c b/tools/testing/selftests/kvm/s390x/tprot.c index 40d3ea16c052..c12c6824d963 100644 --- a/tools/testing/selftests/kvm/s390x/tprot.c +++ b/tools/testing/selftests/kvm/s390x/tprot.c @@ -4,6 +4,7 @@ * * Copyright IBM Corp. 2021 */ +#define USE_GUEST_ASSERT_PRINTF 1 #include #include "test_util.h" @@ -156,7 +157,9 @@ static enum stage perform_next_stage(int *i, bool mapped_0) !mapped_0; if (!skip) { result = test_protection(tests[*i].addr, tests[*i].key); - GUEST_ASSERT_2(result == tests[*i].expected, *i, result); + __GUEST_ASSERT(result == tests[*i].expected, + "Wanted %u, got %u, for i = %u", + tests[*i].expected, result, *i); } } return stage; @@ -190,7 +193,7 @@ static void guest_code(void) vcpu_run(__vcpu); \ get_ucall(__vcpu, &uc); \ if (uc.cmd == UCALL_ABORT) \ - REPORT_GUEST_ASSERT_2(uc, "hints: %lu, %lu"); \ + REPORT_GUEST_ASSERT(uc); \ TEST_ASSERT_EQ(uc.cmd, UCALL_SYNC); \ TEST_ASSERT_EQ(uc.args[1], __stage); \ })