From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 468AFC433B4 for ; Thu, 22 Apr 2021 10:45:23 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D6C31613C3 for ; Thu, 22 Apr 2021 10:45:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6C31613C3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=sipXNluWpwtwFUIoaXcrw2pYpJtie6RKYzKx/l/YcP4=; b=VRK+wuj4U4KFglDhPVVRJ/7cq jUZ0wFPKwS9ToyjVP6cYSS6SrvHW1sLsD68nk7+6DTVppGEGirLlgrE4leJ0zEYYi9Sf48n8SNeho F+wAglgeIB1zKzN7gmNMOHZG/ijvsulAY7huoZAZQ5IE+J6kGpnDPHW6f1QWtZkD83TDMMqu2Rf6A vNizoFyMQteasR3IfZaMex1YB8toQ363fzlyriGek6CqkH8evStRFrzIESEpOjB1ulRH8misHRbcm ECbKprnbkAp3i0Z8J47DODwM+3Qs2qF2rsW3QeJIPepTOif7ZRu4/bQRsRXv84AMcsu+fiM6bOu8a k61Sr28Ag==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lZWo9-00GVJS-S5; Thu, 22 Apr 2021 10:43:42 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lZWo5-00GVJ2-Je for linux-arm-kernel@desiato.infradead.org; Thu, 22 Apr 2021 10:43:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=kAVYTuVBfzifmwST9YWNnSTg29AJQCyrMTscTui+AXs=; b=tBN0AZCBurDhskVWkGJTWy2Rey Dho+NXDtBoP6jZk+jO+6He88FkKrgwqo70ra/upMsiDJA5mAWIfriDLbanQoDd1SrWRD3B5Ink4lx /I2Wl40uCVG+M40mbMAuqWba/0wTx56LhaKWzCvAknt2sCbueG98JZUH0iXBuAtHkbFlUAb5Oegpo Okt5CSPG2lsTciQP/psK3+OYhpaqYep4fywMEcJgWg7O5tqkAIsqQw5t/wfwnkWq5wi6kkmNoyqmS 1kq70RPJIq9L2EVWZILc1tWabRaBlv1j+t/iNo1KNWgM+DxlgQ9TIszs532Vi3LX9V6HlLDZLJaTJ B0HGV/BQ==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lZWo3-00DaXI-4N for linux-arm-kernel@lists.infradead.org; Thu, 22 Apr 2021 10:43:36 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id EC3FB613C3; Thu, 22 Apr 2021 10:43:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619088214; bh=R8WtOHNj+/vk47cusAz7Di0unsa6rOD5nce0ZJvBbNA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Pv3lOJjOC3h2kDfka9ri27gZcUMB8VEyrTNgwHgulcfk5rxqf4vWQAs+9f4/gOkt4 q1K3IywZtSZmfuAuIV1QlMAUjPELcnGmE+E6Q026430OI045oc9fdo7XHAtntCWx98 HrWrGalnCPFn5nmiuwtowUrC/HJgymZi/N/SPpHeF+WemaKXveP8zNQFVsLG2r+1U5 HbcS8855VzvPFetj1B3nDnzltb2SYqfePUXA1jdPD22flPn/kWQngnV9RR9Z/YwqoY 26f/HjDjK0J7nMqMw15ZClfInqScIhZ30PQLcQAPeEphwJqk8EnwbzQZC3oFbWjVKj m58DmUXn1KEpQ== Date: Thu, 22 Apr 2021 11:43:27 +0100 From: Will Deacon To: Marc Zyngier Cc: kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, Mark Rutland , Rich Felker , Yoshinori Sato , Peter Zijlstra , Arnaldo Carvalho de Melo , Christian Borntraeger , Heiko Carstens , nathan@kernel.org, Viresh Kumar , James Morse , Suzuki K Poulose , Alexandru Elisei , kernel-team@android.com Subject: Re: [PATCH 1/5] KVM: arm64: Divorce the perf code from oprofile helpers Message-ID: <20210422104327.GC1442@willie-the-truck> References: <20210414134409.1266357-1-maz@kernel.org> <20210414134409.1266357-2-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210414134409.1266357-2-maz@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210422_034335_238962_E7FF35D6 X-CRM114-Status: GOOD ( 21.46 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 14, 2021 at 02:44:05PM +0100, Marc Zyngier wrote: > KVM/arm64 is the sole user of perf_num_counters(), and really > could do without it. Stop using the obsolete API by relying on > the existing probing code. > > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/perf.c | 7 +------ > arch/arm64/kvm/pmu-emul.c | 2 +- > include/kvm/arm_pmu.h | 4 ++++ > 3 files changed, 6 insertions(+), 7 deletions(-) > > diff --git a/arch/arm64/kvm/perf.c b/arch/arm64/kvm/perf.c > index 739164324afe..b8b398670ef2 100644 > --- a/arch/arm64/kvm/perf.c > +++ b/arch/arm64/kvm/perf.c > @@ -50,12 +50,7 @@ static struct perf_guest_info_callbacks kvm_guest_cbs = { > > int kvm_perf_init(void) > { > - /* > - * Check if HW_PERF_EVENTS are supported by checking the number of > - * hardware performance counters. This could ensure the presence of > - * a physical PMU and CONFIG_PERF_EVENT is selected. > - */ > - if (IS_ENABLED(CONFIG_ARM_PMU) && perf_num_counters() > 0) > + if (kvm_pmu_probe_pmuver() != 0xf) Took me a while to figure out that this returns 0xf if the hardware has a PMUVer of 0x0, so it's all good: Acked-by: Will Deacon Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel