From patchwork Sat Jul 29 00:36:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 13332817 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 9CA63EB64DD for ; Sat, 29 Jul 2023 00:39:04 +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=Ghf6cKSTDmTcrheGXhl4531PWXn/mGA/1R+kZ4xLh1w=; b=pRbC9ctMX5QR7a TIKKaZygZpFTvUV+RebFKWuWSSU4S2vKphr4Xu8+qYKvtdNHFZdLQIDI69YF6lfQ5gq5LLsC9EqlU 2YpY5K03b3Ek6do8np2ikyPWz9RgKSaESEx9JRbNGtkxtXriduObult56wJxJg4xEc+q4AdcqSaXr N47PmATpBlxCM6wU+s2DrivPK4LArNGqCs27lWFtvp7oafbLSdxpcyX5zMSojegnaPZCZGIj3Sbsu ZiMFeiaEhsvDzQaoHHu+aGto3KDIM1NSy1KNs2ZqzzIMYrI/0syLn6N2ZYu1x+gzY3LlbZ6RIm5R0 wX5AdeL+LJ7zUmSG3wvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qPXyP-005dLR-3A; Sat, 29 Jul 2023 00:38:21 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qPXxO-005cnZ-21 for linux-arm-kernel@lists.infradead.org; Sat, 29 Jul 2023 00:37:20 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-56942442eb0so29271037b3.1 for ; Fri, 28 Jul 2023 17:37:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690591037; x=1691195837; 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=Ngl8lC+/wGQlijkr13PT2tPWtqTwIZBUn/V8pQLJnsI=; b=jTQgJijvaSA87s20WcW+DJNYcBr6iycXkShWiPEyn+ZHzYOOnQWRcWv0EDcUck3WSB dDF9I/Q1ySsvk1kWojQd9tEW8CDUPb3rTBRDLk/39KSQDC1qIvUaOTYBgFEBQSQG5ATK 8R4xRcct2Y93O33tOsGnfxwy3mlvnE7TbvOuNpUzxRO2IweGEzpWlv7WtggKrSBIcfG9 sEllWKhZpl8xKL/qkLMA6jfKxBkcLUU8sa+YBP7gnqHUx9AQjq6pptXGY8yhdC+XrS3V Cvu0hwoiZQ5M1a1Zqzfe0E2sT4WnjUBLlClEx7LF5ZDnUPi2DLOSqL0+TuJZZvycUOll a2og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591037; x=1691195837; 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=Ngl8lC+/wGQlijkr13PT2tPWtqTwIZBUn/V8pQLJnsI=; b=lqaCt2fdDyx6XvnvFEHI4MaZhoapNJMfKAjo0dy3n747ZG039nnDQQaPzbA+M+pfJH 7lR7DcURXpke5fXLGFOt8MaAglRv6zkbVZ6lmS9I2mSxNhDZHoN7mFxbpzPbc20wtP7s PjIwYVHMTPmt2xPv1D/BChHBTrP5EolnSvWapCudaNROZJkJA+b1WcT69woDJ8sfkX8H wik+jQVK8N9PEiLqZhfLTaKEnqE0O9V/yPk38KnpQDnMnf1OD7nWCNkBpFK1yC/97Qwb fsTQKU1INDwDz2gKZiwsXc0hKXBtAqZGqIdIMhsFySPvFc75afvHWINYcvZMZDnV2xRm OThw== X-Gm-Message-State: ABy/qLaggOuBUyAqa3b6nOdiVsqmD3C8dRBhv4f4UTu3gNLxAHLapp1i YaSUjdepPNLpuJR4v947XD4gxGjIq4w= X-Google-Smtp-Source: APBJJlFyvjHiUTrdRegL0ZLMZ9b9mCjMN4KTPZtSt6e6xxSeT5N2o2AAxi3EjqMwYiXS5k9L3PQ7RQatewc= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a25:20c3:0:b0:d11:b0d5:cd01 with SMTP id g186-20020a2520c3000000b00d11b0d5cd01mr17235ybg.8.1690591037120; Fri, 28 Jul 2023 17:37:17 -0700 (PDT) Date: Fri, 28 Jul 2023 17:36:25 -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-17-seanjc@google.com> Subject: [PATCH v4 16/34] KVM: selftests: Convert s390's memop 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_173718_681313_0A3FE748 X-CRM114-Status: GOOD ( 10.73 ) 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 memop test to printf-based GUEST_ASSERT, and opportunistically use GUEST_FAIL() to report invalid sizes. Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/s390x/memop.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/kvm/s390x/memop.c b/tools/testing/selftests/kvm/s390x/memop.c index de73dc030905..a49173907cec 100644 --- a/tools/testing/selftests/kvm/s390x/memop.c +++ b/tools/testing/selftests/kvm/s390x/memop.c @@ -4,6 +4,7 @@ * * Copyright (C) 2019, Red Hat, Inc. */ +#define USE_GUEST_ASSERT_PRINTF 1 #include #include @@ -279,7 +280,7 @@ enum stage { 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); \ @@ -469,7 +470,7 @@ static __uint128_t cut_to_size(int size, __uint128_t val) case 16: return val; } - GUEST_ASSERT_1(false, "Invalid size"); + GUEST_FAIL("Invalid size = %u", size); return 0; } @@ -598,7 +599,7 @@ static bool _cmpxchg(int size, void *target, __uint128_t *old_addr, __uint128_t return ret; } } - GUEST_ASSERT_1(false, "Invalid size"); + GUEST_FAIL("Invalid size = %u", size); return 0; }