Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp876075imm; Wed, 8 Aug 2018 07:13:35 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyYBvMN40besP+H2K0jymLY3biGTYCFsT5TZtNKSnlxxFL/tTS57u1de/WAzf3EJw1CHVMM X-Received: by 2002:a62:e218:: with SMTP id a24-v6mr3212882pfi.75.1533737615713; Wed, 08 Aug 2018 07:13:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533737615; cv=none; d=google.com; s=arc-20160816; b=TLEejlS6ahG97NxgCS6JaztY2vUJz6hZm+ms0PTQDbrcrFTlAA/9UhlSlPqe6dGx+M W2fN4ZnQQ4AmvtVnGpJqN2S8vabRNrPIzmLnAsfd/38vcf+cp8ciOw1SIL5SJr4JrZDz c4oO/wIZVtDRiaijHW5Syn/Sf7McYu1zuysSsNeEXnsofRkUjEg33EwPSPgJH4uFJprD YCnIw0uC5//3lMNWyQ5C7n0Gt6KGSLRpsHB+L9tm+l+h1btXSoNyreM+ew1VsOfJdPNs DsY06Xm6JLUuwLPHEuYUcUXbYsmGvQeu/gCwU9D9c4UQaAXpEuEvhsDIuiZRWD/LIt7r ZSkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=poqP5ZixP/JNgPyfb13SncmORfqh+kM62sDDBH87bEc=; b=bYHAbazJ+NkbDaDxIKC0f7FxvtTA2GoxLPtz+ejWeauHXPJ7KMUjsmGGCsoFSI4kZ2 Wpf2Eh5zozUQazZ1LgoBhK7j0rtTkSQocw/rqeMB4u/Yj1aMyzI/wJ3kELIlAzImLt2u QlcmHZmZVBmOAYJTHh74VvcKUeIf/w9EHIOefuNI3164ksQJsb1oIeeziEKw7cZMsisd N9bZBLCDOwPmd/UDn+TUbv9+ZAI8+RHic7kNti3fVnWmW1hyKBB4LhFErG/LwRSSczeC aC8G5AERhLINrtk966AI+jnWrAfd6n3gmm7uM4m47p1OeOjJniEc0giyWlRtocIkyoxh HAng== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i20-v6si4441589pgb.547.2018.08.08.07.13.21; Wed, 08 Aug 2018 07:13:35 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727486AbeHHQcS (ORCPT + 99 others); Wed, 8 Aug 2018 12:32:18 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:33140 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727109AbeHHQcS (ORCPT ); Wed, 8 Aug 2018 12:32:18 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B212E819701A; Wed, 8 Aug 2018 14:12:27 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A503B1C723; Wed, 8 Aug 2018 14:12:27 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id w78ECRiC010619; Wed, 8 Aug 2018 10:12:27 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id w78ECREE010616; Wed, 8 Aug 2018 10:12:27 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Wed, 8 Aug 2018 10:12:27 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Catalin Marinas cc: Will Deacon , Jingoo Han , Joao Pinto , Thomas Petazzoni , libc-alpha@sourceware.org, Ard Biesheuvel , Russell King , Linux Kernel Mailing List , Matt Sealey , linux-pci@vger.kernel.org, linux-arm-kernel Subject: Re: framebuffer corruption due to overlapping stp instructions on arm64 In-Reply-To: <20180808113927.GA24736@iMac.local> Message-ID: References: <20180803094129.GB17798@arm.com> <20180808113927.GA24736@iMac.local> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 08 Aug 2018 14:12:27 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 08 Aug 2018 14:12:27 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mpatocka@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 8 Aug 2018, Catalin Marinas wrote: > On Fri, Aug 03, 2018 at 01:09:02PM -0400, Mikulas Patocka wrote: > > while (1) { > > start = (unsigned)random() % (LEN + 1); > > end = (unsigned)random() % (LEN + 1); > > if (start > end) > > continue; > > for (i = start; i < end; i++) > > data[i] = val++; > > memcpy(map + start, data + start, end - start); > > if (memcmp(map, data, LEN)) { > > It may be worth trying to do a memcmp(map+start, data+start, end-start) > here to see whether the hazard logic fails when the writes are unaligned > but the reads are not. > > This problem may as well appear if you do byte writes and read longs > back (and I consider this a hardware problem on this specific board). I triad to insert usleep(10000) between the memcpy and memcmp, but the same corruption occurs. So, it can't be read-after-write hazard. It is caused by the improper handling of hazard between the overlapping writes inside memcpy. Mikulas