Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp1930626rwb; Fri, 28 Jul 2023 18:26:22 -0700 (PDT) X-Google-Smtp-Source: APBJJlEnbaAoJAPSEbise9NPjC0oHlnMzeZ1Anjxxc01mnXwd77A4NbWzluNrE8e27J9pNDlY663 X-Received: by 2002:a17:902:8f85:b0:1ac:7345:f254 with SMTP id z5-20020a1709028f8500b001ac7345f254mr2945078plo.33.1690593981897; Fri, 28 Jul 2023 18:26:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690593981; cv=none; d=google.com; s=arc-20160816; b=rpegXWsK4JtP8+s2UEx2QaY6auSmN9qijlU2M46zIe/JM5UmExO7t6a039+Hh+bkHe t7XRY7UMxgSX/Uul9ewgCynG9sD/z/groSV91EYosPKuAeRaSAn06jeMySF70jdwwLb+ jq3SOW79VsrjKrnAeH3HRh1yMpL7xSuCzB2IHB+z0UCUyo1wPwg9a+wYows9Xf0+2krD +ExDz125OHMpT58wGF6iXD+Jb6CJhTQ3UcJBtRkQ+ah7XYAb8/M83TqMkETs2yjkXMht xlAB9dtEC/S04E6MT+Yvuj5+f5zqxEjIIbS2sjAMXtcJLUwdjXFMaRmqcJLYda2NT7j3 4p4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:reply-to:dkim-signature; bh=A8aQo92BGEsQWkSMM0MIWBDLRqK5BVyNdFuue+2u5/k=; fh=Ctt0ydInMKwei8YFBFbw7rU4p8H0G/T51ZI/KkO6Md4=; b=nKVvXyjnbbBKvNPMFNTnz9PHvXFd5oI9ff6+bPNyOz4R+u7hJtxBukGGrYxLSe2Jnb xL7eiDqSV2/xTp39uKFCSVj/8pblq6hE9bkXtpEUq0fNeiwBgGxTyYQM4pvT7QvKAIZf wBzmSW5yBz3mOkaBtUeDmTPl8yxfmb2Pu2cHYYqLc9BhbNsSoYtqInsR3SQVO91AY47U +dtIJLrXptZ9BuxWbM4pAgIOjq9IHfiRPsKIYbzZIPRTAeHwCP3VI3Sd1oS5sRgU1trT oQe04izccUiXydojZJvFmd6HQkeq06VvTVbdgpsfSwOH9ZwnqdBqVARtdiocCrbGBZ50 u8vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=rHAAon41; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x62-20020a636341000000b0055336060fa0si3749742pgb.378.2023.07.28.18.26.09; Fri, 28 Jul 2023 18:26:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=rHAAon41; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236299AbjG2AkM (ORCPT + 99 others); Fri, 28 Jul 2023 20:40:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236680AbjG2AjW (ORCPT ); Fri, 28 Jul 2023 20:39:22 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7146E55BD for ; Fri, 28 Jul 2023 17:38:11 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-d06d36b49f9so2532459276.1 for ; Fri, 28 Jul 2023 17:38:11 -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=TnHlLon2N5NGwl5KdMSHSYFLma/UIbMn9n2CkJ067qPPTAYe3gho7WZoSS5VhzccRh uF1gTBcnVd+56fLP0ymC0xYkDbp/O9XDMkzpkD6QpC5iBpoRq21oBimUqq0vW1GbP4hL NlT7t/OThSj6sgH3oBp05EcYgry8CvK7cuW8sAAiY2tmXDKyNc+wUVj4I6DAZMT5LMgY r4ePJafEc6ueFjpIqleGrYkEpC9YoktzkDTh6Qjx6xRI/1A8rTrPueBfXXX7qT6/6SFD ysFPU99LgKwcUkEd3XZq6XIkK4G9unOvL1gLkg1eNDWWBGJ7sb6bOspwnonN+XlceqV6 9wXA== X-Gm-Message-State: ABy/qLaP9W85916SCdisF7v0W95WktJneNxrWixYolI+A1+bq7o2neRj v51wChcX7m4bB+duoiTTLuoodHHklww= 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) Reply-To: Sean Christopherson 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 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=20Mathieu-Daud=C3=A9?=" , Aaron Lewis Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the set_boot_cpu_id test to use printf-based guest asserts, specifically the EQ and NE variants. Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/x86_64/set_boot_cpu_id.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 #include @@ -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)); -- 2.41.0.487.g6d72f3e995-goog