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: 13332276 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 E0877C0015E for ; Fri, 28 Jul 2023 18:20:40 +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: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:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=t6shev2FpGn7et9Aq6qzTUiAiGttKXd0e9yOV6xNdPQ=; b=YNUY58NWlvTE+ZzfrDo7ldpKB1 qBOQAZX01H/y9IA9CGEHDEJLOGYlyejkwPlvgU1q3z8dISKZSqpIiXucmCBc8HphYeHNIvFNAPfz+ 6AcBbA89b9QQ/ToqXWfYf/HDSxc76QvFvJIVXl3uHi9K6Augy637wd5mYdEhLRb18eaC95paSeYRZ 8Dcz7gAsjUUYc6YLTlb/SJlj3uemuN5+StGTB53K05j+9WEL2WPme9LgXlknKZDg67muVbe9DT+Yk UPOo3YSD/PhUbvUAD3XAmZ2SydjsmGjmigWpBFk1+nc/iM0uAGdWseYgUcZSGQfPiK4P49wCrzCHG s53yiZoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qPS4c-004THy-2B; Fri, 28 Jul 2023 18:20:22 +0000 Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qPS4Z-004TFs-2w for linux-arm-kernel@lists.infradead.org; Fri, 28 Jul 2023 18:20:21 +0000 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-583fe0f84a5so25129717b3.3 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=GYmwFKoLV2/8NATYxdp3NxktfxUfyuyQka1uhGT9qF8DDnlyISM3FPWzl7h19sh3Vs uY9gVIDYdwhYF2Lf3/a2XTAOgjNKU2TT7uQvOihgrwRtx2hBiTIGr1D+Yd5h9D/4nO3V nGnGquSkn4m4+6mHE3xn/enqS2qoE+1w0JMbGOA8yvoH4tmiRMKIFffV3CIhIiTz/oWC ZA9Wk+KW265fedzY3C1ididg9Ut/Y8JzCGCixJBs+e+iSOtwj3mquWk+Iea3IZ/powTu D+xOWwC1AZCFHVyjz+6uU11p4s1az1feeNhhNZ0GwGylEEuJDW4yMq+wE/qlykMWeaXZ kpfA== X-Gm-Message-State: ABy/qLbnvxPXz3jO5EqO7YZzK8G9NC074mot5qNbfykdmhi4IpAmN/ga XSPB52NChesQKRv+0H7f9M7sly9l3FI= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230728_112019_954111_A55285FB X-CRM114-Status: GOOD ( 10.92 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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; }