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 67B86C433F5 for ; Tue, 9 Nov 2021 23:46:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 53D0D61027 for ; Tue, 9 Nov 2021 23:46:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229999AbhKIXtL (ORCPT ); Tue, 9 Nov 2021 18:49:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbhKIXtI (ORCPT ); Tue, 9 Nov 2021 18:49:08 -0500 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF1EDC0613F5 for ; Tue, 9 Nov 2021 15:46:20 -0800 (PST) Received: by mail-pf1-x42e.google.com with SMTP id y5so939415pfb.4 for ; Tue, 09 Nov 2021 15:46:20 -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=6chuTYfgRvTDMG+7/4r5PAEJkXMffm8xsv4fOhQYrHg=; b=padV+5xbNxU2BtdwvYLqgobnJgC7jdztrJVhn7K2+WlRuLp3u+7Em538emsInI8ZW0 EzZn9v91Us4jfHf9Lmmw5fjJNJZXyPueYr0bLHlmaEwNiw9/mnseW7q3iUQMF0MSrqY7 fh/rdp+bFUiYM2Q6wMsioJo1q+LB3h94uhn4IoA8l8Oi2FnmukHc/WcnpMyQdwGZgNcX quegTOwOZXl16pimaWjp8HrU55UW3cRaxZ+73lXvIy+5zw7YWqG84GnZJq4QA8qj+lfZ 30vSgeoxKWa3Pm11ldKt4T1NH7NtZdcF3NNQhyDYYMuoCBmAmEhAxO9jY6+vIZP5JAti sSrQ== 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=6chuTYfgRvTDMG+7/4r5PAEJkXMffm8xsv4fOhQYrHg=; b=rOoFoV2bYM6lCWQZzj6J1kIccPf+P/beD+Fi32bNfqj3WthN1aC190QXBTZv6etcWA i20w4WmjMzjtVVBXD5IOHbvEPyjyTLeKtWYxNMagOfqLvhlpYeTUXU4f+7SaVhiPg0LB 4hCUWuSs0MXicEnZLTYGHOCNCVaCBy6wR9WVuePWAvggR/b/B/UfG/CZVg66Fx1IE959 OsbqAFwihSLN5uIM7eBNVil3fHXfngqoV99jLuMlGtABwR1VuCq3qUJ+RLp635K4Gs+X oC1StfOgAv9tkhY3vZ3svF7AJADZdI9GGyE4Hi8RXFAo3r5KzOZ6LJ1I4k/NhSeSBvmi Rv2A== X-Gm-Message-State: AOAM53386sHHbVHs1diCZZwx+vAcgyu9AcPh6qrE/1wK4dnu1QW6TN4Y Rf7aZe1jYlGzzA75MUJe7Xt88g== X-Google-Smtp-Source: ABdhPJwm4B0oaMVW7WsgOG0J14c3t+T/mSfRgwMmqW6RiSnYPS/pCOwWjFlWP8+tiDx9Ql84OwTCuA== X-Received: by 2002:a65:6a47:: with SMTP id o7mr8900284pgu.439.1636501580110; Tue, 09 Nov 2021 15:46:20 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id y130sm14619421pfg.202.2021.11.09.15.46.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Nov 2021 15:46:19 -0800 (PST) Date: Tue, 9 Nov 2021 23:46:15 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Will Deacon , Mark Rutland , Marc Zyngier , Guo Ren , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , 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 08/16] perf: Force architectures to opt-in to guest callbacks Message-ID: References: <20210922000533.713300-1-seanjc@google.com> <20210922000533.713300-9-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 22, 2021, Sean Christopherson wrote: > On Wed, Sep 22, 2021, Paolo Bonzini wrote: > > On 22/09/21 02:05, Sean Christopherson wrote: > > > @@ -1273,6 +1274,11 @@ static inline unsigned int perf_guest_handle_intel_pt_intr(void) > > > } > > > extern void perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *cbs); > > > extern void perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *cbs); > > > +#else > > > +static inline unsigned int perf_guest_state(void) { return 0; } > > > +static inline unsigned long perf_guest_get_ip(void) { return 0; } > > > +static inline unsigned int perf_guest_handle_intel_pt_intr(void) { return 0; } > > > +#endif /* CONFIG_GUEST_PERF_EVENTS */ > > > > Reviewed-by: Paolo Bonzini > > > > Having perf_guest_handle_intel_pt_intr in generic code is a bit off. Of > > course it has to be in the struct, but the wrapper might be placed in > > arch/x86/include/asm/perf_event.h as well (applies to patch 7 as well). > > Yeah, I went with this option purely to keep everything bundled together. I have > no strong opinion. Scratch, that, I do have an opinion. perf_guest_handle_intel_pt_intr() is in common code because the callbacks themselves and perf_get_guest_cbs() are defined in linux/perf_event.h, _after_ asm/perf_event.h is included. arch/x86/include/asm/perf_event.h is quite bereft of includes, so there's no obvious landing spot for those two things, and adding a new header seems like overkill. 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 2C2B0C4332F for ; Tue, 9 Nov 2021 23:46:26 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id AA15F611F0 for ; Tue, 9 Nov 2021 23:46:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AA15F611F0 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 333DA4B295; Tue, 9 Nov 2021 18:46:25 -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 oGEbAxnN35ZH; Tue, 9 Nov 2021 18:46:23 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 758724B279; Tue, 9 Nov 2021 18:46:23 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 7C3AF4B256 for ; Tue, 9 Nov 2021 18:46:22 -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 PJVWIfIbYAfE for ; Tue, 9 Nov 2021 18:46:21 -0500 (EST) Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 3CA9D4B251 for ; Tue, 9 Nov 2021 18:46:21 -0500 (EST) Received: by mail-pf1-f177.google.com with SMTP id m14so911650pfc.9 for ; Tue, 09 Nov 2021 15:46:21 -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=6chuTYfgRvTDMG+7/4r5PAEJkXMffm8xsv4fOhQYrHg=; b=padV+5xbNxU2BtdwvYLqgobnJgC7jdztrJVhn7K2+WlRuLp3u+7Em538emsInI8ZW0 EzZn9v91Us4jfHf9Lmmw5fjJNJZXyPueYr0bLHlmaEwNiw9/mnseW7q3iUQMF0MSrqY7 fh/rdp+bFUiYM2Q6wMsioJo1q+LB3h94uhn4IoA8l8Oi2FnmukHc/WcnpMyQdwGZgNcX quegTOwOZXl16pimaWjp8HrU55UW3cRaxZ+73lXvIy+5zw7YWqG84GnZJq4QA8qj+lfZ 30vSgeoxKWa3Pm11ldKt4T1NH7NtZdcF3NNQhyDYYMuoCBmAmEhAxO9jY6+vIZP5JAti sSrQ== 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=6chuTYfgRvTDMG+7/4r5PAEJkXMffm8xsv4fOhQYrHg=; b=Ct3sKaoU+8Fx4a5lAdvClubZJS+Jray5MqRREag3H9l3+JBI8cKcKBxk3DdcNyfuD0 h+r36vpD2QSe5hbxD7jGyojjjPETJt3zX5wP/nbDUElWhHQ5nl7IBXlTx9J+m9Ra2DhZ qJrxxDSnVNG+kLiAoiKSBGR23SUjU3K9S1X0CTA9FEF6GqQkKnlB2R7q60AwIQFH0CfZ OgChYNB6h+e+2kAfAAzIDVFBofdNOEOAslu0Irdt074USyOJ8u32qF009oV/qpq85lRW uiuTdppGnYr/SyXFjumK+qkTbO+WAfeH8iqSSbGNm7HC4XirsTkOOsjgqHaFLXjnHPXO n3Gg== X-Gm-Message-State: AOAM532c3VCaKXIDWI5ljKDP2B89WD9L8G/nBysXlNT8DkdVPC+oUfX5 Fel6+JrFonqT09TjRJ0JU76w7A== X-Google-Smtp-Source: ABdhPJwm4B0oaMVW7WsgOG0J14c3t+T/mSfRgwMmqW6RiSnYPS/pCOwWjFlWP8+tiDx9Ql84OwTCuA== X-Received: by 2002:a65:6a47:: with SMTP id o7mr8900284pgu.439.1636501580110; Tue, 09 Nov 2021 15:46:20 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id y130sm14619421pfg.202.2021.11.09.15.46.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Nov 2021 15:46:19 -0800 (PST) Date: Tue, 9 Nov 2021 23:46:15 +0000 From: Sean Christopherson To: Paolo Bonzini Subject: Re: [PATCH v3 08/16] perf: Force architectures to opt-in to guest callbacks Message-ID: References: <20210922000533.713300-1-seanjc@google.com> <20210922000533.713300-9-seanjc@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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, Marc Zyngier , Joerg Roedel , linux-csky@vger.kernel.org, Alexander Shishkin , Ingo Molnar , Palmer Dabbelt , Like Xu , Albert Ou , Zhu Lingshan , Will Deacon , 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, 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 Wed, Sep 22, 2021, Sean Christopherson wrote: > On Wed, Sep 22, 2021, Paolo Bonzini wrote: > > On 22/09/21 02:05, Sean Christopherson wrote: > > > @@ -1273,6 +1274,11 @@ static inline unsigned int perf_guest_handle_intel_pt_intr(void) > > > } > > > extern void perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *cbs); > > > extern void perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *cbs); > > > +#else > > > +static inline unsigned int perf_guest_state(void) { return 0; } > > > +static inline unsigned long perf_guest_get_ip(void) { return 0; } > > > +static inline unsigned int perf_guest_handle_intel_pt_intr(void) { return 0; } > > > +#endif /* CONFIG_GUEST_PERF_EVENTS */ > > > > Reviewed-by: Paolo Bonzini > > > > Having perf_guest_handle_intel_pt_intr in generic code is a bit off. Of > > course it has to be in the struct, but the wrapper might be placed in > > arch/x86/include/asm/perf_event.h as well (applies to patch 7 as well). > > Yeah, I went with this option purely to keep everything bundled together. I have > no strong opinion. Scratch, that, I do have an opinion. perf_guest_handle_intel_pt_intr() is in common code because the callbacks themselves and perf_get_guest_cbs() are defined in linux/perf_event.h, _after_ asm/perf_event.h is included. arch/x86/include/asm/perf_event.h is quite bereft of includes, so there's no obvious landing spot for those two things, and adding a new header seems like overkill. _______________________________________________ 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 10810C433EF for ; Wed, 10 Nov 2021 00:09:55 +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 C947C610CB for ; Wed, 10 Nov 2021 00:09:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org C947C610CB 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=yWz+Pfw6zSNt+xFhbUvw5DaLEVVqoQfrr88+egtVA78=; b=31KvSc2YrNJmvw fCBA3u3DtigC5vIpYzVaJryUgyDMyNBmets0fw5XvqXQXaQQYWHsybaz5gEM5jDzEb9SHzpL/J/qV RAOpEoXX7W1DX8KPCpib2DAtr6qEu7NESufDDGRhJAZYW6oMpkCpsFyPzPao1TgNhCQzBiLNFcF50 vrE6hYbIuO0Mr/OOyFExaHtrDXM+S+SZqZfa0SnbwDJeDcF08J4t1TGeXmrlHNRX/OanDuQa87A9b 55pencRT9K6GZ/f0+54tIXinDcEzbYfyDbrZC36jqrqOeiQd/eE6yN3MtXBUb/eAkykNC/kpJ1QtP 5CdZrxYSUCAFNGB49SsA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkbBR-0048zE-37; Wed, 10 Nov 2021 00:09:45 +0000 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkaon-003ytn-J4 for linux-riscv@lists.infradead.org; Tue, 09 Nov 2021 23:46:24 +0000 Received: by mail-pg1-x52d.google.com with SMTP id p8so521987pgh.11 for ; Tue, 09 Nov 2021 15:46:20 -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=6chuTYfgRvTDMG+7/4r5PAEJkXMffm8xsv4fOhQYrHg=; b=padV+5xbNxU2BtdwvYLqgobnJgC7jdztrJVhn7K2+WlRuLp3u+7Em538emsInI8ZW0 EzZn9v91Us4jfHf9Lmmw5fjJNJZXyPueYr0bLHlmaEwNiw9/mnseW7q3iUQMF0MSrqY7 fh/rdp+bFUiYM2Q6wMsioJo1q+LB3h94uhn4IoA8l8Oi2FnmukHc/WcnpMyQdwGZgNcX quegTOwOZXl16pimaWjp8HrU55UW3cRaxZ+73lXvIy+5zw7YWqG84GnZJq4QA8qj+lfZ 30vSgeoxKWa3Pm11ldKt4T1NH7NtZdcF3NNQhyDYYMuoCBmAmEhAxO9jY6+vIZP5JAti sSrQ== 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=6chuTYfgRvTDMG+7/4r5PAEJkXMffm8xsv4fOhQYrHg=; b=sNZ5cS9IAEkhH49svBowDcm/CunUa13gJlbrr0rULL58ckl+XauT7pTgno8ipaqRP8 8EAjDu7TaRF/EmlmZ1Dg7/7aJ8J/NeWN9/4e2BM8E1ydXBLKOWGv9qfOonq1axpULs9O 5UTRaqRfgZjMdZHGSsytF4lLqaGAkrBseCQgmbTvCxx89BocIPNrVyN4IaSGylK7ALrk +YZKBtXQizwFi7tOD8vv0Qy4ZFu1Pz8UjMyuy/92PLNJrQUUIV4ff68n+6AsTwTamPPc WTOq4yahtkXPZ7Wgvths1MaDFwrVhp8AMQqH68V0CFxq4pSJPAyUbjW7xenySJcuQFgk Km8g== X-Gm-Message-State: AOAM533nlW6AxBk0w0o26rVERh7NIDsT+QIlap4EYS6BW3T6Pfv2RaJ7 UdMxoVY4jggSG7wxyICJeaLmSQ== X-Google-Smtp-Source: ABdhPJwm4B0oaMVW7WsgOG0J14c3t+T/mSfRgwMmqW6RiSnYPS/pCOwWjFlWP8+tiDx9Ql84OwTCuA== X-Received: by 2002:a65:6a47:: with SMTP id o7mr8900284pgu.439.1636501580110; Tue, 09 Nov 2021 15:46:20 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id y130sm14619421pfg.202.2021.11.09.15.46.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Nov 2021 15:46:19 -0800 (PST) Date: Tue, 9 Nov 2021 23:46:15 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Will Deacon , Mark Rutland , Marc Zyngier , Guo Ren , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , 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 08/16] perf: Force architectures to opt-in to guest callbacks Message-ID: References: <20210922000533.713300-1-seanjc@google.com> <20210922000533.713300-9-seanjc@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211109_154621_686777_CF54B592 X-CRM114-Status: GOOD ( 15.57 ) 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 Wed, Sep 22, 2021, Sean Christopherson wrote: > On Wed, Sep 22, 2021, Paolo Bonzini wrote: > > On 22/09/21 02:05, Sean Christopherson wrote: > > > @@ -1273,6 +1274,11 @@ static inline unsigned int perf_guest_handle_intel_pt_intr(void) > > > } > > > extern void perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *cbs); > > > extern void perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *cbs); > > > +#else > > > +static inline unsigned int perf_guest_state(void) { return 0; } > > > +static inline unsigned long perf_guest_get_ip(void) { return 0; } > > > +static inline unsigned int perf_guest_handle_intel_pt_intr(void) { return 0; } > > > +#endif /* CONFIG_GUEST_PERF_EVENTS */ > > > > Reviewed-by: Paolo Bonzini > > > > Having perf_guest_handle_intel_pt_intr in generic code is a bit off. Of > > course it has to be in the struct, but the wrapper might be placed in > > arch/x86/include/asm/perf_event.h as well (applies to patch 7 as well). > > Yeah, I went with this option purely to keep everything bundled together. I have > no strong opinion. Scratch, that, I do have an opinion. perf_guest_handle_intel_pt_intr() is in common code because the callbacks themselves and perf_get_guest_cbs() are defined in linux/perf_event.h, _after_ asm/perf_event.h is included. arch/x86/include/asm/perf_event.h is quite bereft of includes, so there's no obvious landing spot for those two things, and adding a new header seems like overkill. _______________________________________________ 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 25C16C433EF for ; Wed, 10 Nov 2021 00:11:15 +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 DD0A6610CB for ; Wed, 10 Nov 2021 00:11:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DD0A6610CB 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=EasvDU3DPrkbYr+CWJCyelfiPRf/ZxCRx32FpYBVwXw=; b=anhJHArlZQFfRK JTnKcpcc6RFD24gsZSZkPxHYjeu679QvylT9BvZL2YG5yteLbTjHwe3Kh8AoplKPXLRzp22RfVmwc gFHhI+6kCu7Pj/mG6vAE5WZrriMUkBSgF3g8zWV2qI5lL3DA7zidyx0YDfniXmkhCaesoMJJ9jDis T+GfJtk0a1f5dJWiN1oSsqBE3TG1JErQwI5/wwDMHQF8OBcUVQIA135Ckag7D0lwu/vFsWLaESHal cgmKiVXYV654pOvrB2h5T03yo5rJ+sDx9vefmv85vDPEn2qWrpB9X8HmBkoECi2l5kROiT8b1jJDv e9tT4rSahUb/xYzJIFNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkbAl-0048jF-Tp; Wed, 10 Nov 2021 00:09:05 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkaon-003ytm-J8 for linux-arm-kernel@lists.infradead.org; Tue, 09 Nov 2021 23:46:23 +0000 Received: by mail-pf1-x431.google.com with SMTP id x131so900485pfc.12 for ; Tue, 09 Nov 2021 15:46:20 -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=6chuTYfgRvTDMG+7/4r5PAEJkXMffm8xsv4fOhQYrHg=; b=padV+5xbNxU2BtdwvYLqgobnJgC7jdztrJVhn7K2+WlRuLp3u+7Em538emsInI8ZW0 EzZn9v91Us4jfHf9Lmmw5fjJNJZXyPueYr0bLHlmaEwNiw9/mnseW7q3iUQMF0MSrqY7 fh/rdp+bFUiYM2Q6wMsioJo1q+LB3h94uhn4IoA8l8Oi2FnmukHc/WcnpMyQdwGZgNcX quegTOwOZXl16pimaWjp8HrU55UW3cRaxZ+73lXvIy+5zw7YWqG84GnZJq4QA8qj+lfZ 30vSgeoxKWa3Pm11ldKt4T1NH7NtZdcF3NNQhyDYYMuoCBmAmEhAxO9jY6+vIZP5JAti sSrQ== 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=6chuTYfgRvTDMG+7/4r5PAEJkXMffm8xsv4fOhQYrHg=; b=S3JQUB6jJMOVx72mUiB45OLLfGqECRxuH+DOCUebxbrRnKyCIvYuhhwIHg1o5RrWGJ 89Iy0KxdUDKziPqQrWXTq/gNNSxcf6u2AJ4VcIkMMd1y/RF9IRjGjj8dq6tnFeog6L5O BNVrDXa2xGTMmg+8/MSL0tJlDhzjgUdjin+cYXFZdHFVvHEPyx34B6fmv880TZ5Y8JAF CRtinbavXVCvW1qA9kNk02kNMmdwNu5VJzrcRFR8WbaHyWybFZVITK367Xnc113gUy/p CJSKUVwwDDJh3+o90eYubb2Oi2fF8ChhbJys8/mDXOE4dMdsdarfDXtixxBdg/URBrMZ O57g== X-Gm-Message-State: AOAM531HEsetf82g6j4oyzbxlVOJlUHQYW8n3hPdmg9sreE6NAnJ28RN Pl6zE+KWGiKXsln2EhDGyeizfQ== X-Google-Smtp-Source: ABdhPJwm4B0oaMVW7WsgOG0J14c3t+T/mSfRgwMmqW6RiSnYPS/pCOwWjFlWP8+tiDx9Ql84OwTCuA== X-Received: by 2002:a65:6a47:: with SMTP id o7mr8900284pgu.439.1636501580110; Tue, 09 Nov 2021 15:46:20 -0800 (PST) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id y130sm14619421pfg.202.2021.11.09.15.46.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Nov 2021 15:46:19 -0800 (PST) Date: Tue, 9 Nov 2021 23:46:15 +0000 From: Sean Christopherson To: Paolo Bonzini Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Will Deacon , Mark Rutland , Marc Zyngier , Guo Ren , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , 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 08/16] perf: Force architectures to opt-in to guest callbacks Message-ID: References: <20210922000533.713300-1-seanjc@google.com> <20210922000533.713300-9-seanjc@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211109_154621_694441_89027502 X-CRM114-Status: GOOD ( 17.09 ) 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, Sep 22, 2021, Sean Christopherson wrote: > On Wed, Sep 22, 2021, Paolo Bonzini wrote: > > On 22/09/21 02:05, Sean Christopherson wrote: > > > @@ -1273,6 +1274,11 @@ static inline unsigned int perf_guest_handle_intel_pt_intr(void) > > > } > > > extern void perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *cbs); > > > extern void perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *cbs); > > > +#else > > > +static inline unsigned int perf_guest_state(void) { return 0; } > > > +static inline unsigned long perf_guest_get_ip(void) { return 0; } > > > +static inline unsigned int perf_guest_handle_intel_pt_intr(void) { return 0; } > > > +#endif /* CONFIG_GUEST_PERF_EVENTS */ > > > > Reviewed-by: Paolo Bonzini > > > > Having perf_guest_handle_intel_pt_intr in generic code is a bit off. Of > > course it has to be in the struct, but the wrapper might be placed in > > arch/x86/include/asm/perf_event.h as well (applies to patch 7 as well). > > Yeah, I went with this option purely to keep everything bundled together. I have > no strong opinion. Scratch, that, I do have an opinion. perf_guest_handle_intel_pt_intr() is in common code because the callbacks themselves and perf_get_guest_cbs() are defined in linux/perf_event.h, _after_ asm/perf_event.h is included. arch/x86/include/asm/perf_event.h is quite bereft of includes, so there's no obvious landing spot for those two things, and adding a new header seems like overkill. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel