From patchwork Fri Jul 28 18:19:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reiji Watanabe X-Patchwork-Id: 13332259 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 C2060C0015E for ; Fri, 28 Jul 2023 18:20:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235868AbjG1SUX (ORCPT ); Fri, 28 Jul 2023 14:20:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235910AbjG1SUU (ORCPT ); Fri, 28 Jul 2023 14:20:20 -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 50F724487 for ; Fri, 28 Jul 2023 11:20:19 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5840614b107so25167017b3.1 for ; Fri, 28 Jul 2023 11:20:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1690568418; x=1691173218; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=2xpjPS24yC6WEaeqRzU4H7WlQVocjOmJ6iEHs3rd81g=; b=sb2e2ZicSoE/37geVNg2mh/h4mq9S8CUzH9QMg9+39Ayh8kR7c1EYB4Rv3pgMM7fq2 QAWPYWqDZ0lg+u3wNr50hD1JBmCXsagcMNol3qqVr9A0Vaea+UjBHyulaWRkhlkhQkjN GEfMqAftZfvBNVxT2Q25jJkD+pTC9PKkFy+XMJXNRl6qj2ev1nN4xMLBqXAy0Sx7PbTO 1AcTIVQeGb4HHnP8u+0VTSD22iyXQFDSnjl1bKavsRMD562NrSOYP8OX+vPoK5rm51wU 2JJFJzQFz4VzSFyooEzfTWRn/QQh0WwgNySDamrd97nPZoLr1WbDBpDtf1SlqKVsVSoT TmyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690568418; x=1691173218; 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=2xpjPS24yC6WEaeqRzU4H7WlQVocjOmJ6iEHs3rd81g=; b=d+siEfuWek5cjKk8YIAwD0y9lV1See9I4nX/H4QZVYFiutk1Gb1V5ZfXC1GsW6pLW2 FPDQfwa/EFf2TtXenijYzCdDxHRHDXD0qFGKJyukpfStk3+MT+bf3BdZZpsFwx4HlGrj ySo5bDuxYBP4YVYfHE6HGAcax5lUBmR6VqaZA0GQ6ne1JuntWLiouYpqo8gZroVnzwJs SvhvqHcyv9a+zvNKnHLMQ3GJB0dsHsO1o6Z8I3UHtJ4EmTR+Lw6tvdD/qJ5zrkg+cccv p1Vx2LVKuY0cofH87sxme5Fe3HNPabopg9V6ZpQajegUpDZqAPaS8ZvRk1gu1HW4a68c g71A== X-Gm-Message-State: ABy/qLYYvEADnf1bJzl1fk+wvh0jb4UKxq5vX+UyenJ/XX0DscPfqwXS 76DpTDpTwpLl4o7cHFWc747I6SNSLZU= X-Google-Smtp-Source: APBJJlGGMEKDyFVWW5wq3CmTjmWkAG6EK1Hulf1y3IEUhbUXkjIOZDJYusNOd29d4Wx+PcVgk7IhawHjcJc= X-Received: from reijiw-west4.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:aa1]) (user=reijiw job=sendgmr) by 2002:a05:690c:708:b0:583:96da:32dd with SMTP id bs8-20020a05690c070800b0058396da32ddmr20691ywb.0.1690568418572; Fri, 28 Jul 2023 11:20:18 -0700 (PDT) Date: Fri, 28 Jul 2023 11:19:07 -0700 In-Reply-To: <20230728181907.1759513-1-reijiw@google.com> Mime-Version: 1.0 References: <20230728181907.1759513-1-reijiw@google.com> X-Mailer: git-send-email 2.41.0.585.gd2178a4bd4-goog Message-ID: <20230728181907.1759513-6-reijiw@google.com> Subject: [PATCH v2 5/5] KVM: arm64: PMU: Don't advertise STALL_SLOT_{FRONTEND,BACKEND} From: Reiji Watanabe To: Marc Zyngier , Oliver Upton , kvmarm@lists.linux.dev Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, James Morse , Alexandru Elisei , Zenghui Yu , Suzuki K Poulose , Jing Zhang , Raghavendra Rao Anata , Reiji Watanabe Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Don't advertise STALL_SLOT_{FRONT,BACK}END events to the guest, similar to STALL_SLOT event, as when any of these three events are implemented, all three of them should be implemented, according to the Arm ARM. Suggested-by: Oliver Upton Signed-off-by: Reiji Watanabe --- arch/arm64/kvm/pmu-emul.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kvm/pmu-emul.c b/arch/arm64/kvm/pmu-emul.c index 68f44f893b44..47a27941163c 100644 --- a/arch/arm64/kvm/pmu-emul.c +++ b/arch/arm64/kvm/pmu-emul.c @@ -751,10 +751,12 @@ u64 kvm_pmu_get_pmceid(struct kvm_vcpu *vcpu, bool pmceid1) } else { val = read_sysreg(pmceid1_el0); /* - * Don't advertise STALL_SLOT, as PMMIR_EL0 is handled + * Don't advertise STALL_SLOT*, as PMMIR_EL0 is handled * as RAZ */ - val &= ~BIT_ULL(ARMV8_PMUV3_PERFCTR_STALL_SLOT - 32); + val &= ~(BIT_ULL(ARMV8_PMUV3_PERFCTR_STALL_SLOT - 32) | + BIT_ULL(ARMV8_PMUV3_PERFCTR_STALL_SLOT_FRONTEND - 32) | + BIT_ULL(ARMV8_PMUV3_PERFCTR_STALL_SLOT_BACKEND - 32)); base = 32; }