From patchwork Sat Aug 19 04:39:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reiji Watanabe X-Patchwork-Id: 13358509 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 9F24FEE499C for ; Sat, 19 Aug 2023 04:40:54 +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=JLrF+xsdwp3+xF/+VmVdkNbcuHxNJOofqyVcwc1209U=; b=Xovv/HCO+NRj4lhsdz0ThfcXO0 dtP9U8CPwz9z2ZHl90Gnq9gCzYQ0SJxTL65lI+GXvBY+4Zf7in90Bxo0aKdlO1fQUPAuwSmgWXnnb UBIrwj0RaiNYWGdEJIELnxM5ZuRy7MWQKlocwiwvMnRuJt6Pc9XLwxEwv+ayNEmVUa2R9GlsURajM NJ92qKN0QpsHKZDMqVXN/YM5LpNmhBR5Htb4g8NOfryN85WOFhcV2j+usobAJ/jmlUSNNE21HIvTK 4UdJ14qcx2tG7mfH68wq//XTwjBS3ykbi9EcMTZdoolTKQh6NWGTT09FoFD1WjNMzeQI4mFlvPtRf K4U6fmrg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qXDlA-00AOX1-10; Sat, 19 Aug 2023 04:40:24 +0000 Received: from mail-pl1-x649.google.com ([2607:f8b0:4864:20::649]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qXDks-00AOUL-0t for linux-arm-kernel@lists.infradead.org; Sat, 19 Aug 2023 04:40:07 +0000 Received: by mail-pl1-x649.google.com with SMTP id d9443c01a7336-1bdba3f0e73so19434185ad.1 for ; Fri, 18 Aug 2023 21:40:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1692420004; x=1693024804; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=AKUPjh6oK/AHt5DTbKeyntJhoH5vBBMqS9Q93jlsqh4=; b=BPxNSvzkcI0KKZBmZ9vQvp3Q195xCQ7XrW3Lauqrxtr/suDRr1vREqQ6vB0KZFVGix Bxkmn7EnM5GCcYKazSBbCKPV+sFDRs/+mMkUV2cVIR0H07p0pVTDSh346xHr3B1jj/qF 8j6a0sb61kLuc3SOBP1x/1UMwSYQRmRPiyVh1zREs9bZlxecSC8WsR7qh9L+sC+N/K05 kWCXI/PsQN2twFYHmk/cQKV0p0kWlPmLVsKhcDHr4hb2xWzVsDAMVK9Cjj3Zg4JKyWX+ MHfewnRYEQUQAwbZ5umk4yK9/Xt7w+UZHhpnoHY4iCzxxE+48gCwKIzm4pTEwl43HG19 av3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692420004; x=1693024804; 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=AKUPjh6oK/AHt5DTbKeyntJhoH5vBBMqS9Q93jlsqh4=; b=FlEZq5durXcxztLgvmRfuBoTFmgUjqy+r/SXW1TfRhQZNTVmGUPkgD0dbQkXGUzyhQ repz7aoZ4g8DfGjnJFEkHKwnCUqdTP4pq2f7lS6R5QFx9piEGWDR6WmmQ3zS9xA3gnFU Qc+Wj7qTU0rF5Lkn+YtPAWH92f+RdPOcHFuBz/WH28NKx641GNuD+63fnXEI4NJIzv4B iI2JmmHOtL0Qep9lucOXkZPcu1GFX5gXfr6LB22epV+oba8ZaCUuz/Kd+nS0tGNr4usL QdrmFg53w3rSIkg5rZAdMhJmaUc/TbVqLJkZuHLaXo+GEO7M+eNuP5okEANj02DYHYce 2e4w== X-Gm-Message-State: AOJu0YwKAgou0QKBX3CDWVgxVOvYRtHaUB1fa0VN3NhIqBiLxDn/o0DJ QbrPHJoEwnW6Eo+DKtnqmx+pNmj/mzI= X-Google-Smtp-Source: AGHT+IGLxzRdP1MTKcNfYnDsSILLHW1aOrghtWBJGgIJIi7ddCSua7RomiZDF2YXdMVwaolTy42XkIptf6U= X-Received: from reijiw-west4.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:aa1]) (user=reijiw job=sendgmr) by 2002:a17:902:da87:b0:1bb:83ec:841 with SMTP id j7-20020a170902da8700b001bb83ec0841mr490814plx.6.1692420004335; Fri, 18 Aug 2023 21:40:04 -0700 (PDT) Date: Fri, 18 Aug 2023 21:39:47 -0700 In-Reply-To: <20230819043947.4100985-1-reijiw@google.com> Mime-Version: 1.0 References: <20230819043947.4100985-1-reijiw@google.com> X-Mailer: git-send-email 2.42.0.rc1.204.g551eb34607-goog Message-ID: <20230819043947.4100985-5-reijiw@google.com> Subject: [PATCH v3 4/4] 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-20230818_214006_311244_B162E4E1 X-CRM114-Status: GOOD ( 11.28 ) 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 b9633deff32a..6b066e04dc5d 100644 --- a/arch/arm64/kvm/pmu-emul.c +++ b/arch/arm64/kvm/pmu-emul.c @@ -758,10 +758,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; }