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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 42379C43217 for ; Tue, 9 Nov 2021 23:16:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2906561131 for ; Tue, 9 Nov 2021 23:16:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231586AbhKIXTL (ORCPT ); Tue, 9 Nov 2021 18:19:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229868AbhKIXTJ (ORCPT ); Tue, 9 Nov 2021 18:19:09 -0500 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48721C061764 for ; Tue, 9 Nov 2021 15:16:23 -0800 (PST) Received: by mail-pg1-x52b.google.com with SMTP id p17so510724pgj.2 for ; Tue, 09 Nov 2021 15:16:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3iDOWhiMYVH4J/xrL04EpHxxB+pfcqrny8aFQ+9uha4=; b=VzrYqN0K7z0Tuv/HZEo98TZC4k8HLv0Bi89F+eTM7VIgt8Hd0SbLQLu1jfW8/8S8fv tzfRT3bkeDhN2PHc31X4H7Y8DtkUZW4N710CDOsPQBTQtnUWIqdFY6F7ije1Cnoj6Q+4 ppkFKf+QIHaiDGp0vt5e+c8PAWdm9ufyP9kMeDz/DPFOwmptdhrUt8KETig+vfK9Hq/N lJFBQKcjKRbfCPyMg8YrBLHsmR9t18pjj8BDwHYytNF7IYDGiDNiRxMB/BsE6ChUEAKz f1UvA+hVEnhTbq/8QIGBSxxEpmi70akY31pDC1IU1AtgFWCS0WgRlyVxJZndzjJCKeh8 qtJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3iDOWhiMYVH4J/xrL04EpHxxB+pfcqrny8aFQ+9uha4=; b=o2C2JxaDpqA+7dUREm9ImgIPpCXB9HtFOeFjkTYI8TO/zcxekDWAWDoNyfPYTdMDqG H84bdA1RZA0FMkgB72G7Qy9LtOEnAmCPU8sIWKZJWPMM6NONQpEE3ZmhaIZZE+qqoRaV LECSTdVsPFYAbt8EJS0chweMdFyWuMLOfM8S8Rkn0ftIfgCLaBIWTbxixGQ6ikwct0ro ffw2KeDGILOc4Fd+dyOCUUUVb3uUywtFqJbtX4bDvAg95GdCePziVq3VyPnfANhN15XM AALe7ym9NOfo/xnmqjRf4m8rU5uC4CUAy0LhogYxC8B2s+q+8xN9YfdQITi37KidcPub Sbnw== X-Gm-Message-State: AOAM533C9DaF4Qf4CL+vK0pWFbl+tk92OavFsMj7nh0WFNCqY5FdS6/L Y4xuBvAW5u/G1Nm2I6bRI1IiAg== X-Google-Smtp-Source: ABdhPJzkNcQryrFCiNL8a59OsXtVtP1KqfiFu5fhzV9PARw6xea5VYu1cXC91MqNZo8wxwwswlX9UA== X-Received: by 2002:a63:2c0f:: with SMTP id s15mr9035602pgs.6.1636499782405; Tue, 09 Nov 2021 15:16:22 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id y9sm3778534pjt.27.2021.11.09.15.16.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Nov 2021 15:16:21 -0800 (PST) Date: Tue, 9 Nov 2021 23:16:18 +0000 From: Sean Christopherson To: Marc Zyngier Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Will Deacon , Mark Rutland , Guo Ren , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , Paolo Bonzini , Boris Ostrovsky , Juergen Gross , Alexander Shishkin , Jiri Olsa , Namhyung Kim , James Morse , Alexandru Elisei , Suzuki K Poulose , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Stefano Stabellini , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-csky@vger.kernel.org, linux-riscv@lists.infradead.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org, Artem Kashkanov , Like Xu , Zhu Lingshan Subject: Re: [PATCH v3 15/16] KVM: arm64: Drop perf.c and fold its tiny bits of code into arm.c / pmu.c Message-ID: References: <20210922000533.713300-1-seanjc@google.com> <20210922000533.713300-16-seanjc@google.com> <87tuhnq4it.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87tuhnq4it.wl-maz@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 11, 2021, Marc Zyngier wrote: > On Wed, 22 Sep 2021 01:05:32 +0100, > Sean Christopherson wrote: > > diff --git a/include/kvm/arm_pmu.h b/include/kvm/arm_pmu.h > > index 864b9997efb2..42270676498d 100644 > > --- a/include/kvm/arm_pmu.h > > +++ b/include/kvm/arm_pmu.h > > @@ -14,6 +14,7 @@ > > #define ARMV8_PMU_MAX_COUNTER_PAIRS ((ARMV8_PMU_MAX_COUNTERS + 1) >> 1) > > > > DECLARE_STATIC_KEY_FALSE(kvm_arm_pmu_available); > > +void kvm_pmu_init(void); > > > > static __always_inline bool kvm_arm_support_pmu_v3(void) > > { > > Note that this patch is now conflicting with e840f42a4992 ("KVM: > arm64: Fix PMU probe ordering"), which was merged in -rc4. Moving the > static key definition to arch/arm64/kvm/pmu-emul.c and getting rid of > kvm_pmu_init() altogether should be enough to resolve it. Defining kvm_arm_pmu_available in pmu-emul.c doesn't work as-is because pmu-emul.c depends on CONFIG_HW_PERF_EVENTS=y. Since pmu-emul.c is the only path that enables the key, my plan is to add a prep match to bury kvm_arm_pmu_available behind the existing #ifdef CONFIG_HW_PERF_EVENTS in arm_pmu.h and add a stub for kvm_arm_support_pmu_v3(). The only ugly part is that the KVM_NVHE_ALIAS() also gains an #ifdef, but that doesn't seem too bad. 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C1F7C433EF for ; Tue, 9 Nov 2021 23:16:29 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id F176361105 for ; Tue, 9 Nov 2021 23:16:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F176361105 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 57E284B26C; Tue, 9 Nov 2021 18:16:28 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0cN8x-FF26+9; Tue, 9 Nov 2021 18:16:26 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id E3E044B274; Tue, 9 Nov 2021 18:16:26 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 2FC584B274 for ; Tue, 9 Nov 2021 18:16:25 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pF4ROAnKBtol for ; Tue, 9 Nov 2021 18:16:23 -0500 (EST) Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 96DDC4B26C for ; Tue, 9 Nov 2021 18:16:23 -0500 (EST) Received: by mail-pg1-f171.google.com with SMTP id 188so490400pgb.7 for ; Tue, 09 Nov 2021 15:16:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3iDOWhiMYVH4J/xrL04EpHxxB+pfcqrny8aFQ+9uha4=; b=VzrYqN0K7z0Tuv/HZEo98TZC4k8HLv0Bi89F+eTM7VIgt8Hd0SbLQLu1jfW8/8S8fv tzfRT3bkeDhN2PHc31X4H7Y8DtkUZW4N710CDOsPQBTQtnUWIqdFY6F7ije1Cnoj6Q+4 ppkFKf+QIHaiDGp0vt5e+c8PAWdm9ufyP9kMeDz/DPFOwmptdhrUt8KETig+vfK9Hq/N lJFBQKcjKRbfCPyMg8YrBLHsmR9t18pjj8BDwHYytNF7IYDGiDNiRxMB/BsE6ChUEAKz f1UvA+hVEnhTbq/8QIGBSxxEpmi70akY31pDC1IU1AtgFWCS0WgRlyVxJZndzjJCKeh8 qtJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3iDOWhiMYVH4J/xrL04EpHxxB+pfcqrny8aFQ+9uha4=; b=UtFkmkFoFmY20oO3Bo0cVpWRctLZLNHNLteNnVb7dym4sAA7s7vz2Kh1e7KQYYjAtK FaDihE48Xe1IRPoJLpEj10zIq/HAZ3njuGUBxPQpFLLYZ64GqVNyUIl5cMvRQfyRaBf9 JM10NMVueqaN1iVRQkU7UyMgmM7vf2skxLXckjlpkoLclhU6yks+p8gLZQl+OpTxgi9d Smw7WCjNQk5xxQnO2KsrO2J3fBunmt+q0sLiiU1LL7hX5O7YHDVjU1ep6f3Sr1IoKX1m ld+AyxIlexw3fH5zKAJCvp+P3UErpLmofAs2V/cs0ku1C6WsGnakMOnhv+7Nsqa5755J RKVg== X-Gm-Message-State: AOAM530nB1mi/APLgMMQI7jRIDKTK6llnMUDW3gL+Sx9Na+Lzs7W9xAz 8s0FZB+WRDrtGkS4gt1JUnrcuA== X-Google-Smtp-Source: ABdhPJzkNcQryrFCiNL8a59OsXtVtP1KqfiFu5fhzV9PARw6xea5VYu1cXC91MqNZo8wxwwswlX9UA== X-Received: by 2002:a63:2c0f:: with SMTP id s15mr9035602pgs.6.1636499782405; Tue, 09 Nov 2021 15:16:22 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id y9sm3778534pjt.27.2021.11.09.15.16.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Nov 2021 15:16:21 -0800 (PST) Date: Tue, 9 Nov 2021 23:16:18 +0000 From: Sean Christopherson To: Marc Zyngier Subject: Re: [PATCH v3 15/16] KVM: arm64: Drop perf.c and fold its tiny bits of code into arm.c / pmu.c Message-ID: References: <20210922000533.713300-1-seanjc@google.com> <20210922000533.713300-16-seanjc@google.com> <87tuhnq4it.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87tuhnq4it.wl-maz@kernel.org> Cc: Wanpeng Li , kvm@vger.kernel.org, Peter Zijlstra , Guo Ren , linux-riscv@lists.infradead.org, Vincent Chen , Jiri Olsa , kvmarm@lists.cs.columbia.edu, Stefano Stabellini , xen-devel@lists.xenproject.org, Will Deacon , Joerg Roedel , linux-csky@vger.kernel.org, Alexander Shishkin , Ingo Molnar , Palmer Dabbelt , Like Xu , Albert Ou , Zhu Lingshan , Arnaldo Carvalho de Melo , Greentime Hu , Paul Walmsley , Namhyung Kim , Boris Ostrovsky , Artem Kashkanov , linux-arm-kernel@lists.infradead.org, Jim Mattson , Juergen Gross , Nick Hu , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Paolo Bonzini , Vitaly Kuznetsov X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Mon, Oct 11, 2021, Marc Zyngier wrote: > On Wed, 22 Sep 2021 01:05:32 +0100, > Sean Christopherson wrote: > > diff --git a/include/kvm/arm_pmu.h b/include/kvm/arm_pmu.h > > index 864b9997efb2..42270676498d 100644 > > --- a/include/kvm/arm_pmu.h > > +++ b/include/kvm/arm_pmu.h > > @@ -14,6 +14,7 @@ > > #define ARMV8_PMU_MAX_COUNTER_PAIRS ((ARMV8_PMU_MAX_COUNTERS + 1) >> 1) > > > > DECLARE_STATIC_KEY_FALSE(kvm_arm_pmu_available); > > +void kvm_pmu_init(void); > > > > static __always_inline bool kvm_arm_support_pmu_v3(void) > > { > > Note that this patch is now conflicting with e840f42a4992 ("KVM: > arm64: Fix PMU probe ordering"), which was merged in -rc4. Moving the > static key definition to arch/arm64/kvm/pmu-emul.c and getting rid of > kvm_pmu_init() altogether should be enough to resolve it. Defining kvm_arm_pmu_available in pmu-emul.c doesn't work as-is because pmu-emul.c depends on CONFIG_HW_PERF_EVENTS=y. Since pmu-emul.c is the only path that enables the key, my plan is to add a prep match to bury kvm_arm_pmu_available behind the existing #ifdef CONFIG_HW_PERF_EVENTS in arm_pmu.h and add a stub for kvm_arm_support_pmu_v3(). The only ugly part is that the KVM_NVHE_ALIAS() also gains an #ifdef, but that doesn't seem too bad. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5562C433F5 for ; Wed, 10 Nov 2021 00:03:43 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 92C4061101 for ; Wed, 10 Nov 2021 00:03:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 92C4061101 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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: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=C/444VtbL7afhX5bVZp9vTeG/HTp6n0AGIx33sjeDDg=; b=HdpNG62w8DCRvu w60hFJJC4+QHOHVeuTQS0fbvN78OrR5gUEkX5Oruds3UPTc2fCsmDzcZ7WWI8LwPToOUmf9lNBKm3 sK9eUMdS0Ja4WExDToUP0PCc9ZG4wzQGQq9aSpbe/4Aolgo9CKPKHZL1YVQC1QBUYixEnRAeM/jL9 2Ec1FlOnVVxqlEg1+bxk79IYpu1C/Lce41slvvleRDUHSpQbpTexEo8ghvGKcwxFuNR9wMLp3ucvq iNTkHMsBFab4WXXRAdaSE5oQ0GpuFJTUqUdHei8qHgQ/4RY9GLJqUVKl7B8miMb3YNpeZNWvDjDSt B1GrDLI1VnYZUK3s4RkA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkb5G-0046VA-Rf; Wed, 10 Nov 2021 00:03:22 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkaLo-003mZj-28 for linux-riscv@lists.infradead.org; Tue, 09 Nov 2021 23:16:25 +0000 Received: by mail-pf1-x436.google.com with SMTP id r130so897404pfc.1 for ; Tue, 09 Nov 2021 15:16:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3iDOWhiMYVH4J/xrL04EpHxxB+pfcqrny8aFQ+9uha4=; b=VzrYqN0K7z0Tuv/HZEo98TZC4k8HLv0Bi89F+eTM7VIgt8Hd0SbLQLu1jfW8/8S8fv tzfRT3bkeDhN2PHc31X4H7Y8DtkUZW4N710CDOsPQBTQtnUWIqdFY6F7ije1Cnoj6Q+4 ppkFKf+QIHaiDGp0vt5e+c8PAWdm9ufyP9kMeDz/DPFOwmptdhrUt8KETig+vfK9Hq/N lJFBQKcjKRbfCPyMg8YrBLHsmR9t18pjj8BDwHYytNF7IYDGiDNiRxMB/BsE6ChUEAKz f1UvA+hVEnhTbq/8QIGBSxxEpmi70akY31pDC1IU1AtgFWCS0WgRlyVxJZndzjJCKeh8 qtJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3iDOWhiMYVH4J/xrL04EpHxxB+pfcqrny8aFQ+9uha4=; b=Vzlqos3oBklq4ZY92puNBHJBscAS5U3Ur/fZI5boa/6at6ne6aBP7F5e2NQs3S2R7Z ZkryTwqjUg/DFrWw79OE5f0457tmuq/ubW84h0HBkKQ1WvzZAAH7d+QPKfYF/5gZuUI0 N65YE5rdvYBhyqOkcU/LtmZvITDDTe7HYKf/1GLax7jSi8HE/RUZz4kRCnFyBaNU0pDp RNXuogxo3gj/Cldye5Tdb689m4VPbkB55YsKn9Nd31VB/L8rV9rAlaJcsm8nAzgxkhsB 3v0qirkqO/5PuJKBYgXdh6mUP/OoGNNGsZLFgpjJ1ldMxzfTEW9eJZLeIux2HFSnjJ1T TJzw== X-Gm-Message-State: AOAM533AIsmLj4TONOkUtdlGjU8GTzFPVhiNKiGNkMy0/kFPdsX+/cNO 34ed+EaulN+mvf3tlmm+0l3ojg== X-Google-Smtp-Source: ABdhPJzkNcQryrFCiNL8a59OsXtVtP1KqfiFu5fhzV9PARw6xea5VYu1cXC91MqNZo8wxwwswlX9UA== X-Received: by 2002:a63:2c0f:: with SMTP id s15mr9035602pgs.6.1636499782405; Tue, 09 Nov 2021 15:16:22 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id y9sm3778534pjt.27.2021.11.09.15.16.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Nov 2021 15:16:21 -0800 (PST) Date: Tue, 9 Nov 2021 23:16:18 +0000 From: Sean Christopherson To: Marc Zyngier Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Will Deacon , Mark Rutland , Guo Ren , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , Paolo Bonzini , Boris Ostrovsky , Juergen Gross , Alexander Shishkin , Jiri Olsa , Namhyung Kim , James Morse , Alexandru Elisei , Suzuki K Poulose , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Stefano Stabellini , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-csky@vger.kernel.org, linux-riscv@lists.infradead.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org, Artem Kashkanov , Like Xu , Zhu Lingshan Subject: Re: [PATCH v3 15/16] KVM: arm64: Drop perf.c and fold its tiny bits of code into arm.c / pmu.c Message-ID: References: <20210922000533.713300-1-seanjc@google.com> <20210922000533.713300-16-seanjc@google.com> <87tuhnq4it.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87tuhnq4it.wl-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211109_151624_192064_488EB00B X-CRM114-Status: GOOD ( 17.80 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Mon, Oct 11, 2021, Marc Zyngier wrote: > On Wed, 22 Sep 2021 01:05:32 +0100, > Sean Christopherson wrote: > > diff --git a/include/kvm/arm_pmu.h b/include/kvm/arm_pmu.h > > index 864b9997efb2..42270676498d 100644 > > --- a/include/kvm/arm_pmu.h > > +++ b/include/kvm/arm_pmu.h > > @@ -14,6 +14,7 @@ > > #define ARMV8_PMU_MAX_COUNTER_PAIRS ((ARMV8_PMU_MAX_COUNTERS + 1) >> 1) > > > > DECLARE_STATIC_KEY_FALSE(kvm_arm_pmu_available); > > +void kvm_pmu_init(void); > > > > static __always_inline bool kvm_arm_support_pmu_v3(void) > > { > > Note that this patch is now conflicting with e840f42a4992 ("KVM: > arm64: Fix PMU probe ordering"), which was merged in -rc4. Moving the > static key definition to arch/arm64/kvm/pmu-emul.c and getting rid of > kvm_pmu_init() altogether should be enough to resolve it. Defining kvm_arm_pmu_available in pmu-emul.c doesn't work as-is because pmu-emul.c depends on CONFIG_HW_PERF_EVENTS=y. Since pmu-emul.c is the only path that enables the key, my plan is to add a prep match to bury kvm_arm_pmu_available behind the existing #ifdef CONFIG_HW_PERF_EVENTS in arm_pmu.h and add a stub for kvm_arm_support_pmu_v3(). The only ugly part is that the KVM_NVHE_ALIAS() also gains an #ifdef, but that doesn't seem too bad. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4413BC433F5 for ; Wed, 10 Nov 2021 00:05:34 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 12B3E61101 for ; Wed, 10 Nov 2021 00:05:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 12B3E61101 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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: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=qIaSpgypCcTZJD8ZpxDLhhXswOU6sw+eVvf5SH5ldAM=; b=By15N4Ks6iB3AQ kJtjnzYXUa5WmWm3I8f6VTQ0n6pcEJeP0r4iX81jm3jwiud2+NB51GRrcG55n8pJdARVJlHFxXkUK QpKHPoaVkp0PzmX9QmwAASnL4n2QEa2yxCOykR56nTbLfUqlEjvoiJtaTxwgOG2meOr/XQriCb7L/ 48QlAjDjIfzRhRt/B5LW1KLIpi2FU0ohZxG5HXXgARZTTsw051DEY+rPF+pIN0jEdANStKxtF+kPT DpMGH1WWjzi1rO5/1BodXMM8hzWUmo3D7ZJvhjAI+KmfnzuCdN25Nz5/0EW2taRWMctTUylANaqxW RkOf1fbbmykOuqMA+7DA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkb5N-0046X4-Bq; Wed, 10 Nov 2021 00:03:29 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkaLo-003mZl-23 for linux-arm-kernel@lists.infradead.org; Tue, 09 Nov 2021 23:16:25 +0000 Received: by mail-pg1-x535.google.com with SMTP id n23so486025pgh.8 for ; Tue, 09 Nov 2021 15:16:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3iDOWhiMYVH4J/xrL04EpHxxB+pfcqrny8aFQ+9uha4=; b=VzrYqN0K7z0Tuv/HZEo98TZC4k8HLv0Bi89F+eTM7VIgt8Hd0SbLQLu1jfW8/8S8fv tzfRT3bkeDhN2PHc31X4H7Y8DtkUZW4N710CDOsPQBTQtnUWIqdFY6F7ije1Cnoj6Q+4 ppkFKf+QIHaiDGp0vt5e+c8PAWdm9ufyP9kMeDz/DPFOwmptdhrUt8KETig+vfK9Hq/N lJFBQKcjKRbfCPyMg8YrBLHsmR9t18pjj8BDwHYytNF7IYDGiDNiRxMB/BsE6ChUEAKz f1UvA+hVEnhTbq/8QIGBSxxEpmi70akY31pDC1IU1AtgFWCS0WgRlyVxJZndzjJCKeh8 qtJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3iDOWhiMYVH4J/xrL04EpHxxB+pfcqrny8aFQ+9uha4=; b=PC+LM+uoB2GBDQpsQKGZk56nD3J9rF8Gt6xJXw4/6BYaYYkpyAHfPTFgG3Lh+9Wu8y ErU/dlr/vZsXTaU4R5WQPgOZThMmGMZ3bHw1Vo0GcYMiFlPU1T5SNuE5N+JDcDQQNw6b PtdBSbYeT9aB+P7MUvgazTv0GvTC6jVn2AylHW2RadVJ8tztppjEDL384dWkoo186bfG vLEh7qCLKJwBTiGlXPNhlC4JYClIVtund28dSYF72vX9+epsxFbJqJ9KCbYyU3iIm0CU TrcPnh9A+N96JO/kP+3OsMskwFFzSae7Ok5nkJWtopJmanSJRqZRP3uiMmYN9ASV52nD 0qJQ== X-Gm-Message-State: AOAM532CMK47Zb0Gk7Z9yPCeqTgu3LUapuMFC2piNDvTZv7gYpon5gp9 YA+rk8HDzYzDzfYxpt+3FC5j4g== X-Google-Smtp-Source: ABdhPJzkNcQryrFCiNL8a59OsXtVtP1KqfiFu5fhzV9PARw6xea5VYu1cXC91MqNZo8wxwwswlX9UA== X-Received: by 2002:a63:2c0f:: with SMTP id s15mr9035602pgs.6.1636499782405; Tue, 09 Nov 2021 15:16:22 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id y9sm3778534pjt.27.2021.11.09.15.16.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Nov 2021 15:16:21 -0800 (PST) Date: Tue, 9 Nov 2021 23:16:18 +0000 From: Sean Christopherson To: Marc Zyngier Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Will Deacon , Mark Rutland , Guo Ren , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , Paolo Bonzini , Boris Ostrovsky , Juergen Gross , Alexander Shishkin , Jiri Olsa , Namhyung Kim , James Morse , Alexandru Elisei , Suzuki K Poulose , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Stefano Stabellini , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-csky@vger.kernel.org, linux-riscv@lists.infradead.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org, Artem Kashkanov , Like Xu , Zhu Lingshan Subject: Re: [PATCH v3 15/16] KVM: arm64: Drop perf.c and fold its tiny bits of code into arm.c / pmu.c Message-ID: References: <20210922000533.713300-1-seanjc@google.com> <20210922000533.713300-16-seanjc@google.com> <87tuhnq4it.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87tuhnq4it.wl-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211109_151624_193009_D31A90DB X-CRM114-Status: GOOD ( 19.32 ) 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 Mon, Oct 11, 2021, Marc Zyngier wrote: > On Wed, 22 Sep 2021 01:05:32 +0100, > Sean Christopherson wrote: > > diff --git a/include/kvm/arm_pmu.h b/include/kvm/arm_pmu.h > > index 864b9997efb2..42270676498d 100644 > > --- a/include/kvm/arm_pmu.h > > +++ b/include/kvm/arm_pmu.h > > @@ -14,6 +14,7 @@ > > #define ARMV8_PMU_MAX_COUNTER_PAIRS ((ARMV8_PMU_MAX_COUNTERS + 1) >> 1) > > > > DECLARE_STATIC_KEY_FALSE(kvm_arm_pmu_available); > > +void kvm_pmu_init(void); > > > > static __always_inline bool kvm_arm_support_pmu_v3(void) > > { > > Note that this patch is now conflicting with e840f42a4992 ("KVM: > arm64: Fix PMU probe ordering"), which was merged in -rc4. Moving the > static key definition to arch/arm64/kvm/pmu-emul.c and getting rid of > kvm_pmu_init() altogether should be enough to resolve it. Defining kvm_arm_pmu_available in pmu-emul.c doesn't work as-is because pmu-emul.c depends on CONFIG_HW_PERF_EVENTS=y. Since pmu-emul.c is the only path that enables the key, my plan is to add a prep match to bury kvm_arm_pmu_available behind the existing #ifdef CONFIG_HW_PERF_EVENTS in arm_pmu.h and add a stub for kvm_arm_support_pmu_v3(). The only ugly part is that the KVM_NVHE_ALIAS() also gains an #ifdef, but that doesn't seem too bad. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel