Received: by 10.223.185.116 with SMTP id b49csp7969386wrg; Thu, 1 Mar 2018 14:32:44 -0800 (PST) X-Google-Smtp-Source: AG47ELszlcpXxIDB7lK7zx1uZ9Petvw35FyXxbXBm8mM18qrUs06seE8doBosPPjS2mLRoINl3+U X-Received: by 2002:a17:902:b109:: with SMTP id q9-v6mr3353248plr.340.1519943564196; Thu, 01 Mar 2018 14:32:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519943564; cv=none; d=google.com; s=arc-20160816; b=TZqAT23mx5AfQQFU+dwJHRCsk/DXxY/qu6E72fT8sAATKP5SxWyZAI3Q6co3DfmKpj pQ2NkSEhfNJwlTuxvFLjzcZwS4ASTr8vyU18BKCnfX4VPCZKQxMDogGsBNNM2E1vgnov +iGV/ulXgLcn35JJTtZDMIcU8IBUFJN+FowTQDlbbjm8IzSC7ZLOxom8f6jeo/Ms0ys3 8inVndMWzMt9wKlDmEqugw23+ZrA+EAOC8hNUC6NwgmZadMn2rlnTehrIYWQYI3C9QxA 74udYfvcLmwDbvR9mvY51oHCqjaRUoV+6OCTcyVk7dmjMMwiSfmvZb+OAp54L0nxWTBr rPfQ== 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:dkim-signature :arc-authentication-results; bh=x23FY9X8un2+rXD1fR8ctSU1wlQoxPRXdYTF9uFTa3M=; b=tKFcqXU0O7Ofgy6YxKFM7Qi9xDYcG2R93CY0nu7l0fZHbDESzm16tX0GqsOSG3Bx68 S0gwRKyNo5f5ePhCqs2p7TnW8pZqtoZK5U2vRttdP8MLF3ubqU19nBjik1IvIIT6mEvb drR3yOy1AGQrPMFu7Sf1LkFWNnXL++v1HtVS7dMkK0kPUnBovGROxlInjN3OU9LipyFz mTHVXnO/KhSN2zv/4WtgZYikJUAYWLYMCYBIoU+j68ocRu6ZY7RXNErHi/6CNh87jPf2 5kDIl0LcdqVOUTAQn0Bblwt/3wZi4hcrV0vKtpHttOCAIXUxBPzAf29tBtiybiZHHxKh RpKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=j3Zq3gyC; dkim=fail header.i=@linux-foundation.org header.s=google header.b=EVdqswV2; 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 o4-v6si3635483plk.582.2018.03.01.14.32.29; Thu, 01 Mar 2018 14:32:44 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=j3Zq3gyC; dkim=fail header.i=@linux-foundation.org header.s=google header.b=EVdqswV2; 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 S1162625AbeCAWb2 (ORCPT + 99 others); Thu, 1 Mar 2018 17:31:28 -0500 Received: from mail-it0-f68.google.com ([209.85.214.68]:33837 "EHLO mail-it0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161204AbeCAWbZ (ORCPT ); Thu, 1 Mar 2018 17:31:25 -0500 Received: by mail-it0-f68.google.com with SMTP id n128so376026ith.1; Thu, 01 Mar 2018 14:31:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=x23FY9X8un2+rXD1fR8ctSU1wlQoxPRXdYTF9uFTa3M=; b=j3Zq3gyCqAB841Nj6CSI8R8CtFrIZJIzFgNhngcR2rK38W25BJzE/gBVwZ8ZqyHEjA DXhs24MWVDtd45oOXEys0kN1N/7tcKqQMvjoIgL/7nuklV67+2bRetK3PNGqZu6DuPU/ yEAvJMppvmbB2cMHJqvQJxIfmWmv2G+p/sjV0Qky9RNIUGv3TdRQa4oCBSNVkHQWqowt fYuKDFKyePUwVVBE2LZHQofIrTDLVhgkmIhzR2L1yteeZZkmig7z5yWDTOJMM9fzvNM7 X6z7HcWOSwA4VpneA9fWs+vqR2AaicpjhrsSBIhnF58Yjx7Y1lIhgjEsd2Yi/4Z0YCIX Q/WA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=x23FY9X8un2+rXD1fR8ctSU1wlQoxPRXdYTF9uFTa3M=; b=EVdqswV2pxFdRXh/vNzdAf6T6qVx1Kh8lhEcjy5IBWgae1nD1ee2LFYkYHcR9nJbDE nX9l7S1FswVjQH38uojrbu1SyzOfdIs7qRWmUbq5aV5dslxRqOPfUiFlT6DeP6yOes9E EQC5cwPMc8+fzb8Qo9FuUl88V1Ggx86qbxfCU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=x23FY9X8un2+rXD1fR8ctSU1wlQoxPRXdYTF9uFTa3M=; b=oF3IMdYDktAhY3jQECYLwE5YyuBC04vbBqzchdjouJ64EwDMVpy6LUjSjYk4cwiyYR EJ9auP0cKGVazmTVA8dvFo5QSHCwxKrLZi65njDhByv1oh7B3ODg9rNPTRTLCd57MaWG 24QdjM4EheM2UInVEZMTeGkNcCkRIBYVe3pOUQqo6a0r9gwtene5On9NihANRNzY/R5x e6clfGBj65vcdxvkt2FqEc1cKNKZqJSOf4T/56aGC2rAh8TDBVLzeis5edNDoa6VqmXS O+WEXxHc6LV/r4rXNjrkFC34RUSodqpI4HaiK20LIUG5S6KsGk0tgZnSJ7MzlliGptJI ELlw== X-Gm-Message-State: APf1xPCHXlGpsHhRB14qAWof5ymIdhAdns27FOkOKnpojwG/fl/NWzKX afG9t7FtW/du06Sd1czV7+lzrne1g7LMV53jeBA= X-Received: by 10.36.254.199 with SMTP id w190mr4781849ith.108.1519943484276; Thu, 01 Mar 2018 14:31:24 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.135.221 with HTTP; Thu, 1 Mar 2018 14:31:23 -0800 (PST) In-Reply-To: <1519942012.4592.31.camel@au1.ibm.com> References: <20180228234006.21093-1-logang@deltatee.com> <1519876489.4592.3.camel@kernel.crashing.org> <1519876569.4592.4.camel@au1.ibm.com> <1519936477.4592.23.camel@au1.ibm.com> <1519936815.4592.25.camel@au1.ibm.com> <20180301205315.GJ19007@ziepe.ca> <1519942012.4592.31.camel@au1.ibm.com> From: Linus Torvalds Date: Thu, 1 Mar 2018 14:31:23 -0800 X-Google-Sender-Auth: MxlSlVin8F1pB7dkwfxOTY6hfgg Message-ID: Subject: Re: [PATCH v2 00/10] Copy Offload in NVMe Fabrics with P2P PCI Memory To: Benjamin Herrenschmidt Cc: Jason Gunthorpe , Dan Williams , Logan Gunthorpe , Linux Kernel Mailing List , linux-pci@vger.kernel.org, linux-nvme , linux-rdma , linux-nvdimm , linux-block , Stephen Bates , Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Max Gurtovoy , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Alex Williamson , Oliver OHalloran 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, Mar 1, 2018 at 2:06 PM, Benjamin Herrenschmidt wrote: > > Could be that x86 has the smarts to do the right thing, still trying to > untangle the code :-) Afaik, x86 will not cache PCI unless the system is misconfigured, and even then it's more likely to just raise a machine check exception than cache things. The last-level cache is going to do fills and spills directly to the memory controller, not to the PCIe side of things. (I guess you *can* do things differently, and I wouldn't be surprised if some people inside Intel did try to do things differently with trying nvram over PCIe, but in general I think the above is true) You won't find it in the kernel code either. It's in hardware with firmware configuration of what addresses are mapped to the memory controllers (and _how_ they are mapped) and which are not. You _might_ find it in the BIOS, assuming you understood the tables and had the BIOS writer's guide to unravel the magic registers. But you might not even find it there. Some of the memory unit timing programming is done very early, and by code that Intel doesn't even release to the BIOS writers except as a magic encrypted blob, afaik. Some of the magic might even be in microcode. The page table settings for cacheability are more like a hint, and only _part_ of the whole picture. The memory type range registers are another part. And magic low-level uarch, northbridge and memory unit specific magic is yet another part. So you can disable caching for memory, but I'm pretty sure you can't enable caching for PCIe at least in the common case. At best you can affect how the store buffer works for PCIe. Linus