Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3737489imm; Mon, 6 Aug 2018 09:43:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdEk4WGwVSCagjRIqx2Ga7l7MV8peTAFHllADkouG+irXtME6FibAQTrrp+poIMoq2pRGkD X-Received: by 2002:a63:4d47:: with SMTP id n7-v6mr15158239pgl.270.1533573801065; Mon, 06 Aug 2018 09:43:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533573801; cv=none; d=google.com; s=arc-20160816; b=xLhE6hGSyvgfD1biadkVCZOCzwhzGS4dKS9TZg5Op9kMWFhjx2D/e/2n5fW8XrfODA wHbf7Rj2XrjJ6zt9A4pTvL6lQ4R+cOccGmsE7zlLA4EZyWpAq7ki5R2amJyjejN0Hj4F xlOBp4Hj9DMEc4NthYjEGPt+8dt98Nu4gtYDifCHFKIk2+8HR1uvdycIjd29IoMVJd2y qojdb4wc6k+MLbdW+RxuII19yPakApcuIbilUscjNgrUgYSgXN0a3VGtLMQtMd7RSlzA OI+VJhZpB83sUIA5lfACLxFdQWFhe7SBmiDZaFXlZq8mKDhhwz3Zj5MDVmaJTekID+G+ 2Dkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=H2CzqvJKjXzXYMVy3svae+zgTT/t2E6Ky/lfqJ+uo0Y=; b=KBijKPGj3NgpTWyH+FtKqDfXBwr7uJeSxFOGQ6vzjHfq17Q7tQomHRTi08CJnDX+lq UwcAehTXo0CzMR3s6DLXnz0wgJZ2L6jU6Jw5hlEFgGjaxa2juLLeuZpnPxwy3haEECql 2bhRsla0udNj9djx2m7t89f/XQsb4o6C2zird5kRNmHSHjsnae1CCuCsc78zcgqZpZ7V QbKuAyz3UjtXB1nS6uOyPE2NXQh4IHG3/DJkpNCnlMh/cop8d0kAoCy2SM1+OxEJkRBa WIKiLknMK5xG6513MZzxSxni8bzrwWlaxsXknDRzoD8sPrQhrRHjKDyE8pdWXMkjShU3 CZWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RRuS1JA1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 186-v6si14512672pff.270.2018.08.06.09.43.06; Mon, 06 Aug 2018 09:43:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RRuS1JA1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732909AbeHFR5U (ORCPT + 99 others); Mon, 6 Aug 2018 13:57:20 -0400 Received: from mail-it0-f51.google.com ([209.85.214.51]:50366 "EHLO mail-it0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728626AbeHFR5U (ORCPT ); Mon, 6 Aug 2018 13:57:20 -0400 Received: by mail-it0-f51.google.com with SMTP id j81-v6so16270024ite.0 for ; Mon, 06 Aug 2018 08:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=H2CzqvJKjXzXYMVy3svae+zgTT/t2E6Ky/lfqJ+uo0Y=; b=RRuS1JA1QS1V6gB10KpcBMPjuYnhBy2ZSLs7/SkyL5kUJ5wmQ0CfK3RT94iFxgqhAK t7VLXlz2POQY8SY7eqcCMIzrYs9ifyI5N4d+BtfhA6WSJ+kI58rAslNdMDqyF3f4FASq kL3Fy2ljwKAF1EzjSz58J1M1TLErVMvuq7Pgs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=H2CzqvJKjXzXYMVy3svae+zgTT/t2E6Ky/lfqJ+uo0Y=; b=QDyV4rAo/fWuM+oMFdh48wGmmZ7jtlmQuyuyCjQtgVfEzyf+hbRGfZihpy8VRNK3RR OOqgqD3nF/yfCt7ui94eYD9gd+9/4iMHpj7PU9tZdH8bwPNsh0/k32plGvoPEmaQD959 dXdDCHz/FmxGK8dfg8QW5mLE78/IITGKSVpMAJEZLqtps/mAYccZtkWv3Gnp/rr0WX83 rIUfb8VNPjsExOuqRllFYW53CIYaB9l66VLTlOUktJvvgvcAKYk6/taYOy/gtRbScXI5 wrs5SSWgUTD3iPFIlw/zRHLZED4ZV2Ry6EwOJwBnjntrB1CpjMdOIxJmE/xa9gBKdo9l ksMA== X-Gm-Message-State: AOUpUlHvA4rntaF7yFfLRYIi3u/q0caZXbhCqE0XcuxFyXwXIfbVQu8n r2AIeYPW5hcSK41PxLKwofpXbjilB1RYejeQTDgGUA== X-Received: by 2002:a02:35a:: with SMTP id y87-v6mr13463167jad.2.1533570457733; Mon, 06 Aug 2018 08:47:37 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:ac05:0:0:0:0:0 with HTTP; Mon, 6 Aug 2018 08:47:36 -0700 (PDT) In-Reply-To: <99fff4fe-afa9-f12f-a518-472a9dd1c530@arm.com> References: <20180803094129.GB17798@arm.com> <99fff4fe-afa9-f12f-a518-472a9dd1c530@arm.com> From: Ard Biesheuvel Date: Mon, 6 Aug 2018 17:47:36 +0200 Message-ID: Subject: Re: framebuffer corruption due to overlapping stp instructions on arm64 To: Robin Murphy Cc: Mikulas Patocka , Thomas Petazzoni , Joao Pinto , linux-pci , Jingoo Han , Will Deacon , Russell King , Linux Kernel Mailing List , Matt Sealey , Catalin Marinas , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6 August 2018 at 14:42, Robin Murphy wrote: > On 06/08/18 11:25, Mikulas Patocka wrote: > [...] >>> >>> None of this explains why some transactions fail to make it across >>> entirely. The overlapping writes in question write the same data to >>> the memory locations that are covered by both, and so the ordering in >>> which the transactions are received should not affect the outcome. >> >> >> You're right that the corruption couldn't be explained just by reordering >> writes. My hypothesis is that the PCIe controller tries to disambiguate >> the overlapping writes, but the disambiguation logic was not tested and it >> is buggy. If there's a barrier between the overlapping writes, the PCIe >> controller won't see any overlapping writes, so it won't trigger the >> faulty disambiguation logic and it works. >> >> Could the ARM engineers look if there's some chicken bit in Cortex-A72 >> that could insert barriers between non-cached writes automatically? > > > I don't think there is, and even if there was I imagine it would have a > pretty hideous effect on non-coherent DMA buffers and the various other > places in which we have Normal-NC mappings of actual system RAM. > Looking at the A72 manual, there is one chicken bit that looks like it may be related: CPUACTLR_EL1 bit #50: 0 Enables store streaming on NC/GRE memory type. This is the reset value. 1 Disables store streaming on NC/GRE memory type. so putting something like mrs x0, S3_1_C15_C2_0 orr x0, x0, #(1 << 50) msr S3_1_C15_C2_0, x0 in __cpu_setup() would be worth a try.