Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3504680imm; Mon, 6 Aug 2018 06:04:32 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcc84GHwu07hTC+HjD4YvgaOByf81zQ8VsizqmNTHrPhBfG+mO4OM1GduChpVGxqIrSmzLH X-Received: by 2002:a17:902:24a5:: with SMTP id w34-v6mr13442624pla.285.1533560672593; Mon, 06 Aug 2018 06:04:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533560672; cv=none; d=google.com; s=arc-20160816; b=WFmdHkpOvh+J4+ldjh5YDKbgBD9auncVJl+6rnUwAzTwmUgy1KMyxloPd02MmknErH VhWEbFVeCNs8OYJSL1jwHvl8MBud3dXQJurlzCS7vnG8iT4jP7k0lzvqo3+GwD0VhnC/ BQxJy052pE0csclophZzTEhTieBkoVwMaxFZIdPZ0OqYek9y0p5ipSpl5qyFatrcJ236 zbKI9qZr8Qsa1XjF9/cVSZtTzmiqu/usMpSO9OhIwQUEYB9diblLt6prr3jKnSQIC95H hPmzS+VjVyXKfQ92LpF8qZvjkkxnPEmD96s6sQnEHvA2XZ+MKfIEhsiBP2+5fiValqSq 1OsQ== 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=m1KMX+JoFcnHvYpU+Aijx6fvUy7LX2CAFu0WyQMBZYo=; b=nMCA2NRVmIwgDzGS5cgpoaeB92rd40chxg8o50bIaL3Q/wanIfUjgtsTUpXnnosPUO mZhdBeaGTaPc5zrlmPdHLqMVHacswoRVkdHX5ryHlK7GzW5XyFHfFBasRNTWmmvlvvo6 jJXbYUB1SXiGgTnRxqtq2InGMdkO0Dor9wt6rZnkCbbSvFMTCJdNQckOEuNgB5MRHfQS Oc0hwJn5rFrm9oB3q0XztPwhKSdpa5/gtMaZvV6j5ad+kNbord+VXenON+OVtZ9C5zWa P7GQLCQe4DDL8sHZYn/A6WmdulNdHESSzpFGAGKtMMwp1d7JnfUrFGlpdz2XvuKzynUw iOIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="RwCd3xD/"; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j21-v6si12367698pgg.303.2018.08.06.06.04.17; Mon, 06 Aug 2018 06:04: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=@linaro.org header.s=google header.b="RwCd3xD/"; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729604AbeHFNhk (ORCPT + 99 others); Mon, 6 Aug 2018 09:37:40 -0400 Received: from mail-io0-f175.google.com ([209.85.223.175]:39877 "EHLO mail-io0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727109AbeHFNhk (ORCPT ); Mon, 6 Aug 2018 09:37:40 -0400 Received: by mail-io0-f175.google.com with SMTP id o22-v6so10703441ioh.6 for ; Mon, 06 Aug 2018 04:29:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=m1KMX+JoFcnHvYpU+Aijx6fvUy7LX2CAFu0WyQMBZYo=; b=RwCd3xD/jK7XmGY1L5XvvgdjxMzGzvnviE6enN85wHopYVzGgEVZ6be7Yr0Pi7Tpti VH25aR7L9VIlFeQ+K+OoIi3lR8J4zBDzBeQ+iFXNaT/2pHVwnGhNiUiZV9mUfEKQLJA3 LZUcdBJVrth2QDlMlh8mkaOOG7Dw2A6UPZZik= 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=m1KMX+JoFcnHvYpU+Aijx6fvUy7LX2CAFu0WyQMBZYo=; b=WM9VsKMMelG/ut79NQ7f+nwwKfEhkAHcwKqgpeJSgR1WapidjUml6+VAFVbfHwNArV 9UGEosps4vpL2qC6xsOPi7kRXVrtMr+b1N/xvIO/ne5QTu8GsVWoU0PU61OjP++RON3e 23Nad/qRYc/sZYg/5pTU479pagvsT1xLgziPpkICGdBbqWYh81/ugaQft7Kr0KXjA6IL 7J6RmUDvl8/xOXmAMQfJi78rdfpXX3MkjKvcpwIjLuL3Wu3dsCcf9zVavbNgIglLlga2 z8ghrXv9YtNbR5iBbW79nKvT2mmNKb+vGsuRPYB/Nnyp9puVOTH0MFzY2Hu6Xj2cqg18 KbOQ== X-Gm-Message-State: AOUpUlE8gscID3EemTb8UDhWiFox+ow13ltTlkcmffl0xG/oDgLQUFGi uS4/q7QeLHW7zqyUHi6Mpos9m3jSPRV6pjWXBVhC9w== X-Received: by 2002:a6b:5208:: with SMTP id g8-v6mr15365004iob.60.1533554941432; Mon, 06 Aug 2018 04:29:01 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:ac05:0:0:0:0:0 with HTTP; Mon, 6 Aug 2018 04:29:00 -0700 (PDT) In-Reply-To: References: <9acdacdb-3bd5-b71a-3003-e48132ee1371@redhat.com> <11f9185a-7f71-83df-3a57-0a0ae9c1f934@arm.com> From: Ard Biesheuvel Date: Mon, 6 Aug 2018 13:29:00 +0200 Message-ID: Subject: Re: framebuffer corruption due to overlapping stp instructions on arm64 To: Siddhesh Poyarekar Cc: Mikulas Patocka , Florian Weimer , Andrew Pinski , Richard Earnshaw , Ramana Radhakrishnan , Thomas Petazzoni , GNU C Library , Catalin Marinas , Will Deacon , Russell King , LKML , linux-arm-kernel , Tulio Magno Quites Machado Filho 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 6 August 2018 at 13:19, Siddhesh Poyarekar wrote: > On 08/06/2018 04:01 PM, Mikulas Patocka wrote: >> >> I think there are three possible solutions: >> >> 1. provide an alternative memcpy implementation that doesn't do unaligned >> accesses and recompile the graphics software with -mstrict-align > > > Given that there's already a tunable glibc.cpu.cached_memopt for powerpc > that (as Tulio clarified elsewhere) essentially does the same thing for > cache-inhibited memory, it wouldn't be too much of an overhead to put in > another ifunc implementation that gets chosen only when one sets this > tunable. In fact, we could reuse the C string routines for this to avoid > adding yet another assembly implementation to have to support. That way we > can minimally fix the issue at hand without regressing existing uses. > > You can then set the glibc.cpu.cached_memopt tunable in the default > environment for your board[1] or for applications that need it (e.g. > whenever DISPLAY is exported or something like that). > > The only difference from Power would be that cpu.noncached==0 for Power by > default whereas for aarch64 it will be the other way around. It shouldn't > be too hard to enhance the framework to set platform-specific defaults. > Thanks Siddhesh, But we don't need another memcpy(). We need outbound PCIe windows that tolerate being mapped as normal non-cacheable memory. And if this is fundamentally impossible, can someone please try explaining it again? (apologies for being thick)