Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2877162imm; Sun, 5 Aug 2018 14:37:48 -0700 (PDT) X-Google-Smtp-Source: AAOMgpceqklf/B3O9+ANVqmsQNk0UVHc0/jQKCZaysHXcOIvUt4bWcuPC6V3tx7x8WtWsKEl2eAX X-Received: by 2002:a63:6604:: with SMTP id a4-v6mr11850342pgc.404.1533505067973; Sun, 05 Aug 2018 14:37:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533505067; cv=none; d=google.com; s=arc-20160816; b=xofiTS3ssJ9V4uTRjXBoSiB1jlhr8VxFb9FsB+C0mFNykesFpzBi5hwSnt2o3pANx7 Vw8bPT+sV6Z4tC0cUUFZInBLW7kqSvrqZVIGEvw9Ga8BABruqdKqrqnkgbXK1AURU07N Q8Ro1MBA42a6Aedwso9WtvxclymF6jHbJVTHUvsoatM/pp81wpXrJOtBp7RqAGoRwd36 /AUg5/Ytkc4dOAGpsIOGP/pFBSxDipSRXfdlpu4fJW6V8O3PspgK6TILAXPK0Px0QbRu Gwdthn7NdqUn+6TOMUEcCScbdNcduRVknA5v8n5R39gsqqrNapGZ8Cqt7lqv2GAIP3Aw HWig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=TRRkFpjYRNguxqibCqnwSlHN5/HJqTxvzMliJIZqlYI=; b=JY6eVOY2nBTfag9DtB+Z4+7NnhyqqVYoyXnOVPd+9ZaKzps7TmGBYZ+YsZpmKetecx CK7FcyVUPtrIgANgv2Y+YzsvJv0zx02ZiScLTEE9cNBhWQE+HoCR/XOIqjM4MzFnLP8m eRlwnfaCPSPcwsJHAHz+sRhhAPGxfrpkbqqXRTsD8NlwT8BbxkhSoSECDeiBjyOyAumx nuNIWUTpJsyI98wKKFeCmFf2lrTpZUF2YAXBdDgyldEaViqbITX03HipIV41koj2BQMk QuFGSz3hfufPVKAx0GFBKH713vZM7hslyGPSHhuepziW3cI2pmL2BoRamcXJIbQQuO63 yrBw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x68-v6si11673114pfc.239.2018.08.05.14.37.33; Sun, 05 Aug 2018 14:37:47 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728434AbeHEXmU (ORCPT + 99 others); Sun, 5 Aug 2018 19:42:20 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:42771 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727154AbeHEXmT (ORCPT ); Sun, 5 Aug 2018 19:42:19 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 2194E80686; Sun, 5 Aug 2018 23:36:17 +0200 (CEST) Date: Sun, 5 Aug 2018 23:36:15 +0200 From: Pavel Machek To: Andrew Pinski Cc: mpatocka@redhat.com, Catalin Marinas , Will Deacon , linux@armlinux.org.uk, thomas.petazzoni@free-electrons.com, linux-arm-kernel@lists.infradead.org, LKML , GNU C Library Subject: Re: framebuffer corruption due to overlapping stp instructions on arm64 Message-ID: <20180805213615.GA1862@amd> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EeQfGwPcQSOJBaQU" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > I tried to use a PCIe graphics card on the MacchiatoBIN board and I hit= a > > strange problem. > > > > When I use the links browser in graphics mode on the framebuffer, I get > > occasional pixel corruption. Links does memcpy, memset and 4-byte writes > > on the framebuffer - nothing else. > > > > I found out that the pixel corruption is caused by overlapping unaligned > > stp instructions inside memcpy. In order to avoid branching, the arm64 > > memcpy implementation may write the same destination twice with differe= nt > > alignment. If I put "dmb sy" between the overlapping stp instructions, = the > > pixel corruption goes away. > > > > This seems like a hardware bug. Is it a known errata? Do you have any > > workarounds for it? >=20 > Yes fix Links not to use memcpy on the framebuffer. > It is undefined behavior to use device memory with memcpy. No, I don't think so. Why do you think so? I'm pretty sure that gcc is allowed to do memcpy-like tricks even when memcpy is not mentioned explicitely. Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --EeQfGwPcQSOJBaQU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAltnbc8ACgkQMOfwapXb+vLvEwCghtwM3E5SHKxBPLoBsgO5P+Qj /9AAnRly8i+WwIXprkcYsopqJ7QrwYdh =qgvv -----END PGP SIGNATURE----- --EeQfGwPcQSOJBaQU--