Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3251324imm; Mon, 6 Aug 2018 01:05:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdjnnUO+b6M/ZpmSg2nNte2QgoFDGVJarLRNkzfQf4sLkEzxZhwFGd1tdlAXwAdcjZwEFTS X-Received: by 2002:a17:902:7088:: with SMTP id z8-v6mr12761919plk.303.1533542740571; Mon, 06 Aug 2018 01:05:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533542740; cv=none; d=google.com; s=arc-20160816; b=U3aWi76IAcdqng5h1wLHNs4PwGmWUuR9UElBSm8RnX4XgHGpnday9jgrsyWg4Y3rec I50misX6V5PamlzL1tgiBm70cLkSHhlIWHCFLPTqvNf0RbCapuQGpFuHpWFqkxg1l1xo ZJiaYmvxTO6ELBCIrSKhSkW0pRweA7u/Q3SOQls+TFIKI3VUNVxF7Zdhsnyb0lWABfm5 1nHrgozT6BOaajKYw4hc/6yOt5RCunaWzXC1PMM720A5gkPi8ffSuJv7/i4VLk6GB7xy xsHoCHaIZ1uJ5ZIOIhWi1YQ8jZoBQ9yaD2UVyfiBBKDNJIKbuv6ZlOkCmzOKBUpcYgAC 9DRQ== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=qDiEAsd4sD7TfPwTQq1ZenGDEl1JnbBUz+7ehXskaI4=; b=RNDLOP0cqUzjWXQeF+iEJhoTExXKh2hQ7OXPLOpG9vRLEogTSVjUGFu7W+SxfAoR+0 4bh52ZXH8s4kFI4v6YIOZEa1af41gj+3/UZatjj6ehRHsTwW6v65WnAn5ewjOS19mcjC YMfBC0vQgYc7oh3dqhY43C9k5AkIK89Omn0EtMSwZc9seRTNT4Ao2mkx5F+8PjhsCkgy qLMXHOddslAaidmnDkGE4EJnypiSIG2lczM/TBaG4Jz+ePOwWQ/lvSN3yKLG5FXuyX8q XrAiKkxWUe7B6K49E0Wm3UL/fZq1Eo7Epw5qF7uGrzASz2ax9T44jYuswZ/dm6Tlbu3Q vojg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=JGciRXfE; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d7-v6si12660368pgc.445.2018.08.06.01.05.24; Mon, 06 Aug 2018 01:05:40 -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=@googlemail.com header.s=20161025 header.b=JGciRXfE; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726840AbeHFKM0 (ORCPT + 99 others); Mon, 6 Aug 2018 06:12:26 -0400 Received: from mail-ua0-f172.google.com ([209.85.217.172]:41671 "EHLO mail-ua0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725985AbeHFKM0 (ORCPT ); Mon, 6 Aug 2018 06:12:26 -0400 Received: by mail-ua0-f172.google.com with SMTP id h1-v6so11127368uao.8 for ; Mon, 06 Aug 2018 01:04:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=qDiEAsd4sD7TfPwTQq1ZenGDEl1JnbBUz+7ehXskaI4=; b=JGciRXfE0hLp3JNumr6zehoaYKdQgpltCYrKA/lUoLOix0Qc39XGdi8fqNaH8BZg2l ZzSdI20Vww6wAG5Yh7vpXa0x4bku4BOQCLHhrOidFRF7MZsk4jwR/Tc7xcrWanMFrLYf 4Y9ZbMAw4P//yfADifsRpRAnOM66zN1g36jCTycKp7hA7X9yzEI2dSQKDaZDTvfbCj5G oozK1MW4KWWSSBbK3CtT27z2+eo1SeHxhpDxAugN1InJHlu4b3bG4UWAcx7noVE0F5M8 MNlXHHGuTReWAS3ArFww5Q3IRZOarlhPSws/CwEYCCn6ytc/bZthEVKr3oscvcevj2BT ECoA== 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; bh=qDiEAsd4sD7TfPwTQq1ZenGDEl1JnbBUz+7ehXskaI4=; b=TvKdz719e0Nj054zSerQP7iVKD16yNs8ZFBgGGe0J1o6S6VaNS7Q2pq9EViw7dqV7x FVM+hujVhgP36NbDdM8Tp5HEhpHieLeiVuyt/u4Io4bFbmGmZBiRmxL+NLX85gAOHEIK WedFGohijDXn5s5hzy7NH8zPkJfmCpo+TEgGldlA8OTEUJiUVBtaGA3Jyy5yXg6zfoEN mrHa95dxvshATLEhCSOjuvKe3ggwyKBTf2CyLWkqhXRmGxm6FSKIAX0sPAifu7KzybFa dX1IEekzdQmn8Cl46oUoc2cFHQH1LQrB9UQlXIfdnQKTxotXBiStrtjqkhu4EjiEu6Cq 1qFA== X-Gm-Message-State: AOUpUlFiNUqX158CYUP4RPyFED9UopyEMAuLFDkzYJRAQMDKYaWnWEQy pOGck6yp9Xs0NKoCeFN143Hx5mK2cSdNQI/VRvh2XrSU X-Received: by 2002:a1f:6307:: with SMTP id x7-v6mr8660864vkb.111.1533542674455; Mon, 06 Aug 2018 01:04:34 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ab0:6044:0:0:0:0:0 with HTTP; Mon, 6 Aug 2018 01:04:33 -0700 (PDT) In-Reply-To: <20180805213615.GA1862@amd> References: <20180805213615.GA1862@amd> From: Ramana Radhakrishnan Date: Mon, 6 Aug 2018 09:04:33 +0100 Message-ID: Subject: Re: framebuffer corruption due to overlapping stp instructions on arm64 To: Pavel Machek Cc: Andrew Pinski , Mikulas Patocka , Catalin Marinas , Will Deacon , Russell King , Thomas Petazzoni , linux-arm-kernel , 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 Sun, Aug 5, 2018 at 10:36 PM, Pavel Machek 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. > > No, I don't think so. Why do you think so? It is undefined behaviour in the architecture. Ramana