Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1777287imu; Thu, 24 Jan 2019 01:33:11 -0800 (PST) X-Google-Smtp-Source: ALg8bN7RlHPgGMG4K3Sdzoaz2SWvVsccUJcLvoNMT2WjC4hnAOztUR6IltKejIhCVxEtuYyHKG2n X-Received: by 2002:a63:4d0e:: with SMTP id a14mr5316082pgb.408.1548322391176; Thu, 24 Jan 2019 01:33:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548322391; cv=none; d=google.com; s=arc-20160816; b=e9iyEuHNmddtj/0CfnDX/Fy7xrXxiJLXfZhc2O8Z6F5O6/M8lpxxT/vBHKsC9zQXls RWrM1fn4QB7X6aAXJt8Yw6UbygBgHn7AIbZh8c212A+zD5OkXZxHekdgxqPo4CuBpHB7 g/fNfReO9nIU/Px6IoT7bfF/TeXPvGWCaNRuCv5Se5/L6HexmbbO1lg5kjyTr6Xt1BZi ZGPfLnHrsgCIfpcgoDJuzkwqQG0N2aL+WaOwo6qVXjClovkTasQXWrxQIeg8VUSz90+r 7qqTkiwBiWKxDhsyFrxY8D5XZsMODICPKEEJhFjWyU5ujOpBiKT2PF/5gU5rdASq2MMn lscw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject; bh=w3vcDpYIS4fQPViyY5fYsOyygYWiS0h+zAB5v4QAX2M=; b=afTel6bhNxIhXS7hjcQiQbl3MkHOJFiq9urfwF2l5aF+iZTVWoJBtpaWLyB6ApM9Yd E2qhalmZjC0oz2hpUNImUrz1ncyPVKOF1csMpfrB2oVE84eTNjU+3Pnu0bfwblyX/rTn iFuG9vlRBrjKl4QgTRhamlag+9SMrjAq/i4B/zSAWwXBanb1HbjFok8mWGdg56xRRYHD xo37TB4Q7YoDgOXdJ+f6Vzfa/MamJj91aM/hrItfhJ0ZRpjOSJOyQmFZmEx/BCGdx1zI EyRkw3bkb2JBgeQDomM601QP78EHIeEghD2pO4TBj7iGlxl/Erf9jIVzVTyx3LwAQ+w5 yheQ== 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 u4si21208665pga.91.2019.01.24.01.32.55; Thu, 24 Jan 2019 01:33:11 -0800 (PST) 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 S1726347AbfAXJbN (ORCPT + 99 others); Thu, 24 Jan 2019 04:31:13 -0500 Received: from mail.netline.ch ([148.251.143.178]:38469 "EHLO netline-mail3.netline.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725931AbfAXJbM (ORCPT ); Thu, 24 Jan 2019 04:31:12 -0500 Received: from localhost (localhost [127.0.0.1]) by netline-mail3.netline.ch (Postfix) with ESMTP id 26AA72A6056; Thu, 24 Jan 2019 10:31:09 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at netline-mail3.netline.ch Received: from netline-mail3.netline.ch ([127.0.0.1]) by localhost (netline-mail3.netline.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 7iihVwdqjhc9; Thu, 24 Jan 2019 10:31:08 +0100 (CET) Received: from thor (39.1.199.178.dynamic.wline.res.cust.swisscom.ch [178.199.1.39]) by netline-mail3.netline.ch (Postfix) with ESMTPSA id 5D1C22A6054; Thu, 24 Jan 2019 10:31:07 +0100 (CET) Received: from [::1] by thor with esmtp (Exim 4.92-RC4) (envelope-from ) id 1gmbLm-0000IY-Sy; Thu, 24 Jan 2019 10:31:06 +0100 Subject: Re: [RFC PATCH] drm: disable WC optimization for cache coherent devices on non-x86 To: Ard Biesheuvel , Christoph Hellwig Cc: Maxime Ripard , Michael Ellerman , Will Deacon , Linux Kernel Mailing List , amd-gfx list , Junwei Zhang , David Airlie , Huang Rui , dri-devel , Alex Deucher , Sean Paul , Christian Koenig , linux-arm-kernel References: <850b6aee-0040-c333-b125-45211c18ada5@daenzer.net> <047667fd-17be-1c37-5d2a-26768cfd6ab8@daenzer.net> <20190123071521.GB20526@infradead.org> <20190123164428.GA9367@infradead.org> From: =?UTF-8?Q?Michel_D=c3=a4nzer?= Openpgp: preference=signencrypt Autocrypt: addr=michel@daenzer.net; prefer-encrypt=mutual; keydata= mQGiBDsehS8RBACbsIQEX31aYSIuEKxEnEX82ezMR8z3LG8ktv1KjyNErUX9Pt7AUC7W3W0b LUhu8Le8S2va6hi7GfSAifl0ih3k6Bv1Itzgnd+7ZmSrvCN8yGJaHNQfAevAuEboIb+MaVHo 9EMJj4ikOcRZCmQWw7evu/D9uQdtkCnRY9iJiAGxbwCguBHtpoGMxDOINCr5UU6qt+m4O+UD /355ohBBzzyh49lTj0kTFKr0Ozd20G2FbcqHgfFL1dc1MPyigej2gLga2osu2QY0ObvAGkOu WBi3LTY8Zs8uqFGDC4ZAwMPoFy3yzu3ne6T7d/68rJil0QcdQjzzHi6ekqHuhst4a+/+D23h Za8MJBEcdOhRhsaDVGAJSFEQB1qLBACOs0xN+XblejO35gsDSVVk8s+FUUw3TSWJBfZa3Imp V2U2tBO4qck+wqbHNfdnU/crrsHahjzBjvk8Up7VoY8oT+z03sal2vXEonS279xN2B92Tttr AgwosujguFO/7tvzymWC76rDEwue8TsADE11ErjwaBTs8ZXfnN/uAANgPLQjTWljaGVsIERh ZW56ZXIgPG1pY2hlbEBkYWVuemVyLm5ldD6IXgQTEQIAHgUCQFXxJgIbAwYLCQgHAwIDFQID AxYCAQIeAQIXgAAKCRBaga+OatuyAIrPAJ9ykonXI3oQcX83N2qzCEStLNW47gCeLWm/QiPY jqtGUnnSbyuTQfIySkK5AQ0EOx6FRRAEAJZkcvklPwJCgNiw37p0GShKmFGGqf/a3xZZEpjI qNxzshFRFneZze4f5LhzbX1/vIm5+ZXsEWympJfZzyCmYPw86QcFxyZflkAxHx9LeD+89Elx bw6wT0CcLvSv8ROfU1m8YhGbV6g2zWyLD0/naQGVb8e4FhVKGNY2EEbHgFBrAAMGA/0VktFO CxFBdzLQ17RCTwCJ3xpyP4qsLJH0yCoA26rH2zE2RzByhrTFTYZzbFEid3ddGiHOBEL+bO+2 GNtfiYKmbTkj1tMZJ8L6huKONaVrASFzLvZa2dlc2zja9ZSksKmge5BOTKWgbyepEc5qxSju YsYrX5xfLgTZC5abhhztpYhGBBgRAgAGBQI7HoVFAAoJEFqBr45q27IAlscAn2Ufk2d6/3p4 Cuyz/NX7KpL2dQ8WAJ9UD5JEakhfofed8PSqOM7jOO3LCA== Message-ID: Date: Thu, 24 Jan 2019 10:31:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-01-23 5:52 p.m., Ard Biesheuvel wrote: > On Wed, 23 Jan 2019 at 17:44, Christoph Hellwig wrote: >> >> I think we just want a driver-local check for those combinations >> where we know this hack actually works, which really just seems >> to be x86-64 with PAT. Something like the patch below, but maybe with >> even more strong warnings to not do something like this elsewhere: > > I agree that your patch seems like the right way to ensure that the WC > optimization hack is only used where we know it works. > > But my concern is that it seems likely that non-cache coherent > implementations are relying on this hack as well. I've been trying to tell you they can't rely on that, because the amdgpu driver doesn't use this functionality for fundamentals such as ring buffers used for feeding the hardware with commands. Instead, for those it relies on snooped PCIe transfers being coherent with the CPU caches. >> -#elif defined(CONFIG_X86) && !defined(CONFIG_X86_PAT) >> - /* Don't try to enable write-combining when it can't work, or things >> - * may be slow >> - * See https://bugs.freedesktop.org/show_bug.cgi?id=88758 >> - */ >> - >> -#ifndef CONFIG_COMPILE_TEST >> -#warning Please enable CONFIG_MTRR and CONFIG_X86_PAT for better performance \ >> - thanks to write-combining >> -#endif >> - >> - if (bo->flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC) >> - DRM_INFO_ONCE("Please enable CONFIG_MTRR and CONFIG_X86_PAT for " >> - "better performance thanks to write-combining\n"); FWIW, please don't drop these compile and build time warnings where we continue to take advantage of PAT. -- Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer