From patchwork Wed Mar 2 11:26:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Like Xu X-Patchwork-Id: 12765834 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 7CF74C433EF for ; Wed, 2 Mar 2022 11:26:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241329AbiCBL10 (ORCPT ); Wed, 2 Mar 2022 06:27:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237232AbiCBL10 (ORCPT ); Wed, 2 Mar 2022 06:27:26 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2E786A021 for ; Wed, 2 Mar 2022 03:26:43 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id u16so1656485pfg.12 for ; Wed, 02 Mar 2022 03:26:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LQtgFO8L0rHL6Qc5taUM878H2bGp64It6/6uXRoylBc=; b=Zr3fib6Jjq+kA8rd4LXKw/kgfkC35ZCvmUMOMU+GJbKjpt0wGkncDjaUhwqmjUxKTj zOGAHlDvuqTJ6z1DoYJ6T6cY1H8i039fuUHWxHL7wtKGZ3MPB/LRDzfzlheZoStRMyL+ q6ViCTthyxf29pQvEpZxDc8GHwtqCiWcHKKpnxoKZVSCE4475FQ3ISU804Hknxsp+Ebm aUOq1EL3mqP4YYysiYvUfa/Nq3eypq+nwK6cz5Q4stLz2LLvUQGinDaudGtmYO1IAgmX drGOcrhqjjsbaWWAqaw0Jcvyi0ggr0mpIFE7hHFVWU1SCf0hiimV6oFI3Nw8CyIEddqx 4WmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LQtgFO8L0rHL6Qc5taUM878H2bGp64It6/6uXRoylBc=; b=JkYlKJPhUkNKheZcKGIf8GBdCXTOLNbzNWfcHH/MPxEgk5Jvgv/mvaLyHjpPiHt72G oghQylzDVNAAfjeFRV+Nh5jmspKDS8dtBYaaATdLmr/lZ3BacbLJb0IoQUwW627+hUSn NW/dj3lTMM0Dfk/C9J5Wi+JDr4p2RbpnRKrLZZd6LUZd0e0IGNt30wAqxoxlMFXTtXOp L6QuBH0XsSRkmZma1WDFU7y7CDRi4JMBiakbe7+E22BA16DtdQp9ddZqzvMJst3P3tMt RZnFzQzUZl66dncNNI5A60VUvdDj4uQ14qrLDEYSh/eXfzw46lxjIEnhOan9K8aeohGZ 1BoA== X-Gm-Message-State: AOAM531FODsf8AHb6H3VeY4OOkQjN7f284E8Ok9ipZK617MvBmvBVxLW kWsK3sAnT7DHXsXiU2VoLgU= X-Google-Smtp-Source: ABdhPJw8WKNcUgTeANW7JDAgfJCwzN37ETaVlDB9nztW3Kiox2f2xnfrNUrs0HbTpKTbTunt6vzTMA== X-Received: by 2002:a63:1321:0:b0:376:333b:3ed with SMTP id i33-20020a631321000000b00376333b03edmr22647052pgl.283.1646220403028; Wed, 02 Mar 2022 03:26:43 -0800 (PST) Received: from localhost.localdomain ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id z18-20020aa78892000000b004e19bd62d8bsm21425155pfe.23.2022.03.02.03.26.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 03:26:42 -0800 (PST) From: Like Xu X-Google-Original-From: Like Xu To: Paolo Bonzini Cc: kvm@vger.kernel.org, Like Xu Subject: [kvm-unit-tests PATCH RESEND 1/2] x86/pmu: Make "ref cycles" test to pass on the latest cpu Date: Wed, 2 Mar 2022 19:26:33 +0800 Message-Id: <20220302112634.15024-1-likexu@tencent.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Like Xu Expand the boundary for "ref cycles" event test as it has been observed that the results do not fit on some CPUs [1]: FAIL: full-width writes: ref cycles-N 100000 >= 87765 <= 30000000 100000 >= 87926 <= 30000000 100000 >= 87790 <= 30000000 100000 >= 87687 <= 30000000 100000 >= 87875 <= 30000000 100000 >= 88043 <= 30000000 100000 >= 88161 <= 30000000 100000 >= 88052 <= 30000000 [1] Intel(R) Xeon(R) Platinum 8374C CPU @ 2.70GHz Opportunistically fix cc1 warnings for commented print statement. 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 92206ad..3d05384 100644 --- a/x86/pmu.c +++ b/x86/pmu.c @@ -86,7 +86,7 @@ struct pmu_event { } gp_events[] = { {"core cycles", 0x003c, 1*N, 50*N}, {"instructions", 0x00c0, 10*N, 10.2*N}, - {"ref cycles", 0x013c, 0.1*N, 30*N}, + {"ref cycles", 0x013c, 0.08*N, 30*N}, {"llc refference", 0x4f2e, 1, 2*N}, {"llc misses", 0x412e, 1, 1*N}, {"branches", 0x00c4, 1*N, 1.1*N}, @@ -223,7 +223,7 @@ static void measure(pmu_counter_t *evt, int count) static bool verify_event(uint64_t count, struct pmu_event *e) { - // printf("%lld >= %lld <= %lld\n", e->min, count, e->max); + // printf("%d >= %ld <= %d\n", e->min, count, e->max); return count >= e->min && count <= e->max; } From patchwork Wed Mar 2 11:26:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Like Xu X-Patchwork-Id: 12765835 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 8841EC433F5 for ; Wed, 2 Mar 2022 11:26:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241337AbiCBL1a (ORCPT ); Wed, 2 Mar 2022 06:27:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241297AbiCBL11 (ORCPT ); Wed, 2 Mar 2022 06:27:27 -0500 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1950A606E0 for ; Wed, 2 Mar 2022 03:26:45 -0800 (PST) Received: by mail-pj1-x102b.google.com with SMTP id cx5so1517298pjb.1 for ; Wed, 02 Mar 2022 03:26:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UyAauvBmSug4drW2djAafs3kx5pIR74OsbYQ7t+MiHk=; b=G3vRR8G365996uOtex4UNfFbnEuDaVHAgWCrUpNyIM4K51NwbPFu88Ml+S6bQpgrpt Dp8QCr0T5ND4gtwi49Uqy84n9pjftDRTFfx+3BOfaFWLXYl+xipo0YMN92HcFnIhIiOT ZEAE2We8PA2ndeExMPYMK5gKkXVwwjklMBeh8MVM4iVd/AGnynGYVxTwYO5THy3Lw8w2 WXMUsByrIMayIRBeHy8cKq8c+Z5VaTYLTHZVVjLoD7ot5jFwwNpGcTEcX3emRnDtdQ7V aIYWAEM9U90bqRfUI3qqaWmz2QxqOaoltrtqnQ/9eubsb/iTkyTxxOUktM4/dQJbFvLC Gbjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UyAauvBmSug4drW2djAafs3kx5pIR74OsbYQ7t+MiHk=; b=yMySi5tDcBn2bJFvc3OWUGRz2R3ql/xTBQpy+Xgst+IkgdzF9Y9LPZPCf8FPugfIVg 1yg/W7llxmAzgNNAVeZUEfGzflcReufBzru/vDBnkKw5M6mvBM8peoT80GqSice8vDQt qti/ue2e4PnUOl39fvk96ILck8uz4jKFFHiZyRGqu+ETVAOY+wEvsz0AnTTbgFDqSXSv Mof0fj/8ElSx2z27hYYEaqkZ9f3BaexdiYbUziZI3CRYtD9xX5JIkM9/zdhmSVEceU1J TYIZjeN5DaXBbCaol83YwW95tU8n+XMntXh+mCCN1fM4LhTuCvhj4JZlN2+iBI8R+v4W 764g== X-Gm-Message-State: AOAM531+C9WsH6ZMH4vxC7KQpRVOAgx9KrXB7ncCCL0jjwdgwr48rIPE 5xIx/HEkC50YtYTZgfE+63w= X-Google-Smtp-Source: ABdhPJzRxPR578U9VrO4mTXK05SGSrj85tZo/tsYiVS7CcggYY/KOOeGbRFGb3h5G6xpzMMwJPQXhQ== X-Received: by 2002:a17:903:11c7:b0:151:7290:ccc with SMTP id q7-20020a17090311c700b0015172900cccmr11479019plh.95.1646220404646; Wed, 02 Mar 2022 03:26:44 -0800 (PST) Received: from localhost.localdomain ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id z18-20020aa78892000000b004e19bd62d8bsm21425155pfe.23.2022.03.02.03.26.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 03:26:44 -0800 (PST) From: Like Xu X-Google-Original-From: Like Xu To: Paolo Bonzini Cc: kvm@vger.kernel.org, Like Xu , Jim Mattson Subject: [kvm-unit-tests PATCH RESEND 2/2] x86/pmu: Fix a comment about full-width counter writes support Date: Wed, 2 Mar 2022 19:26:34 +0800 Message-Id: <20220302112634.15024-2-likexu@tencent.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220302112634.15024-1-likexu@tencent.com> References: <20220302112634.15024-1-likexu@tencent.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Like Xu From: Like Xu Remove two Unicode characters 'ZERO WIDTH SPACE' (U+200B). Fixes: 22f2901a0e ("x86: pmu: Test full-width counter writes support") Reported-by: Jim Mattson Signed-off-by: Like Xu Reviewed-by: Jim Mattson --- x86/pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x86/pmu.c b/x86/pmu.c index 3d05384..052c2b7 100644 --- a/x86/pmu.c +++ b/x86/pmu.c @@ -587,7 +587,7 @@ static void check_gp_counters_write_width(void) } /* - * MSR_IA32_PMCn supports writing values ​​up to GP counter width, + * MSR_IA32_PMCn supports writing values up to GP counter width, * and only the lowest bits of GP counter width are valid. */ for (i = 0; i < num_counters; i++) {