From patchwork Fri Apr 8 08:40:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuad Tabba X-Patchwork-Id: 12806297 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 C129CC433EF for ; Fri, 8 Apr 2022 08:42:41 +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:References: Mime-Version:Message-Id: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=5cfl5Ii4TecSbuj2FKgto0/xOujA56VpPVYhAS8nZrE=; b=hIURz+BmMRKwuHW9lIAHUSiyVn v/9lQFsM4S2qu465dubVnfzGT1NCaJm98Noqr5HrTVMcuvXAlj30vB/0AVyKsKWwe7yEOzX4tpVuU igWEmpNR9HhNgyKYrgkFSxvrCnkZOYpWFNhhRtpfiQX1D3BxbKIoE1gmhih1XfM+DeFXbWNlmj+02 dHInghWNGz+eEnOp8unqSzbpEM+1gfyYbN1dwKnVe+EVOiI9QNe3n60mGAKaRyBnEoNSzy1FTz8yi 6H+RtniwBqyXZFW2CnVN+yBJDsCvdqUcg+oYFbVlt1O2EPvnsnnF7sr5eKQWzqtmy41RRCys7s0vi /cjmHa6Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nckBY-00Fxki-GK; Fri, 08 Apr 2022 08:41:40 +0000 Received: from mail-wm1-x34a.google.com ([2a00:1450:4864:20::34a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nckAw-00FxYT-LL for linux-arm-kernel@lists.infradead.org; Fri, 08 Apr 2022 08:41:04 +0000 Received: by mail-wm1-x34a.google.com with SMTP id z16-20020a05600c0a1000b0038bebbd8548so5672055wmp.3 for ; Fri, 08 Apr 2022 01:41:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=Qfv1bEj/1FaZXZU3R+WtmBHPG36iPZiljshgmhtHSRY=; b=q/pdDMcK5gprrylAUTYuOJZsZkavUx9FZWlr6Hs4uzxrrgeJy35Zd+3fz60kJpOjMu dzbOB6q+f7xOq/kVh4PY2Mxr8iSJR5mFtc2hS3ixQy6nq0jWtNz/7x4mBeErP9DBsydD JLTWEWl9IT91vQUdT0mvUJMnPOil8xbOOWLJCDAItOiZ/+IRQpJVx3/THcnT+pGaRtuF ybDszdnnKKI0vbUzcs90ztabWpRLnf93OJRUDyI/OZSCUaGuA3wv+Cmnl9w+K7LRojNH 5cszeXqxYCftWDslzXHt+RB9+227nWxefKDyCW3kn/UeoBlaRF+nD/ECzBghKNdn/BAr zkwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=Qfv1bEj/1FaZXZU3R+WtmBHPG36iPZiljshgmhtHSRY=; b=eA1QrLSqobHA+N5RjQt+CF9EUmARCquKcyFpBO2Mr0P02MPKiykiEKK2QPtcZ22sXo 0LCObx5BgoYHh3hEZN4R5csHxJEChzOQW7QccB+oR2sjvSTGRqrtvLGBtjXiy/9Kt5LK CktNkAGY8xTTSzvohsao7CESWF4kRpkdboTAl97L15BsADN75O3KiYjg52zqg+lC5l5Z LNhFY7ytNdmd4mFyzjtArHC/MmJVT9K54BfIDuVtSCK07nnuDTuVeyqHHpDtGirgwPVq 33SfWnOuxmepIa6NcFlyw/oKGfw11PtvL1e9e9ru446mWbvpAkkFIrYzGmqXuuxsThP2 g5GQ== X-Gm-Message-State: AOAM532zi8EMkYari047qe54QuFiePOfwYQGY6MdnuIQ1anzvqn4Da/d sdLRmj88zQC0R8A1JpadJRzqy6E6IQ== X-Google-Smtp-Source: ABdhPJwmyP1B7N90b76cR/52rVQeb/UL9ovxCWsDFhyyeP+/wTKdRHU8ZL4uAjL3dvwe4mBAIoTQowRf5A== X-Received: from tabba.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:482]) (user=tabba job=sendgmr) by 2002:a05:600c:4e92:b0:38c:73e8:7dcd with SMTP id f18-20020a05600c4e9200b0038c73e87dcdmr16307000wmq.196.1649407260887; Fri, 08 Apr 2022 01:41:00 -0700 (PDT) Date: Fri, 8 Apr 2022 09:40:52 +0100 In-Reply-To: <20220408084052.3310931-1-tabba@google.com> Message-Id: <20220408084052.3310931-4-tabba@google.com> Mime-Version: 1.0 References: <20220408084052.3310931-1-tabba@google.com> X-Mailer: git-send-email 2.35.1.1178.g4f1659d476-goog Subject: [PATCH v1 3/3] KVM: arm64: Reenable pmu in Protected Mode From: Fuad Tabba To: kvmarm@lists.cs.columbia.edu Cc: maz@kernel.org, will@kernel.org, qperret@google.com, james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, catalin.marinas@arm.com, drjones@redhat.com, linux-arm-kernel@lists.infradead.org, tabba@google.com, kernel-team@android.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220408_014102_778753_C69F7651 X-CRM114-Status: GOOD ( 11.03 ) 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 Now that the pmu code does not access hyp data, reenable it in protected mode. No functional change intended outside of protected mode. Signed-off-by: Fuad Tabba --- arch/arm64/kvm/pmu-emul.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm64/kvm/pmu-emul.c b/arch/arm64/kvm/pmu-emul.c index 78fdc443adc7..dc1779d4c7dd 100644 --- a/arch/arm64/kvm/pmu-emul.c +++ b/arch/arm64/kvm/pmu-emul.c @@ -756,8 +756,7 @@ void kvm_host_pmu_init(struct arm_pmu *pmu) { struct arm_pmu_entry *entry; - if (pmu->pmuver == 0 || pmu->pmuver == ID_AA64DFR0_PMUVER_IMP_DEF || - is_protected_kvm_enabled()) + if (pmu->pmuver == 0 || pmu->pmuver == ID_AA64DFR0_PMUVER_IMP_DEF) return; mutex_lock(&arm_pmus_lock);