From patchwork Mon May 9 09:55:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fuad Tabba X-Patchwork-Id: 12843277 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 37AF1C433EF for ; Mon, 9 May 2022 09:57:34 +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=5OcCK5Fc4GtKsDsOtpoYwDkYqHjtC1oJjo+Y5Ji46WE=; b=VOersVwDmB8UZSKsJmcH0h5XcY tbAJQGo02FsZl69+PfWodS34+qL+ngCAbgZCz9TLmwABEGCix9LQA9MOYD75fVm8vqQqwiIuiCauq 7saHUB/Zgk/tXLNhXnnY1jlDt7mZYjeqZghwNpu9FvNyCKMtNXcUH23xSTb1Dh/KOqQdPX1NZ+TjZ HT2cRH7caUHuL9ZtAw+cOXCW0HcJhtaB15AFge8Y7zhOrBUQJvXTvjfHQn0j/mcmdsqIRxaeYvdO4 GPG08RX+mn6VNi+tCqFmZIIgoLs6AeMsvnYytc1TJLL2QzL1QwCVAo6XhJZYihUhON4O5S+b1HN0k tOPnQufQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1no07y-00Dbys-Ay; Mon, 09 May 2022 09:56:30 +0000 Received: from mail-wm1-x349.google.com ([2a00:1450:4864:20::349]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1no06j-00DbMZ-IG for linux-arm-kernel@lists.infradead.org; Mon, 09 May 2022 09:55:15 +0000 Received: by mail-wm1-x349.google.com with SMTP id z23-20020a05600c221700b003942fd37764so9653004wml.8 for ; Mon, 09 May 2022 02:55:12 -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=PhvZKBoe39U/3XMHmUVWsW2UFiJi51cRGJG2oMiPjk0=; b=gy9Pr03wH/mN/XB3LzRNi4hBUvdoPadX+6gSpKuCnO8uMZaRwee/T/cXmhwHPp7jOf UXJsDe4l5e5cWjkkXmPZ2VygdY5RrxCx4vLOlHuU4uWoxadyDvAiVPXbzEGX8PfF/I49 8X0EwOD9sETBcgUs4v+jKjuwUVo0OLMz5UQcbAL4VgtjqJQAXSjKbdh932vy1h7GQhDw k2dsFcS6jW843fUNI9r74FSxB569wCmInL4kHIoaA7FUMoSVmU5bMkfmKXNQtyjaw6vh OeRDNDDn3tM3aT8iyen4UTmwruuADa7fq9JoG5BbmOdevUKa/P1TlUVOXgAErFdIx0ZU gLSg== 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=PhvZKBoe39U/3XMHmUVWsW2UFiJi51cRGJG2oMiPjk0=; b=GeYG5l9oLnyc/oKj7d2b1TQMmArEjcESboTrsByN+MzydiUMYQWXu93vtIM3z7Z4Sp cSAqM7e5d9LgRPfK4rFa8Bu8sqgWhaWh8oKkhO8q4NfYWZ6YrGBOwdZ99x0jyMJnLUuF dqbIUEuOMxBzobeR9xbkVxVeeZOUp9sgMcedPoVq4wunIPhQ2Dk4c9olYNlRRH1TEBYj MgW02Blng2O5nOKKO2q3/8iY/ca0PSPodtmIM99UpT008oKHBi8horHVXGdeNjcqfs5Q 2tVVZYTC3LUKIYmur3sbQUULjZ6dUrhh5gZF+LnbjijRNdS5FS0xtWqEp+ncR38gGSTG RN9A== X-Gm-Message-State: AOAM530WrdvJPhr5aHGxbkpZijM7mNf0lVmRisGj0xX7ZOIOO/eJAVkc bZuOHKy077sBV3/kRyS4PIQc0Ry5yA== X-Google-Smtp-Source: ABdhPJyQpUMf+PyLIdfmlviF5r7R4hnQrrGQnxivrS16KdcOz4sztzVanuIea+fT+sX8qxj68vsB+2uq4Q== X-Received: from fuad.c.googlers.com ([fda3:e722:ac3:cc00:28:9cb1:c0a8:1613]) (user=tabba job=sendgmr) by 2002:a05:600c:2102:b0:394:2765:580c with SMTP id u2-20020a05600c210200b003942765580cmr15172324wml.150.1652090111772; Mon, 09 May 2022 02:55:11 -0700 (PDT) Date: Mon, 9 May 2022 09:55:00 +0000 In-Reply-To: <20220509095500.2408785-1-tabba@google.com> Message-Id: <20220509095500.2408785-5-tabba@google.com> Mime-Version: 1.0 References: <20220509095500.2408785-1-tabba@google.com> X-Mailer: git-send-email 2.36.0.512.ge40c2bad7a-goog Subject: [PATCH v2 4/4] 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-20220509_025513_692283_E7ECE009 X-CRM114-Status: GOOD ( 11.26 ) 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 08d0551a4e43..cf15d510c06d 100644 --- a/arch/arm64/kvm/pmu-emul.c +++ b/arch/arm64/kvm/pmu-emul.c @@ -777,8 +777,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);