Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2494341imm; Thu, 2 Aug 2018 12:33:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeJQ8UeX3Rb/4v2dMl9/uoaL27fACNnxTdyy4tThJj5XT0RckoxsxS/kVpN8v8uplkExsJs X-Received: by 2002:a63:5866:: with SMTP id i38-v6mr748403pgm.63.1533238400253; Thu, 02 Aug 2018 12:33:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533238400; cv=none; d=google.com; s=arc-20160816; b=AVSqr1m9yTYIo0URGWNmiY0In2mLbiraGWkrIDjkRWE2MCjMGOSmbVUdt5YegkIl3p 5x2OR2PJ6gHcVhZoherZUIHCCuYth/9cURMbOJ6qflZ7VU1zrQJuMnrC7SS4zClYmLOd uhGoUd9/1adzISbQ+PzdsknrTkE0BUdZlwGkIihLjZ6Wm6eoinHp/Ksz8sW8OP1SzICY qRVqzIZaZrr7QgbKzNs8ypQqXhvr602QdPUrVm8kXeg/7a9zAjHmCXWoX+qFbvvvNct3 7Lmx+KBHOV55z6fRQ7hIelIbS0+shNDpWW5zrHVh6ZnVmbvkysMlXy59EYiZ8JKh2UEZ QNlA== 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:message-id :subject:cc:to:from:date:arc-authentication-results; bh=0X3JpQJbAEMkO+8BZDZk78TkSvk9neyJVk/BUAL1Dm8=; b=s08maSV8ZJewmnuor6rbdA+4JhsALNEF+CI9HtQHQGno6IRyV3wX0mM0MvNj6hsBOi TIzNG76+hCiqjesihvsK+6zbpN1wCBAbeeZ/cLPokXmuWpOB9UlUTLoxsjztohsJV+c2 kgcsW73NlN42OpW4EZqlnLhmfcpL60wbPFi82fqHR7dp530+J/+Aw94mAnbyFTuPtXQW uxlXf8SLCxYafrrESPDL1/LWbLdZWrxKTHUgFObgqP8D1/A6B+xBv48CkMuR1Am0kiu8 /e33yrzMOhCQrbABIiZg/eqKW5Q2MBnn5N2BvnKmxk+KrntXl++j/rGYI4LltODweAWG /iNg== 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 95-v6si2149356plc.466.2018.08.02.12.33.05; Thu, 02 Aug 2018 12:33:20 -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 S1729639AbeHBVXu (ORCPT + 99 others); Thu, 2 Aug 2018 17:23:50 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:41784 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726654AbeHBVXu (ORCPT ); Thu, 2 Aug 2018 17:23:50 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5A0DDF2B54; Thu, 2 Aug 2018 19:31:18 +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 30E9F100708A; Thu, 2 Aug 2018 19:31:18 +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 w72JVILG032049; Thu, 2 Aug 2018 15:31:18 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id w72JVG7b032045; Thu, 2 Aug 2018 15:31:17 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Thu, 2 Aug 2018 15:31:15 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: Catalin Marinas , Will Deacon , Russell King , Thomas Petazzoni cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, libc-alpha@sourceware.org Subject: framebuffer corruption due to overlapping stp instructions on arm64 Message-ID: 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.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 02 Aug 2018 19:31:18 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Thu, 02 Aug 2018 19:31:18 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.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 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 different 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? I tried AMD card (HD 6350) and NVidia (NVS 285) and both exhibit the same corruption. OpenGL doesn't work (it results in artifacts on the AMD card and lock-up on the NVidia card), but it's quite expected if even simple writing to the framebuffer doesn't work. Mikulas