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 261C4C433F5 for ; Mon, 11 Oct 2021 14:49:08 +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 E1E0760EB1 for ; Mon, 11 Oct 2021 14:49:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E1E0760EB1 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=Pr/AJ6IRHNZ1LhQx/gROfoFxGDkpmag8D6fPGxSpTSI=; b=q4vGicW/2czmJr edIzctWKcJ5ayTpi9Wfy/Bbu8+G8f+OIv1stBtQnH/rlV0ROHwCFHYguN9A+UEAbbOSyRyl+YgyQw p13jQVjGG83nHrlH5RhCIW0MxAAzj5dLosfUik9LkKyu9Mq2cbtWTWITbi0PMQ99oQ5rizOVQ87wz /iBwnK+P0go68qQWbea23vXd4/7jrzHgDeeI3luHat6N765Dk+tnFWqrw3qscDCqXRJjhkuszMGud VQe7c2iSn1PKFUP/1AJHgk5da8aX5NRnDrFhaSbzEkc7lvsNyt+B8Rc93Pb6lLjdx/N+29aq29iWk Ocj/eKQ2UtYgo+kFH9cA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZwZX-009oMx-E9; Mon, 11 Oct 2021 14:46:35 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZwZT-009oM1-T5 for linux-arm-kernel@lists.infradead.org; Mon, 11 Oct 2021 14:46:33 +0000 Received: by mail-pg1-x52b.google.com with SMTP id e7so11053605pgk.2 for ; Mon, 11 Oct 2021 07:46:31 -0700 (PDT) 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=DBJ7ew0y4wvSmKi4WuGSAOH7oUWp7VGZaMnxUGUZnug=; b=WUgGM/f+tuPQ7vGNX0cNBBwPv0afu/Zf4dQxhALEj1CWce6SG/QX3MDYljf0Gbuor/ sj1ONxiUie1VuDLeZqyzP3U8wgCb5jI5/lPjBFHrG3lQw2dxyh3W+h6mZVvyEvJz8G7y 1nEPJR+H3CxD/4MNWxAGoi6oKI9swc9dOAfsAmuD9ToN3kvenxSiEM2lWlzMHV2o9VoH KyJiDN0gZI6nT02ZPzo0daWaK+RTn7Ob4pOSdy5AEMo6f68pgZs/vQbuhgd7TqLjMpzx 27dHqDzBC8kH05vyX+/CHU4byC6ZoMfjoSir4u7rmWajgW3NJ9i2O+wJZUYyUoDZl7A9 85aw== 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=DBJ7ew0y4wvSmKi4WuGSAOH7oUWp7VGZaMnxUGUZnug=; b=dnLvpTFO9W4Fkg9E62lDztV6NSHflea7o8W/tMy5X+toO0BKp6lQUQ76XqbOQ4o7Wr y1bYSC6Pep31wbEcLpfpz5H8ZRwa5Mv+sO3ShUypYKk7RpvzR7kz2PiyPQRgSwiUsAzU d6wh8AailZxqXqbLuD3awlVwvnmgLQkegr2a20dmhIp4EeUf7g8BdyM63qhB960tqHaK qfRUQNyXif9Q3T47EW0V5n7noyq5kriwxu0/rqlwPdGtoh11dcU30vtGS6NYV+UrXcgr rysjaHHtxQI0in/0CCEy/euzLgZuzwbn6vmmNUOfENkmZnESruvJjem2mIxY8WBShhWd 1Muw== X-Gm-Message-State: AOAM5318uoEL81F1UvgYQAKMKKczyjlavc5DX64j7eW0tLHxmzbapK/x Phu2TrOWW9zUBMn3I/QMR04UjQ== X-Google-Smtp-Source: ABdhPJy9JeaIFsaMhzjKrm4gRLnqTQlHrSTvgGmlHsrREml2i4T5hhC4ZlLxJitHkoHCOL8HD11SpQ== X-Received: by 2002:a63:c:: with SMTP id 12mr18698297pga.477.1633963591022; Mon, 11 Oct 2021 07:46:31 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id x129sm8062008pfc.140.2021.10.11.07.46.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Oct 2021 07:46:30 -0700 (PDT) Date: Mon, 11 Oct 2021 14:46:25 +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 12/16] KVM: Move x86's perf guest info callbacks to generic KVM Message-ID: References: <20210922000533.713300-1-seanjc@google.com> <20210922000533.713300-13-seanjc@google.com> <87wnmjq4y3.wl-maz@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <87wnmjq4y3.wl-maz@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211011_074631_964702_5C4A464B X-CRM114-Status: GOOD ( 15.54 ) 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:29 +0100, Sean Christopherson wrote: > > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h > > index ed940aec89e0..828b6eaa2c56 100644 > > --- a/arch/arm64/include/asm/kvm_host.h > > +++ b/arch/arm64/include/asm/kvm_host.h > > @@ -673,6 +673,14 @@ int io_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa); > > void kvm_perf_init(void); > > void kvm_perf_teardown(void); > > > > +#ifdef CONFIG_GUEST_PERF_EVENTS > > +static inline bool kvm_arch_pmi_in_guest(struct kvm_vcpu *vcpu) > > Pardon my x86 ignorance, what is PMI? PMU Interrupt? Ya, Performance Monitoring Interrupt. I didn't realize the term wasn't common perf terminology. Maybe kvm_arch_perf_events_in_guest() to be less x86-centric? > > +{ > > + /* Any callback while a vCPU is loaded is considered to be in guest. */ > > + return !!vcpu; > > +} > > +#endif > > Do you really need this #ifdef? Nope, should compile fine without it, though simply dropping the #ifdef would make make the semantics of the function wrong, even if nothing consumes it. Tweak it to use IS_ENABLED()? return IS_ENABLED(CONFIG_GUEST_PERF_EVENTS) && !!vcpu; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel