From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 411A7EB64DD for ; Wed, 28 Jun 2023 21:29:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231981AbjF1V3G (ORCPT ); Wed, 28 Jun 2023 17:29:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230413AbjF1V3D (ORCPT ); Wed, 28 Jun 2023 17:29:03 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0DDB1BCC for ; Wed, 28 Jun 2023 14:29:02 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-56ff81be091so44257b3.0 for ; Wed, 28 Jun 2023 14:29:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1687987742; x=1690579742; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=S4+NG0E282pExx69hOpqlYJL4D++Sscbft5Jezcu1U4=; b=LmTiMTLjtNU8B+N2wm1qv1Xh+WY5DCUp3/vCPG22i+LFvSuz4Z8BwGRQgKrdosqrED 8KVLYu5kYeA9sXbrtaC5xRgq12Vn0+jvo2NS9FLX2LoVDN7s6lIqJncjVsTOxKDbSs/t qmWHZuANGKIhnEeC5aO9RIfyOD2dsd+EBfvThphHldcD8OElNd8OFdMTrLG6DGcxVUMr /eTTF8mTqrNEzid+Gjd117s+xAtn9r5f2QzMeSYYZe7yxL0+jjhc9mlb5l1VEz4t38du C+w0gdJaiY+6ADDV+ee0nUnzlJPd4yq+N++z02+jMjaYwzgoHHeZQeGQqoPH+LPTsanU 0eOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687987742; x=1690579742; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=S4+NG0E282pExx69hOpqlYJL4D++Sscbft5Jezcu1U4=; b=e5bwP/zocJSFgcGqi2ifjeMwW4c+HESK3H/kSC/6lju3VLoeH723qxn6j4h537dHvd L3HN9wJ9D2oipfdTzWiTSLHDaEdtVC78B5sdEvztVZJoHF14T/ZEFGibwoyYweJCHgan lHOVAQSrny/6k1BqRxiqKKBX4YedR2RuuMoRXtvbDO4LT88wNBioZb8ny4m0mx1RWhTI 79NpysZaRNCER2rkLCMR69uZK8Gbpg+rDi28yv7+55VlhZpP2CJ4edA50hXv03YlSl8I 3IK2GAtvKuGdKp5pWvXcUDl1xfIuaRuLRaqhHygsY+k5uQ0f2X7C1nJPFuFlqvFIRXVC g22g== X-Gm-Message-State: AC+VfDwdQUfvhx8zkKVWaU796A7p+H4KRc53d+F4lJ8HX/mjJR1aoMLy nR3PKPytMlgT1oCC87EQg5cNFKJo4L0= X-Google-Smtp-Source: ACHHUZ4n8a2QLF6VBqJGBRku7htondlRkoTsoqSbam1pQTzOu9LsAReH81erivYUgmkTY3xJRw3s1hR6jZA= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a05:690c:708:b0:576:a5a8:f686 with SMTP id bs8-20020a05690c070800b00576a5a8f686mr4556851ywb.9.1687987741909; Wed, 28 Jun 2023 14:29:01 -0700 (PDT) Date: Wed, 28 Jun 2023 14:29:00 -0700 In-Reply-To: <20230607123700.40229-4-cloudliang@tencent.com> Mime-Version: 1.0 References: <20230607123700.40229-1-cloudliang@tencent.com> <20230607123700.40229-4-cloudliang@tencent.com> Message-ID: Subject: Re: [PATCH v3 3/4] KVM: selftests: Check if event filter meets expectations on fixed counters From: Sean Christopherson To: Jinrong Liang Cc: Paolo Bonzini , Jim Mattson , Shuah Khan , Aaron Lewis , David Matlack , Vishal Annapurve , Wanpeng Li , Like Xu , Jinrong Liang , linux-kselftest@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 07, 2023, Jinrong Liang wrote: > + /* > + * Check the fixed performance counter can count normally works when > + * KVM userspace doesn't set any pmu filter. > + */ > + TEST_ASSERT(run_vcpu_to_sync(vcpu), > + "Fixed counter does not exist or does not work as expected."); No punctuation, and print the unexpected return value so that debug isn't too painful. > + > + for (i = 0; i < BIT(nr_fixed_counters); i++) { > + bitmap = BIT(i); > + count = test_with_fixed_counter_filter(vcpu, KVM_PMU_EVENT_ALLOW, > + bitmap); > + TEST_ASSERT(!!count == !!(bitmap & BIT(idx)), > + "Fixed event filter does not work as expected."); No punctuation please. > + > + count = test_with_fixed_counter_filter(vcpu, KVM_PMU_EVENT_DENY, > + bitmap); > + TEST_ASSERT(!!count == !(bitmap & BIT(idx)), > + "Fixed event filter does not work as expected."); > + } > +}