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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A093C433EF for ; Fri, 3 Dec 2021 15:58:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381929AbhLCQCV (ORCPT ); Fri, 3 Dec 2021 11:02:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1381930AbhLCQB7 (ORCPT ); Fri, 3 Dec 2021 11:01:59 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D16B9C061D7F; Fri, 3 Dec 2021 07:58:31 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5AAC662C25; Fri, 3 Dec 2021 15:58:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6F28C56749; Fri, 3 Dec 2021 15:58:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638547110; bh=qJD2danQ3URRcIzZOzZCHOD8e3NiOVJf9PCw7v9jiOo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ori/ZGk47+C7oKVNvK8nvrqZilkaYX4hJMzPeZbO9/PA794ttpWuXs+GdstK8W3Uw iprj6d0aDSRA3Ve+f/r8oYR2MqVn28YPIdLEI3rUWv+U5vK6Nnx4Y1rJNrfX5WbUPy J0FjeJLwYpSg4EJOvuV8sfCoGRfNhDBe/p38PUR84jPQQQWQKsmLzmraVJd2q+O/6X obMA7/MRzdz/V/cDFhcOVSadSUTf2fIcbUgRKODtK43n6N/M1whSfOYZEWGy5bKl4d 9WCNIZkIj6qfp8lhO7OpYVYiW6YRk6PbNoW3e13CIIW11ZapX0TjI2pC1tkZ4HB8M+ dY9dFUUbss0+g== Received: by mail-ed1-f50.google.com with SMTP id y13so13268384edd.13; Fri, 03 Dec 2021 07:58:30 -0800 (PST) X-Gm-Message-State: AOAM530DIPMNkcYlutGCwyXiGREbYxR90ixGqxoY54QMtsPZkGjA01b8 4JGbaO0WxRhzqOH52ttjhyCndisIo8Soq5lObQ== X-Google-Smtp-Source: ABdhPJyv+1SOK4GHulPDylE33hTa9bzB6wGwF5kWEz0yW4prK9flpy66cDUS/NwpPf/gHONFOoLeme0BGX6swm4QNGM= X-Received: by 2002:a17:907:a411:: with SMTP id sg17mr24193953ejc.84.1638547107328; Fri, 03 Dec 2021 07:58:27 -0800 (PST) MIME-Version: 1.0 References: <20211027201641.2076427-1-robh@kernel.org> <20211027201641.2076427-3-robh@kernel.org> <87zgpl9rqq.ffs@tglx> In-Reply-To: <87zgpl9rqq.ffs@tglx> From: Rob Herring Date: Fri, 3 Dec 2021 09:58:15 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v12 2/5] perf: Add a counter for number of user access events in context To: Thomas Gleixner Cc: Will Deacon , Mark Rutland , Peter Zijlstra , Jonathan Corbet , Catalin Marinas , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 30, 2021 at 4:57 PM Thomas Gleixner wrote: > > On Wed, Oct 27 2021 at 15:16, Rob Herring wrote: > > For controlling user space counter access, we need to know if any event > > in a context (currently scheduled or not) is using user space counters. > > Who is 'we'? > > Come on. How is someone without context supposed to figure out that 'we' > means ARM64 when staring at that changelog a year later? > > Is it really that hard to write coherent changelogs which make sense on > their own and actually follow Documentation/process/ which exists for a > reason? I've rewritten it like this: On arm64, user space counter access will be controlled differently compared to x86. On x86, access in the strictest mode is enabled for all tasks in an MM when any event is mmap'ed. For arm64, access is explicitly requested for an event and only enabled when the event's context is active. This avoids hooks into the arch context switch code and gives better control of when access is enabled. In order to configure user space access when the PMU is enabled, it is necessary to know if any event (currently active or not) in the current context has user space accessed enabled. Add a counter similar to other counters in the context to avoid walking the event list every time. 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 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 4D2D2C433F5 for ; Fri, 3 Dec 2021 15:59:50 +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:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jG1++QoJJGkb3x0nTpWjZFRVM6cDdFpUd2LRalk7jlw=; b=dNFW/5mCHo9b1Q 7MYbvTTA9F6ltpt9jV0SvqFkdhoTcWhsx3+MjebSJ3UkZGo0Ol+NUe97rfWuXnD1UB9pFC5VHalgu VHrb8n2Dnevrv+iMMw2R2GcyEAOm2NByRjOikmhPhhthUsnKg8fxvvzi7p380VawHjb/5lTRvLvPN YPx7Zrze2lKfx46WU1q4LQsUt1XuKA1/lm1BdQP58aq7Bbaa76MrqWO9k4Etn/Or+DKZL/OA2X4Xu 9BqmxfFFdVR80lcuGFtG9yMq6yScpxrsfU0urMq6nGzaIF7wB1i6cNQjlpBJTqzFkdqTOk6Bnrw6H NOvMLZD8cdEQy54Sx7zQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtAxI-00GSKd-Da; Fri, 03 Dec 2021 15:58:36 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mtAxE-00GSJi-0X for linux-arm-kernel@lists.infradead.org; Fri, 03 Dec 2021 15:58:33 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 2CA5FB82812 for ; Fri, 3 Dec 2021 15:58:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6C24C53FAD for ; Fri, 3 Dec 2021 15:58:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638547108; bh=qJD2danQ3URRcIzZOzZCHOD8e3NiOVJf9PCw7v9jiOo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=VmdF3OAoMnF0mA9RKrd9DJSxCJ2lJjO/+RWrZpy4yQKc3fj0YWfFDM2ctynB0Mmqb fwslsRHwHZZ0Z+Vma0QJo/BujhliZhLhjSPohI+IgsEd+t381ld81RJHIzxSR7GtGu J5CCVTDPAVsgRhLj+xxXMzmmOyvV8MW9bPTtWOdSFly+kWk0iU71uB9xBRbbu1Q3JQ b2KwNI/6frBmHsq5nnK9zF2L9RN+k7kW7rKtv/WHW9+9uzwd1GUByLCesDMnqMcYxP lLC6WwBgRf+KJ8evoBqTiLtF/Yrfu+2VSyS6pCcKNOR0+CQIX319w+XF4ewNYFs5hp hcBD3fsFQ2IDw== Received: by mail-ed1-f52.google.com with SMTP id o20so13390777eds.10 for ; Fri, 03 Dec 2021 07:58:28 -0800 (PST) X-Gm-Message-State: AOAM5302P/chSYvZDNnNMIWkdqw6JAS3uVSqAl3BFe+HRUQSFBp8N2Or hHs4jdQojKNKskV+ARgw9qDTUXiaXxepFz9W/A== X-Google-Smtp-Source: ABdhPJyv+1SOK4GHulPDylE33hTa9bzB6wGwF5kWEz0yW4prK9flpy66cDUS/NwpPf/gHONFOoLeme0BGX6swm4QNGM= X-Received: by 2002:a17:907:a411:: with SMTP id sg17mr24193953ejc.84.1638547107328; Fri, 03 Dec 2021 07:58:27 -0800 (PST) MIME-Version: 1.0 References: <20211027201641.2076427-1-robh@kernel.org> <20211027201641.2076427-3-robh@kernel.org> <87zgpl9rqq.ffs@tglx> In-Reply-To: <87zgpl9rqq.ffs@tglx> From: Rob Herring Date: Fri, 3 Dec 2021 09:58:15 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v12 2/5] perf: Add a counter for number of user access events in context To: Thomas Gleixner Cc: Will Deacon , Mark Rutland , Peter Zijlstra , Jonathan Corbet , Catalin Marinas , Ingo Molnar , Arnaldo Carvalho de Melo , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211203_075832_371693_6A036370 X-CRM114-Status: GOOD ( 22.07 ) 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 Tue, Nov 30, 2021 at 4:57 PM Thomas Gleixner wrote: > > On Wed, Oct 27 2021 at 15:16, Rob Herring wrote: > > For controlling user space counter access, we need to know if any event > > in a context (currently scheduled or not) is using user space counters. > > Who is 'we'? > > Come on. How is someone without context supposed to figure out that 'we' > means ARM64 when staring at that changelog a year later? > > Is it really that hard to write coherent changelogs which make sense on > their own and actually follow Documentation/process/ which exists for a > reason? I've rewritten it like this: On arm64, user space counter access will be controlled differently compared to x86. On x86, access in the strictest mode is enabled for all tasks in an MM when any event is mmap'ed. For arm64, access is explicitly requested for an event and only enabled when the event's context is active. This avoids hooks into the arch context switch code and gives better control of when access is enabled. In order to configure user space access when the PMU is enabled, it is necessary to know if any event (currently active or not) in the current context has user space accessed enabled. Add a counter similar to other counters in the context to avoid walking the event list every time. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel