Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2478220ybi; Thu, 20 Jun 2019 16:13:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9EKfJx5jlWyo35nh4kIOnMuOa5pVVffXr8xK3eYxgq7RzkBvsSqKG+2TR2nS3Jai7rVSh X-Received: by 2002:a65:514a:: with SMTP id g10mr14904320pgq.328.1561072417617; Thu, 20 Jun 2019 16:13:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561072417; cv=none; d=google.com; s=arc-20160816; b=UQGH8fR+aJLyoBW8GjTENrhIYsc1jR2GPNd37aFkXOVeVFfUoX0q1OumgAdyc0cysX 7HkhE4KST1NAKCu4WmECnh6hei34YF+RVMUthVG5srVqOtl78vyrYI9IjUiaHxg4Z8v8 tb+4PXlutInj3YOM7TiAxV1tCQWfTQc4I9iuxsXMW2MhP8hAn+3cyDERtcVCnBGswg9U SCTCgqigpKoBqvVP0jGb+wpRQ5fYf/3FsRJ3FU7xm9rMvHMnRZGf7mat5PxxP6vVNnr9 24QqTjDizF5Bo6zbIc0lMPQc7w4nhormiPS3p0lSWo6/Iei17BPR+s1EFK87legEgB1Y 7CFA== 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; bh=s1U8b9i28hLJayWU6+c6YVAvl2Rop3SMymokvtyzh0o=; b=tet8QnmzsOqc1NLe9purLhM6vTG3jjHHhSVGTWV/MyIocfI+Df5eiya04Ao5+4ItJI jiL7htsgRN8y7IHq+ByK/B+RDZZJ5eJjTmPjYn1Bi/5iEJMaUL6LBAr0rNAsWxt1afJE AcBx1Zm2ucO3HhEC784HseVAj+gkImz58xdb/7cWmoLTIppCJbyOBvXvxVGncKsJeYry HMndj8htkJReghm4FEq9HbXDmow00bmWpLcrcBnwxbQrES+s1C6ak5+V0QfOF5B6VnHB M59IkDhMRmal1rrmt9GWpn2bcLzmf3SBaOeLt5ocDBUSP5MK9uGg8DRFv30XPbD0dGov 6x1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b="wZXK/rGx"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l7si737373pgl.562.2019.06.20.16.13.20; Thu, 20 Jun 2019 16:13:37 -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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b="wZXK/rGx"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725864AbfFTXNR (ORCPT + 99 others); Thu, 20 Jun 2019 19:13:17 -0400 Received: from mail-oi1-f193.google.com ([209.85.167.193]:42140 "EHLO mail-oi1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725906AbfFTXNQ (ORCPT ); Thu, 20 Jun 2019 19:13:16 -0400 Received: by mail-oi1-f193.google.com with SMTP id s184so3371606oie.9 for ; Thu, 20 Jun 2019 16:13:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=s1U8b9i28hLJayWU6+c6YVAvl2Rop3SMymokvtyzh0o=; b=wZXK/rGx3xr+u7oi//RllS+oGNo9Tzry/ML+vUVpgS/Zv+UVNj64dDUV96UYUd1Jn3 HTEz2HrWATyMseQ9ESDNMngt9dsb1UfHOlUe8zE/5wDSyS1AVE4ZRpittyrzTTchLos5 4eYsM6eY6GbydQyeJ5021LQYq2W4FXOMsUpMRrhldyeNx0gkDVyn8cVP0JPDGRXYNHA0 Khcxwe9CepLmmm4wC6aJwDUSLxUAkLS7QB/OjbTbUQGW9ZgOSJMHsxAIyonm6fZ1Gisx DP1+rtOY4WuxwcsaUVn8PkaGb7RTOOyiGjDW9YizTilPtgcvoQvLQUcgY/Zjj7YawYJt OuAg== 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=s1U8b9i28hLJayWU6+c6YVAvl2Rop3SMymokvtyzh0o=; b=nDj7k6/cnpEkd/nZaFbtDqY1sK80zwlPKKj6fLFrSROLWLR0z6u8v9iVUWfzDPOyJx i+vA66pH7zn3wMkZfC8zkA1dCBZsjjOXE79YaX3pVZyWSUQ731blYGkCnoM1YA566MLE MF6p2jIgYCUea+aBsrVWp9sDPbcAoD3KkEPVbE6PUz6V4ilo0kL9M5b+kfAV2Kq/KTrO xtoGKWS00p7oEBSrl7cd0qENWOsQXm047NXVCFWyCDbTVcrYnjM7NqnUuWCr7LLj8pw4 /MgWsT6kMiVlZlI32MubEyW/y1e1UpPEW3/wclAfESvy4oHdat8M4veiSfCdl60ctSx0 zAGQ== X-Gm-Message-State: APjAAAW7d3+Q2/JIzI690YFQcpU/3S5Ahu+i/R4XLDjhSNggIZ1GEpJx IhMdIS6wyjUr6Iof7WiaVHtbHSujTfNasARcUMwQ4Q== X-Received: by 2002:aca:fc50:: with SMTP id a77mr917887oii.0.1561072395816; Thu, 20 Jun 2019 16:13:15 -0700 (PDT) MIME-Version: 1.0 References: <20190613045903.4922-1-namit@vmware.com> <20190613045903.4922-4-namit@vmware.com> <20190617215750.8e46ae846c09cd5c1f22fdf9@linux-foundation.org> <98464609-8F5A-47B9-A64E-2F67809737AD@vmware.com> <8072D878-BBF2-47E4-B4C9-190F379F6221@vmware.com> <8736k49c57.fsf@firstfloor.org> In-Reply-To: <8736k49c57.fsf@firstfloor.org> From: Dan Williams Date: Thu, 20 Jun 2019 16:13:04 -0700 Message-ID: Subject: Re: [PATCH 3/3] resource: Introduce resource cache To: Andi Kleen Cc: Bjorn Helgaas , Nadav Amit , Andrew Morton , LKML , Linux-MM , Borislav Petkov , Toshi Kani , Peter Zijlstra , Dave Hansen , Ingo Molnar , "Kleen, Andi" 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, Jun 20, 2019 at 2:31 PM Andi Kleen wrote: > > Dan Williams writes: > > > > The underlying issue is that the x86-PAT implementation wants to > > ensure that conflicting mappings are not set up for the same physical > > address. This is mentioned in the developer manuals as problematic on > > some cpus. Andi, is lookup_memtype() and track_pfn_insert() still > > relevant? > > There have been discussions about it in the past, and the right answer > will likely differ for different CPUs: But so far the official answer > for Intel CPUs is that these caching conflicts should be avoided. > Ok. > So I guess the cache in the original email makes sense for now. I wouldn't go that far, but it does mean that if we go ahead with caching the value as a dax_device property there should at least be a debug option to assert that the device value conforms to all the other mappings. Another failing of the track_pfn_insert() and lookup_memtype() implementation is that it makes it awkward to handle marking mappings UC to prevent speculative consumption of poison. That is something that is better handled, in my opinion, by asking the device for the pgprot and coordinating shooting down any WB mappings of the same physical page.