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 DC06DC433EF for ; Fri, 22 Oct 2021 15:41: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 A4D3460F12 for ; Fri, 22 Oct 2021 15:41:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A4D3460F12 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.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:Date: Message-ID:Cc:References:To:From:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Ac2lRRcKDMXeyNUB55ETaun2KWN3BiEiLN/oBQyNCJ4=; b=dXDqFBa6lVY5ZQd8AMLJ4x9a1b jLpJ93wVY7Tl1XCpV/9TmJK1bHsOP62bP/ZtLoV66zB4BMAwMaF/sURjBhNVoKFfyxUWVEHjiM5F4 zd0JUuDf0PdnkdqC1H9rXdN10WRwlOCs3AH4dNzmbme12+NcNLtGOKs/MmpiMCiTNjBGEdDOm9el1 uB9h6gqUWPFo9jGZeE5gZTAxrHEnty26nSkdGmR6r6+NqDnSbsVJaJWxkDIQP8Bx+lmuDuLLE14cg fnVGqSW8GyXGj2uEAQTl+5BAuZ3IbssWMwKpf8e8nHzcrs7rjfaj9h4bqD8TriOjo0SSz8r88OQys RhDOamBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdweo-00BRz3-Qi; Fri, 22 Oct 2021 15:40:34 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdwel-00BRyE-8Z for linux-arm-kernel@lists.infradead.org; Fri, 22 Oct 2021 15:40:32 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2616D1FB; Fri, 22 Oct 2021 08:40:30 -0700 (PDT) Received: from [10.57.27.181] (unknown [10.57.27.181]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E04DE3F694; Fri, 22 Oct 2021 08:40:27 -0700 (PDT) Subject: Re: [RFCv1 4/4] perf: arm_spe: Dynamically switch PID tracing to contextidr From: James Clark To: Leo Yan References: <20211021134530.206216-1-leo.yan@linaro.org> <20211021134530.206216-5-leo.yan@linaro.org> <854fb1a2-e5f1-f237-685f-8ddb0557c98b@arm.com> Cc: Catalin Marinas , Will Deacon , Mark Rutland , Kees Cook , Ard Biesheuvel , Sami Tolvanen , Nicholas Piggin , James Morse , Marc Zyngier , Joey Gouly , Peter Collingbourne , Vincenzo Frascino , "Peter Zijlstra (Intel)" , Stephane Eranian , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Message-ID: Date: Fri, 22 Oct 2021 16:40:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <854fb1a2-e5f1-f237-685f-8ddb0557c98b@arm.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211022_084031_384936_869CD5AF X-CRM114-Status: GOOD ( 20.58 ) 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 22/10/2021 16:36, James Clark wrote: > > > On 21/10/2021 14:45, Leo Yan wrote: >> Now Arm64 provides API for enabling and disable PID tracing, Arm SPE >> driver invokes these functions to dynamically enable it during >> profiling when the program runs in root PID name space, and disable PID >> tracing when the perf event is stopped. >> >> Device drivers should not depend on CONFIG_PID_IN_CONTEXTIDR for PID >> tracing, so this patch uses the consistent condition for setting bit >> EL1_CX for PMSCR. > > Hi Leo, > > I've been testing this change, but I'm seeing something strange. Not sure > if it's a problem on my side or not yet. With this command: > > sudo ./perf record -vvv -e arm_spe//u -- taskset --cpu-list 1 bash -c ls > > I'm only seeing 0 values for context: > > sudo ./perf report -D | grep CONTEXT > > . 00038dce: 65 00 00 00 00 CONTEXT 0x0 el2 > . 00038e0e: 65 00 00 00 00 CONTEXT 0x0 el2 > > I added a printk to the function, and I see it print non zero values, although > there are some zero ones mixed in there too: > > diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h > index 0c1669db19a1..8f0fb43a5fac 100644 > --- a/arch/arm64/include/asm/mmu_context.h > +++ b/arch/arm64/include/asm/mmu_context.h > @@ -33,7 +33,8 @@ static inline void contextidr_thread_switch(struct task_struct *next) > if (!static_branch_unlikely(&contextidr_in_use)) > return; > > - write_sysreg(task_pid_nr(next), contextidr_el1); > + printk("Set %d\n", task_pid_nr(next)); > + write_sysreg(task_pid_nr(next), contextidr_el2); Ignore this second line change, that doesn't even compile. It's just the printk that I added. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel