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 53465C433F5 for ; Tue, 19 Oct 2021 13:31:56 +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 2190761038 for ; Tue, 19 Oct 2021 13:31:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2190761038 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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=FsPXBxHoECPXpJjyoUEAq2sS4/plCSDSDFzIob5kOHw=; b=RlDzN58YOJ/ITaD4d7sfySk2Ie UfjAhIE/IY3mAN76AxmaCTGXzDccd4Y7oIZpOQ3nqugivGjb5e95THe9Q03QY3rdwrifyqCYwq4PV lhV1ElNCpWVROzkDXZXMGyJRPvPUZWm+hInHgT2ud94C3rXKd0WEH1QKeVHmw63TkEV20nW7T2wBT RkfEoiebiDJnLnGr+nFXAZcQjRXxZDMzUg2VcK57qoxMwYcMvY+HtH9A7Vs1U5DQPcX48sK1dqDRm qZaEzH19hvN/rJpWPPq488f3zRjACUCLnPsQDCkOvzjSKUw8xEMkAnlzA7Y9Lu0nyF4vyAnZfLk3i skibX3Tg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mcpCA-001Qam-L5; Tue, 19 Oct 2021 13:30:22 +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 1mcpC6-001QZz-3A for linux-arm-kernel@lists.infradead.org; Tue, 19 Oct 2021 13:30:19 +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 598A42F; Tue, 19 Oct 2021 06:30:16 -0700 (PDT) Received: from [10.57.25.70] (unknown [10.57.25.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 918433F70D; Tue, 19 Oct 2021 06:30:05 -0700 (PDT) Subject: Re: [PATCH v5 04/15] arm64: errata: Add detection for TRBE write to out-of-range To: Mathieu Poirier Cc: will@kernel.org, catalin.marinas@arm.com, anshuman.khandual@arm.com, mike.leach@linaro.org, leo.yan@linaro.org, maz@kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mark Rutland References: <20211014223125.2605031-1-suzuki.poulose@arm.com> <20211014223125.2605031-5-suzuki.poulose@arm.com> <20211018155041.GA3163131@p14s> From: Suzuki K Poulose Message-ID: <928f02ab-8226-1679-a120-06778d03c93c@arm.com> Date: Tue, 19 Oct 2021 14:29:58 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20211018155041.GA3163131@p14s> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211019_063018_223317_2B4F6404 X-CRM114-Status: GOOD ( 17.95 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 18/10/2021 16:50, Mathieu Poirier wrote: > Good morning, > > On Thu, Oct 14, 2021 at 11:31:14PM +0100, Suzuki K Poulose wrote: >> Arm Neoverse-N2 and Cortex-A710 cores are affected by an erratum where the >> trbe, under some circumstances, might write upto 64bytes to an address after > > Checkpatch gives me a warning about this line... > >> the Limit as programmed by the TRBLIMITR_EL1.LIMIT. This might - >> >> - Corrupt a page in the ring buffer, which may corrupt trace from a >> previous session, consumed by userspace. >> - Hit the guard page at the end of the vmalloc area and raise a fault. >> >> To keep the handling simpler, we always leave the last page from the >> range, which TRBE is allowed to write. This can be achieved by ensuring >> that we always have more than a PAGE worth space in the range, while >> calculating the LIMIT for TRBE. And then the LIMIT pointer can be adjusted >> to leave the PAGE (TRBLIMITR.LIMIT -= PAGE_SIZE), out of the TRBE range >> while enabling it. This makes sure that the TRBE will only write to an area >> within its allowed limit (i.e, [head-head+size]) and we do not have to handle > > I'm pretty sure this line will also be flagged. > Thanks for pointing them out. I have fixed it now. Suzuki _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel