From patchwork Tue Jan 17 01:35:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Reiji Watanabe X-Patchwork-Id: 13104015 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 3266AC54EBE for ; Tue, 17 Jan 2023 01:38:05 +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=ztdi4qTteAUNE5miPCkn/pk9LwcUeFsmX+MGJWj1G24=; b=5Fkbaa9DMAin/HXAN0QvjG8POR +dxEF/Kj7zURmbFZ8kaG4N5OJNVxPPaL3YGYwrED23nWWDiGXw0q30xApyAZZPEZT4LGx34qGK+vT wez0IzojIMwPn5K4u1NsKlCg9YEowAQpFYgtMDEm/LH9P50jJDhyf/tgALVfmPjF4kmU3veDcE2ui wEZYNZLkbRW0XxlfQ2iCuZWzCeO4PQn4b/jB8Xm4mT4W4he5zKP4SQCJl6lRia4ZWZbmLbP+IOu30 9Y1xqKROw2SJuQZSp3mVfbHu9f/Qq3fxjmrdVhqoYdJMepTNPh4OgP7Rw34FQ9XE0z0qHs5Korrls u5q13ZDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHauR-00CUtu-VO; Tue, 17 Jan 2023 01:37:08 +0000 Received: from mail-pf1-x44a.google.com ([2607:f8b0:4864:20::44a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHauP-00CUsF-Fc for linux-arm-kernel@lists.infradead.org; Tue, 17 Jan 2023 01:37:06 +0000 Received: by mail-pf1-x44a.google.com with SMTP id n27-20020aa7985b000000b0058dae392ac5so1599586pfq.10 for ; Mon, 16 Jan 2023 17:37:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=eC9TU+b1AulwCNQH9iDH+DAro1tSq5M9VVS0yBGcwEk=; b=pTfHbn8ECPuNLNJ2Du97YQ7SgX3rG2N1cPqBY0/gBrCiyAo0wNNJso7a5TAIuh4ML0 LEshQKaWSd5UTKoQApFyvOZpi4Ti00acwDmnhhA9HsjoWA3rTg5ZykzvrrNt7vFxO/C/ p1vg6AGjXPg7vvdJMCBh5OStNOaDF2Ux3yg0qrNskUBDrxzp7+L/bxe4gSSXI6mG+1YI ccaX9/iuVnPqZ6yr7WChriNCwdTqVROaP9Hy8UPl2mIIXQd9StFVSaKgsxhxDObNVfXx l7QzMU9Yid6Q53qTYfHNKhYL2ROX6Uy4yxDrzQ9+5Qx7tJRI+v5P1rcTL00+4WcM3Lrn Xg7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=eC9TU+b1AulwCNQH9iDH+DAro1tSq5M9VVS0yBGcwEk=; b=NzkGB3vFJtgoFQuBeeFkVImURWOwxU+O78dvB55M00NdKIlhxjUYdrH73WBGLcZHel /qxEEw1DYgIHNaXu3o711pRj2dEKvoHa9Dj0yy/tulXkLGCiTSjQclZYZnvCiWONldUx /kk/EnUEvlVtBU85xiSkMECjcV0q7/nAtYAWWAjDjSa4C7GfR7SuPrQ28IXbToRt7FRW DBvs78Rqk0zd+JeWkHxrBN1W0II6hi/s8tbuZFuuomC0RE5zqXMa7RxK2EmWz1KlatWI I7EhKYP82J8mafAgO57oQGrj+9KPmN1AdHeguF89FqfHfet8hl9JbF2p0IJ3cbqJN0Ql rU1g== X-Gm-Message-State: AFqh2kpzYaO5LQFQ9S7Z06LZmMkDK/o/dkzOxZdCDi2loIQmLvKecSYA uApSXlRLRCN7c1l7UhecWb8guvqXPUk= X-Google-Smtp-Source: AMrXdXvUPDxrn4y21UKMvAWORpGeWfa/Ug/LOec+T5MpYmnHhsOtI7V0f55wuovNZa71BqVMEl3XpaOGjK0= X-Received: from reijiw-west4.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:aa1]) (user=reijiw job=sendgmr) by 2002:a05:6a00:1401:b0:58d:9483:734e with SMTP id l1-20020a056a00140100b0058d9483734emr121553pfu.55.1673919423000; Mon, 16 Jan 2023 17:37:03 -0800 (PST) Date: Mon, 16 Jan 2023 17:35:36 -0800 In-Reply-To: <20230117013542.371944-1-reijiw@google.com> Mime-Version: 1.0 References: <20230117013542.371944-1-reijiw@google.com> X-Mailer: git-send-email 2.39.0.314.g84b9a713c41-goog Message-ID: <20230117013542.371944-3-reijiw@google.com> Subject: [PATCH v2 2/8] KVM: arm64: PMU: Use reset_pmu_reg() for PMUSERENR_EL0 and PMCCFILTR_EL0 From: Reiji Watanabe To: Marc Zyngier , kvmarm@lists.linux.dev Cc: kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, James Morse , Alexandru Elisei , Zenghui Yu , Suzuki K Poulose , Paolo Bonzini , Ricardo Koller , Oliver Upton , Jing Zhang , Raghavendra Rao Anata , Reiji Watanabe X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230116_173705_566624_7A0CFA3E X-CRM114-Status: GOOD ( 12.50 ) 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 The default reset function for PMU registers (reset_pmu_reg()) now simply clears a specified register. Use that function for PMUSERENR_EL0 and PMCCFILTR_EL0, as KVM currently clears those registers on vCPU reset (NOTE: All non-RES0 fields of those registers have UNKNOWN reset values, and the same fields of their AArch32 registers have 0 reset values). No functional change intended. Signed-off-by: Reiji Watanabe --- arch/arm64/kvm/sys_regs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index ec4bdaf71a15..4959658b502c 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c @@ -1747,7 +1747,7 @@ static const struct sys_reg_desc sys_reg_descs[] = { * in 32bit mode. Here we choose to reset it as zero for consistency. */ { PMU_SYS_REG(SYS_PMUSERENR_EL0), .access = access_pmuserenr, - .reset = reset_val, .reg = PMUSERENR_EL0, .val = 0 }, + .reg = PMUSERENR_EL0 }, { PMU_SYS_REG(SYS_PMOVSSET_EL0), .access = access_pmovs, .reg = PMOVSSET_EL0 }, @@ -1903,7 +1903,7 @@ static const struct sys_reg_desc sys_reg_descs[] = { * in 32bit mode. Here we choose to reset it as zero for consistency. */ { PMU_SYS_REG(SYS_PMCCFILTR_EL0), .access = access_pmu_evtyper, - .reset = reset_val, .reg = PMCCFILTR_EL0, .val = 0 }, + .reg = PMCCFILTR_EL0 }, { SYS_DESC(SYS_DACR32_EL2), NULL, reset_unknown, DACR32_EL2 }, { SYS_DESC(SYS_IFSR32_EL2), NULL, reset_unknown, IFSR32_EL2 },