From patchwork Sat Jul 29 00:36:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Christopherson X-Patchwork-Id: 13332819 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 B479FC001E0 for ; Sat, 29 Jul 2023 00:39:05 +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=liaD3bChCmzihXV2gVDF7sod6kvWFwN0CIrjaf03MZo=; b=lv9FiD2E7+yLtJ qQxkpdSnZSZf7IhLMFf8AKgOmyPG7l/8kTFyCGLlSvD5SaeBnQPfhWIiuDMpNuejYsC8GDY8D3bF8 C9i7NIUj0yXZe80/TIhs4S6900ZCUeGfStbUzzdY9NDO7ECaqUlfKeE93OQAFPcW/FPbfx9Y6S2oE j/UxtI0XsOgRzevJRTaIpj0aimXbZyOddgi2avDWLs2B3ajBxv7pxl7tYuN6QNQnpCaseNu+UqMb4 6NWU3mmePVnZKupqeL3TszaPTWWOrnxza/TV9mnwOun24JA5ZCgzB4aNoDd4V+vOxfQl8wpIhHBN5 q4GYaYdsYd2bYK45GMsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qPXyT-005dPp-2v; Sat, 29 Jul 2023 00:38:25 +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 1qPXxb-005cx9-3B for linux-arm-kernel@lists.infradead.org; Sat, 29 Jul 2023 00:37:37 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-d1ebc896bd7so2489693276.2 for ; Fri, 28 Jul 2023 17:37:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690591050; x=1691195850; 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=u2EIFWrBLGEnIiN/EFJ5XRmezLxqqm+61iiHmkdd9ak=; b=TIIFj9PRB7w7knxR4gGCXPFWprbCc6PSg9bZdqeQNgOIr8n4lBUcFDZnrj3QtXE6nu LT7OVvjwtMrAeu0gPoA5V4phKY1ayY/jFxjHHj4KHYmdKbTaWR+HVw5JhWp5QpmEHtPQ r3nOgYRipUN2H2CkKumNFOEEdfgGc8tndwAlLM5yNrUDmZRqDycA+OFsTczRw3p1Ixzt nCWPRmwKCpJHn4Y74RBkJqDY9ab5UY4rZLZaMcC4Ec12Wnh0ni/LvbvBdt0YaXmyhF15 KHpSU49BiLispdDH9IcnQsp8yk8N5ZPxjboEL8tLmbT5z0ASXh3ruBWkK444oxHt16uX DsZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690591050; x=1691195850; 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=u2EIFWrBLGEnIiN/EFJ5XRmezLxqqm+61iiHmkdd9ak=; b=iF9f5JktGp/Di9aS/2dDF2ONzrTthISC9kOuCWXqzM5ERBuz/9BMhMcaQagrZJhsrj gf/dJqDnd60/ZKn4IbOuWv0GlfGDU7KFwF6xH+C6FefcWZs9lZo6aAwLDrLuU/dsF2tm B1DHt39BleDgnelHql7Xkq9j26XaX/EJMujvtbS6BUPPb58s6qHFeSs6Jg74u9lgZsu0 oc9oMhKk52ircf3GSl+xm/mhLZwPZO/LvAqxusTbTi4xoQGcR63j6a7lonmjqpoPKP+R NjqnJTjwvRDEq29ayBBNEQqa2cTtwxlkSxnQUUFesUKVvWHUHA5HJX0idHyU1VlthFPc slUw== X-Gm-Message-State: ABy/qLaq9F7586iyOagwTYBRFCnL4bk71od48QUt/YT+DI7mLxMIPsSr VceTn5HDGdWonuEfLtC+k2XS7npo6Ic= X-Google-Smtp-Source: APBJJlHE48bzeCyOTilENfSay/pSrMUoqERzzk5XcsIhTPUOx1NnLk0AtqS5bz6Uj5fvFPTyTHsRaarOSPo= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a25:ac48:0:b0:d15:d6da:7e97 with SMTP id r8-20020a25ac48000000b00d15d6da7e97mr16764ybd.3.1690591050399; Fri, 28 Jul 2023 17:37:30 -0700 (PDT) Date: Fri, 28 Jul 2023 17:36:32 -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-24-seanjc@google.com> Subject: [PATCH v4 23/34] KVM: selftests: Convert x86's KVM paravirt 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_173732_067141_952AD1F1 X-CRM114-Status: GOOD ( 10.18 ) 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 x86's KVM paravirtualization test to use the printf-based GUEST_ASSERT_EQ(). Signed-off-by: Sean Christopherson --- tools/testing/selftests/kvm/x86_64/kvm_pv_test.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/testing/selftests/kvm/x86_64/kvm_pv_test.c b/tools/testing/selftests/kvm/x86_64/kvm_pv_test.c index f774a9e62858..1c28b77ff3cd 100644 --- a/tools/testing/selftests/kvm/x86_64/kvm_pv_test.c +++ b/tools/testing/selftests/kvm/x86_64/kvm_pv_test.c @@ -4,6 +4,8 @@ * * Tests for KVM paravirtual feature disablement */ +#define USE_GUEST_ASSERT_PRINTF 1 + #include #include #include @@ -46,10 +48,10 @@ static void test_msr(struct msr_data *msr) PR_MSR(msr); vector = rdmsr_safe(msr->idx, &ignored); - GUEST_ASSERT_1(vector == GP_VECTOR, vector); + GUEST_ASSERT_EQ(vector, GP_VECTOR); vector = wrmsr_safe(msr->idx, 0); - GUEST_ASSERT_1(vector == GP_VECTOR, vector); + GUEST_ASSERT_EQ(vector, GP_VECTOR); } struct hcall_data { @@ -77,7 +79,7 @@ static void test_hcall(struct hcall_data *hc) PR_HCALL(hc); r = kvm_hypercall(hc->nr, 0, 0, 0, 0); - GUEST_ASSERT(r == -KVM_ENOSYS); + GUEST_ASSERT_EQ(r, -KVM_ENOSYS); } static void guest_main(void) @@ -125,7 +127,7 @@ static void enter_guest(struct kvm_vcpu *vcpu) pr_hcall(&uc); break; case UCALL_ABORT: - REPORT_GUEST_ASSERT_1(uc, "vector = %lu"); + REPORT_GUEST_ASSERT(uc); return; case UCALL_DONE: return;