From patchwork Sat Jul 29 00:36:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 13332806 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 06690EB64DD for ; Sat, 29 Jul 2023 00:38:47 +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=gST2Y5OiwznabdNqSYhAZX1AKMhYJk9Z6kBxisFrXX8=; b=pGTQSMe7RESo31 3HR1aBYAiIQKeEi1DScE/5p4mO2cVDS33MNpartEk4DqBk2W9hxcw7/WHcVAj0dxaWCTc+Az6iQvb 6jvhYVGrrjN2R6FrizPmqnekWPWULP8BcRT9Ekv2uz+6Pwr+u+xid65zG3mvAfgGuV9PSyVzTPvza IJLvwDG7cJqQIWnhnRtvcAo6zNAnONHQnJK3VaLAPKhIltImUmFExjTFfZSTKb3vV/RkLQ2YjbOB9 jJMrRWfzNAUWZcGbQm3d9Dy9lLEG+xAPmVWicp4M7In8evr7GwZOBNq0fG3x5ptNneMYs2qopt0V9 UvklxGhepw7fRLUmUDhw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qPXyO-005dKQ-39; Sat, 29 Jul 2023 00:38:20 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qPXxK-005clQ-2d for linux-arm-kernel@lists.infradead.org; Sat, 29 Jul 2023 00:37:16 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-d27ac992539so1129728276.3 for ; Fri, 28 Jul 2023 17:37:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690591033; x=1691195833; 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=jFbTWBnTo16fnwIdUW+NlD/5fy0AI1YGJZRG7rO31c8=; b=YbzMbVhpY6NSduIpNQdD3qQlyt9xdigEOx+DaMLJ+/1005/m6d0mQJHJ2zPdXnnIGV PHn40LYSFNzYKhu59r32RQyeDajteY1wVPJtsfB/vWe3BTFWN071SEBzc0fNOwPO1eRa Spa2H8YIfF5YdZ+xaHx46GKzIR3aKDxlq3sDHHB/UuG/fN3nAvyJSYBPjFjamloZN9VD qV1s0UpIMQ9KALXTP5UIutnvC6+eEr47bajzg1NdQv4o7QKOcrtCYaYLEP6HB9i0pgdF yccbRzKsSb90kWq3a9BqtOl9xadE/NDJQ/2KS4MDV9xqG2w2KUqOy8WhnlrcioLq9b6q /xdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591033; x=1691195833; 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=jFbTWBnTo16fnwIdUW+NlD/5fy0AI1YGJZRG7rO31c8=; b=Rv00xx59iJ7pYaVosNqI0PRi+To+taH2DgfEg26CX/TzoNoqEtE7TcaDhbR/qW0/Ph F6P/x8wEIyvULMFUrX/rtCfVctwEgsJy4MkIa2seffBBmV6kGZC945k4oHW5dBuQROLX nAzYnxhQiJLtRf3lxFIEw/WA1HTa0EooFljMmE/uo6zuQ2H33Rie5JnTPHif9hjZ6j6d JNVsAoAYOr59x7fhCr9bJgbcqPlmX3zQRyp/vIiP7rJIqcV/VDuj1Bdl1R0gvXs2G5dV HLwOqJYRWoSqXSBtj/etTPvG9+i5pfgozstN4Be6nlnRe9aMP4A0x7mY3A0Y2lsCtU8U soMg== X-Gm-Message-State: ABy/qLaJ4acFHfvPkIbKxWMqiuqaBaKPtKRFFt8OGNDj2JoTv9EEY0PJ ML/J2FzPjrwsz7NWPLPTuzCzKeuMzWw= X-Google-Smtp-Source: APBJJlFOFAvzGLqZ3WhMfPIFqSf7CLYIGldBh6TJ0ra7wfq/Bxr6Fucq0mI7ZF8VYXYP5klQu5yNzrY8ia8= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:6902:100f:b0:cf9:3564:33cc with SMTP id w15-20020a056902100f00b00cf9356433ccmr24231ybt.13.1690591033359; Fri, 28 Jul 2023 17:37:13 -0700 (PDT) Date: Fri, 28 Jul 2023 17:36:23 -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-15-seanjc@google.com> Subject: [PATCH v4 14/34] KVM: selftests: Convert ARM's vGIC IRQ 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_173714_851862_06634577 X-CRM114-Status: GOOD ( 10.60 ) 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 Use printf-based guest assert reporting in ARM's vGIC IRQ test. Note, this is not as innocuous as it looks! The printf-based version of GUEST_ASSERT_EQ() ensures the expressions are evaluated only once, whereas the old version did not! Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/aarch64/vgic_irq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/kvm/aarch64/vgic_irq.c b/tools/testing/selftests/kvm/aarch64/vgic_irq.c index 90d854e0fcff..67da33aa6d17 100644 --- a/tools/testing/selftests/kvm/aarch64/vgic_irq.c +++ b/tools/testing/selftests/kvm/aarch64/vgic_irq.c @@ -7,6 +7,7 @@ * host to inject a specific intid via a GUEST_SYNC call, and then checks that * it received it. */ +#define USE_GUEST_ASSERT_PRINTF 1 #include #include @@ -781,7 +782,7 @@ static void test_vgic(uint32_t nr_irqs, bool level_sensitive, bool eoi_split) run_guest_cmd(vcpu, gic_fd, &inject_args, &args); break; case UCALL_ABORT: - REPORT_GUEST_ASSERT_2(uc, "values: %#lx, %#lx"); + REPORT_GUEST_ASSERT(uc); break; case UCALL_DONE: goto done;