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=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 40CB8C4338F for ; Tue, 3 Aug 2021 03:51:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2239860187 for ; Tue, 3 Aug 2021 03:51:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233736AbhHCDvT (ORCPT ); Mon, 2 Aug 2021 23:51:19 -0400 Received: from foss.arm.com ([217.140.110.172]:42544 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233719AbhHCDvN (ORCPT ); Mon, 2 Aug 2021 23:51:13 -0400 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 3219511D4; Mon, 2 Aug 2021 20:51:02 -0700 (PDT) Received: from [10.163.67.68] (unknown [10.163.67.68]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8FF773F70D; Mon, 2 Aug 2021 20:50:58 -0700 (PDT) Subject: Re: [PATCH 10/10] arm64: errata: Add workaround for TSB flush failures To: Marc Zyngier Cc: Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, will@kernel.org, catalin.marinas@arm.com, james.morse@arm.com, mathieu.poirier@linaro.org, mike.leach@linaro.org, leo.yan@linaro.org, mark.rutland@arm.com References: <20210728135217.591173-1-suzuki.poulose@arm.com> <20210728135217.591173-11-suzuki.poulose@arm.com> <87mtq5a1gs.wl-maz@kernel.org> <477c4943-7c35-8502-0291-4c0ed3a03905@arm.com> <32f719c8f9f61b244b3fc29137f76a19@kernel.org> From: Anshuman Khandual Message-ID: Date: Tue, 3 Aug 2021 09:21:48 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <32f719c8f9f61b244b3fc29137f76a19@kernel.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/2/21 3:05 PM, Marc Zyngier wrote: > On 2021-08-02 10:12, Anshuman Khandual wrote: >> On 7/29/21 4:11 PM, Suzuki K Poulose wrote: >>> On 29/07/2021 10:55, Marc Zyngier wrote: >>>> On Wed, 28 Jul 2021 14:52:17 +0100, >>>> Suzuki K Poulose > > [...] > >>>>> +            __tsb_csync();                        \ >>>>> +            __tsb_csync();                        \ >>>>> +        } else {                            \ >>>>> +            __tsb_csync();                        \ >>>>> +        }                                \ >>>> >>>> nit: You could keep one unconditional __tsb_csync(). >>> >>> I thought about that, I was worried if the CPU expects them back to back >>> without any other instructions in between them. Thinking about it a bit >>> more, it doesn't look like that is the case. I will confirm this and >>> change it accordingly. >> But its a very subtle change which might be difficult to debug and blame >> later on, if indeed both the instructions need to be back to back. Seems >> like just better to leave this unchanged. > > Is that an actual requirement? Sounds like you want to find out > from the errata document. Sure, will get back on this. > > And if they actually need to be back to back, what ensures that > this is always called with interrupt disabled? > > You would also need to have them in the same asm block to avoid > the compiler reordering stuff. Agreed, both the above constructs will be required to make sure that the instructions will be executed consecutively (if required). 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=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 8A546C4338F for ; Tue, 3 Aug 2021 03:52:49 +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 4B4EA61029 for ; Tue, 3 Aug 2021 03:52:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 4B4EA61029 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: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=ezt5Uh6+AbXhk6hSj5sGW+1/LyBDQnPOKWAvXdrQScw=; b=r9BJt/c9LYMiNxO0H9RkHibGEY xMdPIe2pbJn+eu5JbTz0mxc0YX0s10m9AZO3/wW1xj889KSXSNkGGxzrtvS29XFxwsCOJljVghMpo 0f5N9IIxjla+tOCoUL9XUiVg/+G5VniicnI/Uk6WWoxMEcOpF8mOMCMOG38+AcQi0Fv8Hm2a3uvsn ErB1uMONSUOuIGZ/BuW4i8SrlM0lCDaNclFR4CwbsQfXPjin6e/uIYZEpNsg0FP0dGh86bePCJ/px pf198JLqAncMo6Y0SdV/OK+iwxYC/RV/v+M5vdgtKMNyx4gfatYL4VrZk+dki7DUzbFET1swUhDaN S8i+bwsQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mAlSO-000xAj-Pk; Tue, 03 Aug 2021 03:51:08 +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 1mAlSK-000xAJ-RH for linux-arm-kernel@lists.infradead.org; Tue, 03 Aug 2021 03:51:06 +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 3219511D4; Mon, 2 Aug 2021 20:51:02 -0700 (PDT) Received: from [10.163.67.68] (unknown [10.163.67.68]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8FF773F70D; Mon, 2 Aug 2021 20:50:58 -0700 (PDT) Subject: Re: [PATCH 10/10] arm64: errata: Add workaround for TSB flush failures To: Marc Zyngier Cc: Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, will@kernel.org, catalin.marinas@arm.com, james.morse@arm.com, mathieu.poirier@linaro.org, mike.leach@linaro.org, leo.yan@linaro.org, mark.rutland@arm.com References: <20210728135217.591173-1-suzuki.poulose@arm.com> <20210728135217.591173-11-suzuki.poulose@arm.com> <87mtq5a1gs.wl-maz@kernel.org> <477c4943-7c35-8502-0291-4c0ed3a03905@arm.com> <32f719c8f9f61b244b3fc29137f76a19@kernel.org> From: Anshuman Khandual Message-ID: Date: Tue, 3 Aug 2021 09:21:48 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <32f719c8f9f61b244b3fc29137f76a19@kernel.org> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210802_205104_976463_102B8F24 X-CRM114-Status: GOOD ( 17.67 ) 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="utf-8" Content-Transfer-Encoding: base64 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org CgpPbiA4LzIvMjEgMzowNSBQTSwgTWFyYyBaeW5naWVyIHdyb3RlOgo+IE9uIDIwMjEtMDgtMDIg MTA6MTIsIEFuc2h1bWFuIEtoYW5kdWFsIHdyb3RlOgo+PiBPbiA3LzI5LzIxIDQ6MTEgUE0sIFN1 enVraSBLIFBvdWxvc2Ugd3JvdGU6Cj4+PiBPbiAyOS8wNy8yMDIxIDEwOjU1LCBNYXJjIFp5bmdp ZXIgd3JvdGU6Cj4+Pj4gT24gV2VkLCAyOCBKdWwgMjAyMSAxNDo1MjoxNyArMDEwMCwKPj4+PiBT dXp1a2kgSyBQb3Vsb3NlIDxzdXp1a2kucG91bG9zZUBhcm0uY29tPgo+IAo+IFsuLi5dCj4gCj4+ Pj4+ICvCoMKgwqDCoMKgwqDCoMKgwqDCoMKgIF9fdHNiX2NzeW5jKCk7wqDCoMKgwqDCoMKgwqDC oMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoCBcCj4+Pj4+ICvCoMKgwqDCoMKgwqDCoMKg wqDCoMKgIF9fdHNiX2NzeW5jKCk7wqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKg wqDCoMKgwqDCoCBcCj4+Pj4+ICvCoMKgwqDCoMKgwqDCoCB9IGVsc2Uge8KgwqDCoMKg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