Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp120015imm; Fri, 3 Aug 2018 00:12:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf6khVcDbeP41SJnYO/yUGt0ZedrYO4pnR83daqhJiGqL84xvav7I0GEETF77L/pdokJM6I X-Received: by 2002:a17:902:6b:: with SMTP id 98-v6mr2384878pla.68.1533280352857; Fri, 03 Aug 2018 00:12:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533280352; cv=none; d=google.com; s=arc-20160816; b=LTkQI3ZlpSEhu8fqhbInm3RosSZijrMkCwE69I73TMRjZMdoQviMv94tLxwOniXGyW 0BGSl8x3uCtpXy7ulKiqvZEb+81xxh4+sea4CcevUb5e69wkpUFoC+xi1hb2OWuHms1e j2AO+gqx+ED0Thv1HHe4NxHkjp5tpfJHTOSVPIk2M8AWrpximfIIDY6XuVAVm9ieuKbU cSlO1fuC9RxU+aeLY1htalOa4wLgbG5ryn3w5d3kx73WQY+OgcVBJpHqyx+5Pycs6u6J 32IRxvZr9fcl+dBubUl/8C80Lzo9QQJdtdL9aY+WaoumoXzTbyQ6WPcrZpJmM1IHo5K1 TG+g== 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 :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=O3Tuvz/QMcn4bI7Sw1vdWSkSG/4e0B2fTumQ0HVLE4Q=; b=ZWUeqosoEmiC7ZddYzAGsJ/hQqOHAZAYNQrUjbh521LP0AKFeiFKIU2DrF1qvPkrYz RA44NmxBfVoOafxB3cAy85KVdX4042CK5DCkJ4OLN0WUIDxxB82unhB7h1Fcvhn9sC7q VCxeKYcOGqJvUtcyyCKX7BhDVhFPGzyhOuwj4IrIPdKQDJ1c5SoulJsw+iQ20/z/tzCk iErVPhEFxP91pbAT2ivIpU2X9Jh8VH8mFufBkSapWzctY7y1Ypa+w6KDAmLoFtweTJBB fbiWMqV3b4tKR62+VGISjfYfAeuqF+Wy9VELRFbGbtwpB5YTjRqXHs2mOJHBk7kxhQlE elYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=MTxVj2Hd; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a64-v6si4838326pfb.224.2018.08.03.00.12.17; Fri, 03 Aug 2018 00:12:32 -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=@gmail.com header.s=20161025 header.b=MTxVj2Hd; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728033AbeHCJGX (ORCPT + 99 others); Fri, 3 Aug 2018 05:06:23 -0400 Received: from mail-oi0-f50.google.com ([209.85.218.50]:36228 "EHLO mail-oi0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727199AbeHCJGX (ORCPT ); Fri, 3 Aug 2018 05:06:23 -0400 Received: by mail-oi0-f50.google.com with SMTP id n21-v6so8164137oig.3 for ; Fri, 03 Aug 2018 00:11:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=O3Tuvz/QMcn4bI7Sw1vdWSkSG/4e0B2fTumQ0HVLE4Q=; b=MTxVj2HdAnceDw61/44ccVwH6SV1V5xo3TgzNgJccAlJUI7bI9ndK4Kqo6pchjttZM WPKoQ0WK56J8/D7wmy6ol1LfCiU4Knx/C29R4+sxdAAYPSC/rGuzWvxBI12jiwM6fAmo gzvg6sxzzpErmr9r855tZ+hx25Xt5MjEL9fGIhKa26quSjsufKxqrdnwZqhi8NnawUio /tmWejgaJ9RfdiK6v6DWrM3cxbob+PQIvV0MKAh+mAXngi2h392eVLp3VPx1Si4bWOSr mEK8CdOFpAl77ul7DnNJZ8Qv2K3xmyk8pnDd0xFA0LfRDdzgkPKtGhjVvDzxNeIfkWO3 uV9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O3Tuvz/QMcn4bI7Sw1vdWSkSG/4e0B2fTumQ0HVLE4Q=; b=ESEivayiSgnROi0NFLp2pUnxirMXF1MSZNETQwIczghz5dpJdR6NNB+EPCYTKyaJc5 KIbfiwBNTfCoh/xvMPLDha0hLmiOl2uVRiviRv3m1gi0lmUT5UlvKHT6qmF9LPS7GFEV MmeDvZCCLG2n3hH1pwj0wg+j5tlaq/cWCGM6iNO+BubO8t3yPK8mG3cmwKKKWmRRYNpp 0sW+30hEgAe9+bVpqsKFfA0AXzLXohKBQxcBdpTBzTgEu6GeL01jZb7i17YMgO/ZVimc bQkBgCmBvbPLM2fR73ZtOKiLT+Z7UL98zVTxxe7JryuUkfXKrZhvcZik2gc0j92ijxJO eXWQ== X-Gm-Message-State: AOUpUlEJ6920SLKcxwc96oW16XaHUOF0CGarWcZia5txIiTI+wL2oEKN YfXJ9alyksaCYjZNz4aekAWTYaeJPr14iOCkEzI= X-Received: by 2002:a54:4f94:: with SMTP id g20-v6mr2152706oiy.130.1533280288520; Fri, 03 Aug 2018 00:11:28 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Andrew Pinski Date: Fri, 3 Aug 2018 00:11:16 -0700 Message-ID: Subject: Re: framebuffer corruption due to overlapping stp instructions on arm64 To: mpatocka@redhat.com Cc: Catalin Marinas , Will Deacon , linux@armlinux.org.uk, thomas.petazzoni@free-electrons.com, linux-arm-kernel@lists.infradead.org, LKML , GNU C Library 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 Thu, Aug 2, 2018 at 12:31 PM Mikulas Patocka wrote: > > 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? Yes fix Links not to use memcpy on the framebuffer. It is undefined behavior to use device memory with memcpy. Thanks, Andrew Pinski > > 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