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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78BE1C3B188 for ; Wed, 12 Feb 2020 11:45:07 +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 3F34E20675 for ; Wed, 12 Feb 2020 11:45:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="R4I3J9UD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F34E20675 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1lZRxr8M2aH/IzRjeMfEcL6H3DK8WVMGDwtddG4GU8U=; b=R4I3J9UDKaoTg6RQUTICNn/TK ODuG0itxmXwfsXeUpibu5q+Hz+qoo5r7QMZDQ9UNMYOXoqfl9viT1/kRMmJ4TrtwW8AgFL6F6lSNZ bUbhUo7BdfycUqfQBUlPkUjxOBtfgWpcoV/Y6/tEfEfemrkTGut50ulzBGx8n87U4Q8W8dA4SpGaf LjgSqKICg+RlwAYKN3oKeOSwx+pBmMQWNUpTB966yFhKcMTUlzAS1e5aaXVU57Hq3/xueVRwUhgGM H88R15vOp5BtWWJUgekHdN5lr8cQ4Y/BrHVVGw4ztsYjow5Dh3ih1kuZbNEoJHJN7l2jEazPicYCn W51F3Pypw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1qS2-0001A6-Pb; Wed, 12 Feb 2020 11:45:06 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j1qRz-0000hR-L9 for linux-arm-kernel@lists.infradead.org; Wed, 12 Feb 2020 11:45:05 +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 0C93730E; Wed, 12 Feb 2020 03:45:03 -0800 (PST) Received: from [10.1.197.1] (ewhatever.cambridge.arm.com [10.1.197.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E2F583F68F; Wed, 12 Feb 2020 03:45:00 -0800 (PST) Subject: Re: [PATCH v3 2/7] arm64: trap to EL1 accesses to AMU counters from EL0 To: Ionela Voinescu , catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, maz@kernel.org, sudeep.holla@arm.com, lukasz.luba@arm.com, valentin.schneider@arm.com, rjw@rjwysocki.net References: <20200211184542.29585-1-ionela.voinescu@arm.com> <20200211184542.29585-3-ionela.voinescu@arm.com> From: Suzuki Kuruppassery Poulose Message-ID: Date: Wed, 12 Feb 2020 11:44:59 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20200211184542.29585-3-ionela.voinescu@arm.com> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200212_034503_760478_BDBEC7E8 X-CRM114-Status: GOOD ( 13.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, peterz@infradead.org, viresh.kumar@linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, mingo@redhat.com, linux-arm-kernel@lists.infradead.org, Steve Capper Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 11/02/2020 18:45, Ionela Voinescu wrote: > The activity monitors extension is an optional extension introduced > by the ARMv8.4 CPU architecture. In order to access the activity > monitors counters safely, if desired, the kernel should detect the > presence of the extension through the feature register, and mediate > the access. > > Therefore, disable direct accesses to activity monitors counters > from EL0 (userspace) and trap them to EL1 (kernel). > > To be noted that the ARM64_AMU_EXTN kernel config and the disable_amu > kernel parameter do not have an effect on this code. Given that the > amuserenr_el0 resets to an UNKNOWN value, setting the trap of EL0 > accesses to EL1 is always attempted for safety and security > considerations. Therefore firmware should still ensure accesses to > AMU registers are not trapped in EL2/EL3 as this code cannot be > bypassed if the CPU implements the Activity Monitors Unit. > > Signed-off-by: Ionela Voinescu > Cc: Catalin Marinas > Cc: Will Deacon > Cc: Mark Rutland > Cc: Steve Capper > --- Reviewed-by: Suzuki K Poulose _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel