From patchwork Mon Oct 24 09:12:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Like Xu X-Patchwork-Id: 13016912 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 EFDC5FA3740 for ; Mon, 24 Oct 2022 09:13:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230525AbiJXJNO (ORCPT ); Mon, 24 Oct 2022 05:13:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230058AbiJXJNL (ORCPT ); Mon, 24 Oct 2022 05:13:11 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 592875C376 for ; Mon, 24 Oct 2022 02:13:10 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id b11so1553864pjp.2 for ; Mon, 24 Oct 2022 02:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wgGMC5SYMjT91BuTv+EO5nwnbbtDDIxJAEUbq8MFlhY=; b=eP7rI0Zu2+BFGsbWxEDs+USiHPooJMRAYzYJfccOihsuCJPWGQG/lyvN3NbZcCz6Gt MKjZLQOr0wcr7SQ9PvLulx+Pm67Ojj1pwBqFn4mDmqs1rYeeCNLYzDMq1f3M3anNvNY2 v25sDkiZxxAWCjXZNxjzBsMBN/ZZLYZyRIJM2RvTdLA5Ym3lVeppXpwBtQ54lRdJ7Cfp EwhdN3+ZFgfjfiaX7QLjk3FrfLYyBvz5I4cC0DzKokXrXKzg7p0G5H8I6Qx59aE6JnM5 vP6aOMlQ4LgYT2ZSfPXNCDSh7cnqMNUl3i5LksISxIRhTkPXvOhm/79P3GqA/M4NcdB1 rGtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wgGMC5SYMjT91BuTv+EO5nwnbbtDDIxJAEUbq8MFlhY=; b=aI1CTKG+EkrT9JL1md7yGAnDaTNc3m34alZxrTXe1helaRbo/gKCdllbkXKU82eaiE DO44sbsQxYY+ZX/oY4ywsyC7OERIDXfrOP/t7VdiavB3arAwTYpR4MYs0mtRzoqoJ8Ol 6ompUfcLnubjohFa+5+xOTfYtWSM1DI1u4rVOL0/CFZ4OHGN/6RVKSw6lB2DbJDy5a0Q cjKRejssy77456jorDe7ioAx8lZ8uTAiLI88TE8guwCo64ExkEpFSgReUwJP/Xxf50tD sZmTeoVdlb4T4yD/RF/zrqRTrXBMnNMQWloa4oj/vPvv9wi8VekBkHvylTN0aoHC/FVT vpCQ== X-Gm-Message-State: ACrzQf3d+LNAEu+Af+9Tk4n1Weq447vLnj8Uaru+fahPtzBVgurYq2Ay SjhwSiS8XfRHuEUWHx8sE+I= X-Google-Smtp-Source: AMsMyM7/ZRoNtlV0Akv7pRj/mqCksu421NpXCoFFvbnFzaTZWY4lbmGZdttIoEGw+mf6hx87/zPl3g== X-Received: by 2002:a17:902:7c8a:b0:17b:6eaa:5da3 with SMTP id y10-20020a1709027c8a00b0017b6eaa5da3mr31804237pll.33.1666602789848; Mon, 24 Oct 2022 02:13:09 -0700 (PDT) Received: from localhost.localdomain ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id r15-20020aa79ecf000000b00535da15a252sm19642213pfq.165.2022.10.24.02.13.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 02:13:09 -0700 (PDT) From: Like Xu X-Google-Original-From: Like Xu To: Sean Christopherson Cc: Paolo Bonzini , Jim Mattson , kvm@vger.kernel.org, Sandipan Das Subject: [kvm-unit-tests PATCH v4 05/24] x86/pmu: Fix printed messages for emulated instruction test Date: Mon, 24 Oct 2022 17:12:04 +0800 Message-Id: <20221024091223.42631-6-likexu@tencent.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024091223.42631-1-likexu@tencent.com> References: <20221024091223.42631-1-likexu@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Like Xu This test case uses MSR_IA32_PERFCTR0 to count branch instructions and PERFCTR1 to count instruction events. The same correspondence should be maintained at report(), specifically this should use status bit 1 for instructions and bit 0 for branches. Fixes: 20cf914 ("x86/pmu: Test PMU virtualization on emulated instructions") Reported-by: Sandipan Das Signed-off-by: Like Xu --- x86/pmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x86/pmu.c b/x86/pmu.c index c8a2e91..d303a36 100644 --- a/x86/pmu.c +++ b/x86/pmu.c @@ -512,8 +512,8 @@ static void check_emulated_instr(void) "branch count"); // Additionally check that those counters overflowed properly. status = rdmsr(MSR_CORE_PERF_GLOBAL_STATUS); - report(status & 1, "instruction counter overflow"); - report(status & 2, "branch counter overflow"); + report(status & 1, "branch counter overflow"); + report(status & 2, "instruction counter overflow"); report_prefix_pop(); }