Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3556216imm; Mon, 6 Aug 2018 06:53:51 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdgZA9kg15WDNVw5omcpeCCc5+5qTeS+jCy9wM3a4BihyLV+BljWDZ8P/6iLDAW6BRiXyeR X-Received: by 2002:aa7:8591:: with SMTP id w17-v6mr17296145pfn.77.1533563631390; Mon, 06 Aug 2018 06:53:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533563631; cv=none; d=google.com; s=arc-20160816; b=SktB9PcJJ1z8zXSAFCQtwOdBsIFa5JRWpRbjd2wYgrGCTgfhp4RQjIbN+kaD91f2uH 4C5W4jEtLNY2Xk9fDe7cSF0k7yBZf9agK87/cmemIY/MDuIF1pToxX7+bUHY9QWQ7e7M tviyRxd7HXbE5tiYMsLfjtCjaOgI4sfrE9Y+ZLF7EcXmXRucWDPdo4uQJUBPYMd8vyVO YBr+brNn1h3r9zk+lRSYagDAEpO+gpxjl7R9t2uTq7+lTNZwQydT6wR1xKHOTjcyQoXQ WmvM2gU2iFx3X3TyvieDDx7bMb26vvuWKk6d8nsTLf1Muw6067bVGOe7kpHZOmc7/1ml BKDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=eNS0ikWuOr1riUnoVxKwuO0tUIWLAzWdBq8R1jryiJE=; b=fZXoqKkwMeYtrXFbM0bvGo1S7Zpcw/gKcw1iHKTwsA7n1/YJkIb5EIoIfHu6F0OzWh 0PabWDWbIsrj1bBt/B/sgTFPianpvra5fTs86nvTidLcdUdQmkYCoFX4KeqAjSTruZjP rY7VYCrC/6Td3JIaorYb/kOOGRnffmHeBT7MT/T2jM6sn3ErU3vLlODiJmStnr5pmiM+ VmOxQGATG5pn4fHhoY2a9cS0yZ89oLDBF38v3NIh9HHRnaGpyxyy6Xhna2djaj0Q9LF0 T/mcIcOSrICZp4HhoCvV+TipydDeygazKcOZX+WpC+m7oIK0UYEC1i+M86z7WiBPtGnv zfWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Hd3m+iXO; 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 f90-v6si10455206plf.30.2018.08.06.06.53.36; Mon, 06 Aug 2018 06:53:51 -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=Hd3m+iXO; 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 S1730499AbeHFP5m (ORCPT + 99 others); Mon, 6 Aug 2018 11:57:42 -0400 Received: from mail-it0-f46.google.com ([209.85.214.46]:50849 "EHLO mail-it0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729230AbeHFP5m (ORCPT ); Mon, 6 Aug 2018 11:57:42 -0400 Received: by mail-it0-f46.google.com with SMTP id j81-v6so15707880ite.0 for ; Mon, 06 Aug 2018 06:48:30 -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:content-transfer-encoding; bh=eNS0ikWuOr1riUnoVxKwuO0tUIWLAzWdBq8R1jryiJE=; b=Hd3m+iXONIvfUjJ4K7qOkH/xiSDmgS9OwWHzqmErF3aV1oyB3IKAbJH0GabwK/vcDz BsEFkVW2ts35soT3y47eWtEw2YwWniedi0KnFwp2Ec+G0P0kqOOyVC0saYL3hVBq5aFo Q+bE3rqrr9rEqlxlwBQxPrhOwGoo26/KDEBKk= 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:content-transfer-encoding; bh=eNS0ikWuOr1riUnoVxKwuO0tUIWLAzWdBq8R1jryiJE=; b=Kb7IcqugZnwZPP651F778I78NPxzO9EgRx8atMLuyx6fh7xLdQVNA47XNP0KWDUjRM vjfhzKxTnQX61TM+IWo8Dssau554A7meYvT873AwXn5q4sXpdwmZa12FVepMXbjVKw2X 8HPHQ8sfQ7s3lksgUIyea4Hi6t/js1A+8kpBh6tlsJkW0X4nS+FbRs6dE0bTKwt4dIbn eVhxLU0mGclvOMNkVCl2Qpu9l1RsdZqN1N4cWWlPu+ksZZGfvejDaGPZvBIlS37cE6nT 1iGX4RRjg1pyGLzF7Bgk+a/iXxejyvx+kgnUd/FKsJFDb6DfHIFnqV6PP9vAQw/C+1ge LXiQ== X-Gm-Message-State: AOUpUlFOZWEDyQ/47IHxWrWE0czkVgB3XUx84aF8lP7dORfhtx02hd8j 17xtJi2lF9DqsXFneV41N9fmXVQXRp8gALSpX0NC1Q== X-Received: by 2002:a24:148c:: with SMTP id 134-v6mr15103492itg.50.1533563309700; Mon, 06 Aug 2018 06:48:29 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:ac05:0:0:0:0:0 with HTTP; Mon, 6 Aug 2018 06:48:28 -0700 (PDT) In-Reply-To: References: <20180803094129.GB17798@arm.com> <99fff4fe-afa9-f12f-a518-472a9dd1c530@arm.com> From: Ard Biesheuvel Date: Mon, 6 Aug 2018 15:48:28 +0200 Message-ID: Subject: Re: framebuffer corruption due to overlapping stp instructions on arm64 To: Marcin Wojtas Cc: Mikulas Patocka , Robin Murphy , Thomas Petazzoni , Joao Pinto , Catalin Marinas , linux-pci , Will Deacon , Russell King - ARM Linux , Linux Kernel Mailing List , Matt Sealey , Jingoo Han , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6 August 2018 at 15:41, Marcin Wojtas wrote: > Hi Mikulas, > > pon., 6 sie 2018 o 14:42 Robin Murphy napisa=C5=82= (a): >> >> 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 reorder= ing >> > writes. My hypothesis is that the PCIe controller tries to disambiguat= e >> > the overlapping writes, but the disambiguation logic was not tested an= d it >> > is buggy. If there's a barrier between the overlapping writes, the PCI= e >> > 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. >> >> > I observe these kinds of corruptions: >> > - failing to write a few bytes >> >> That could potentially be explained by the reordering/atomicity issues >> Matt mentioned, i.e. the load is observing part of the store, before the >> store has fully completed. >> >> > - writing a few bytes that were written 16 bytes before >> > - writing a few bytes that were written 16 bytes after >> >> Those sound more like the interconnect or root complex ignoring the byte >> strobes on an unaligned burst, of which I think the simplistic view >> would be "it's broken". >> >> FWIW I stuck my old Nvidia 7600GT card in my Arm Juno r2 board (2x >> Cortex-A72), built your test program natively with GCC 8.1.1 at -O2, and >> it's still happily flickering pixels in the corner of the console after >> nearly an hour (in parallel with some iperf3 just to ensure plenty of >> PCIe traffic). I would strongly suspect this issue is particular to >> Armada 8k, so its' probably one for the Marvell folks to take a closer >> look at - I believe some previous interconnect issues on those SoCs were >> actually fixable in firmware. >> >> > > On my Macchiato I use GT630 card (nuveau driver) + debian + xfce > desktop and in dual monitor mode, I could run a couple of 1080p > streams. All smooth and I've never noticed any image corruption > whatsoever (I spent a lot of time in front of such setup). Just to be > on a safe side, can you send me a bootlog and your board revision? I'd > like to see your firware version and type. > Hi Marcin, Could you please try running his reproducer?