Message ID | 20230729003643.1053367-27-seanjc@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> 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 82E1DEB64DD for <linux-arm-kernel@archiver.kernel.org>; Sat, 29 Jul 2023 00:39:11 +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=AmqHGiW8U00F9Gvy5z5owaqoNiNeGJ4Lmij1XOog+o8=; b=RRjkuPikcA6hwP O7I5MFHg1YQfchNpBzEvdbeuM+sqARtrsyXNs2A6b6J0HlTGGWXlzLJwbjTTCJeNHQ6SpgfbCZv6G 9bLu1KiKEmB2Sp6sn5o/MurIWkso63S2zyjtVAwTREk7KDAVsKybiA/ipPvPaHIqQgzBM+miH2vja PsvtnCysdYLg+Px5+sPeqcliFCtcINX4IJTwqdgz146lrspVeYn0Dx2C+h3G+ha8yHtkCz35H3Yce /b/zcZT+aYKH7KAQB+2ULOL5/tIlVUrzNb4KozOxHHmcI/2wWugpgsK877USTKu2yGZcOGYiu1INe gflvaTIzhEUfFKqzsI8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qPXyV-005dSG-2r; Sat, 29 Jul 2023 00:38:27 +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 1qPXxh-005d1J-2d for linux-arm-kernel@lists.infradead.org; Sat, 29 Jul 2023 00:37:39 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5618857518dso26632837b3.2 for <linux-arm-kernel@lists.infradead.org>; Fri, 28 Jul 2023 17:37:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690591056; x=1691195856; 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=A8aQo92BGEsQWkSMM0MIWBDLRqK5BVyNdFuue+2u5/k=; b=rHAAon41DFnQeXUebX2OJqNtyuIqCjw/zv/LEFTrP6sKfuqbWQWy9vTAeDC9baKzkM InL2pbSWIvgmJo1PFc5PkZ9IssaPyWA6beQKHDlATRaITOhgmWiIi4Yc6QNojT4gim2g VHEcBgumeC+dZAbxD6aD3GbVFZzVhTveam9/0HVj8PAwwacp6sj79h3MRWTWHVGts8EH qeFgp3tJXVbDG7wMwDPRbM2LiNJJ9L5W/iXasZCfE08XzD2USXpqlYmrhqXhXY8U8Dxh QtEieDJoOJzHX5jn1vKb8EIGVG6faLPinZHl9nkvORH8R4TaxZmBVa2qWsf+mhcEmiq1 bkug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591056; x=1691195856; 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=A8aQo92BGEsQWkSMM0MIWBDLRqK5BVyNdFuue+2u5/k=; b=El1txkvGVWxZIqpyXFS9ZMCF5/ojfS5fbGU10PkBhOQjV7sjXbOPFFomVVnJ8ZNDhs psC2raQJSNIGyvO9DtLEnOVA0dtSBPCmahKcENysOQb6fcKkDmi2SNs3ecfzlCtSZv3i MGqX5ufev22HeMkw8ZCcJU/6xYKJ5aossZIID7uR2BcCPOSX44ef/tQi/5NAWZHw63K8 z4iWYyfBBV8BbYhdEbQMyysbsVwU0L300kmb7n9XwTdaQMmwnFFJFK5egTYlTbKXy1ol PI7FqbdznafEADgCoQNBcij1/TrWpdYUff0+SmDrpaJY8sNYKTW2DioY0Nie4xjQ8b1y cLjA== X-Gm-Message-State: ABy/qLbCypfR9XPRxGZ5jkS6ZI0p1zHLkc0dMHMVNVgIKLPCsx7j5Cxr EodUuTtTslkCpsyhrIYZfdJ/lzZP2yY= X-Google-Smtp-Source: APBJJlEJnPZI81sdISJjMNXK9i+0b+uyCp/hlcuf7GAPKJmfjcAxHXQ0DG6ODxl42Zjvl3eTSQ7DFBljZzk= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a25:29c2:0:b0:d16:89fe:52cd with SMTP id p185-20020a2529c2000000b00d1689fe52cdmr17553ybp.11.1690591056277; Fri, 28 Jul 2023 17:37:36 -0700 (PDT) Date: Fri, 28 Jul 2023 17:36:35 -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-27-seanjc@google.com> Subject: [PATCH v4 26/34] KVM: selftests: Convert x86's set BSP ID test to printf style guest asserts From: Sean Christopherson <seanjc@google.com> To: Paolo Bonzini <pbonzini@redhat.com>, Marc Zyngier <maz@kernel.org>, Oliver Upton <oliver.upton@linux.dev>, Christian Borntraeger <borntraeger@linux.ibm.com>, Janosch Frank <frankja@linux.ibm.com>, Claudio Imbrenda <imbrenda@linux.ibm.com> Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, Sean Christopherson <seanjc@google.com>, Thomas Huth <thuth@redhat.com>, " =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= " <philmd@linaro.org>, Aaron Lewis <aaronlewis@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230728_173737_881589_6D5E0CAF X-CRM114-Status: GOOD ( 10.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Reply-To: Sean Christopherson <seanjc@google.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
KVM: selftests: Guest printf and asserts overhaul
|
expand
|
diff --git a/tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c b/tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c index b25d7556b638..abb3f26d3ce0 100644 --- a/tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c +++ b/tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c @@ -4,6 +4,8 @@ * * Copyright (C) 2020, Red Hat, Inc. */ +#define USE_GUEST_ASSERT_PRINTF 1 + #define _GNU_SOURCE /* for program_invocation_name */ #include <fcntl.h> #include <stdio.h> @@ -20,7 +22,7 @@ static void guest_bsp_vcpu(void *arg) { GUEST_SYNC(1); - GUEST_ASSERT(get_bsp_flag() != 0); + GUEST_ASSERT_NE(get_bsp_flag(), 0); GUEST_DONE(); } @@ -29,7 +31,7 @@ static void guest_not_bsp_vcpu(void *arg) { GUEST_SYNC(1); - GUEST_ASSERT(get_bsp_flag() == 0); + GUEST_ASSERT_EQ(get_bsp_flag(), 0); GUEST_DONE(); } @@ -65,7 +67,7 @@ static void run_vcpu(struct kvm_vcpu *vcpu) stage); break; case UCALL_ABORT: - REPORT_GUEST_ASSERT_2(uc, "values: %#lx, %#lx"); + REPORT_GUEST_ASSERT(uc); default: TEST_ASSERT(false, "Unexpected exit: %s", exit_reason_str(vcpu->run->exit_reason));
Convert the set_boot_cpu_id test to use printf-based guest asserts, specifically the EQ and NE variants. Signed-off-by: Sean Christopherson <seanjc@google.com> --- tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)