Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4649070ybi; Mon, 15 Jul 2019 12:21:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqywQLmvpipPMFlOViSgI40SsUN2Zbi2uXip/Zthu6+3a+g18D77NEed087c9TtdEDjPM68s X-Received: by 2002:a17:902:d70a:: with SMTP id w10mr28556496ply.251.1563218510898; Mon, 15 Jul 2019 12:21:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563218510; cv=none; d=google.com; s=arc-20160816; b=Kj8rtPfwueJNiTW+nDvb3Jm1mJSLM8kkwpRdfvPDMfV31kYm6VgheS2BO7W0YisI/V lRq9IfA6xDUxve47ra1YFfl0MYumahxktnkHcwzHXYYyVypE6ODQvwoVAmd1rZBN/Rp6 TGPt83Cd9WI6fg8AxgSOI9Mb7RXfsywLE8raAreToppmC8LjSW9V6MdJcWVOMIsg1CAT fzqN/b317NE/FcbLaWP5U6GXx/Sg5awooiSw4WR9mAQxZpPtoAznjV2SNGC3lgdjtEGv YbA6MyAlZMv+TOISRR7kNUa3kWytcGl5u0G8A7zj9c02G9no7860+49rXJ+CUbZjEIT9 yXow== 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=OMx9vapOigGOTwjLxXUo2InQBXCmRL05UybT81nmsi4=; b=h+bVboYWbSXA3Qt/v+SWNXFeGO/vcDO3g1dXPRljCGB/REpwEaUtlrbNFfJO10C0zp oWoABlZ6JW78zYoOSh8x0WhwexA1YYU7M0AMAdbSiFekVJa33+rnufjO2N7pqNpNygy1 WVB9Y/DS4VJ+UUCRb2YQEkUQKuylVjWnh2p8Eermz27AjUzOSztiT+Bnmurg0YMVPCHA NoAfOUs97dbZpy10rnbr9TyfdueCSqiW6/DRaJDEpjNPtRCXsqkrD4vj0UwzVQc7fZd4 M4M3EZopWrmNlZg+0vAej5C+Iih7wsti3h2fpGUX+S9gUsdmWCAY5lsmrs68Km5sGiMB zxxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ngOih2XW; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bx21si16149367pjb.21.2019.07.15.12.21.34; Mon, 15 Jul 2019 12:21:50 -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=@gmail.com header.s=20161025 header.b=ngOih2XW; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730361AbfGOTT3 (ORCPT + 99 others); Mon, 15 Jul 2019 15:19:29 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:37526 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729432AbfGOTT2 (ORCPT ); Mon, 15 Jul 2019 15:19:28 -0400 Received: by mail-ed1-f66.google.com with SMTP id w13so16575736eds.4 for ; Mon, 15 Jul 2019 12:19:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OMx9vapOigGOTwjLxXUo2InQBXCmRL05UybT81nmsi4=; b=ngOih2XWy2FuUfJWjAXcpaZ4cXN60SVhp2G5wzxPZlSoEU7s0eZqv6t8qm+m+URSZw IQtHFls/1t42QKkUE+WEmhGM5/Ue6OtlJMEqpXyGG0Mo6biPdMh80CJ4i8/KgcxDfbAi nqAERIXpDEasSL4HaVInfBKaK6e5gOE87ABiEw+Cd3LYeDHTrZOUy/ZE3eVbr5H+HPLQ nTdXkawXqE0yL5M7OwctT1aUW38jLsdEkwOY0K8DHrBCUYw+R+rmX3Ri/fGmcX+NLOyq dl9sJvy4lu3BKm2VxDI4JTWXV+kFm9HJYvi9Dl6zGAc02O/tjw2EIBY6PsTgIC5gyzop MRBQ== 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=OMx9vapOigGOTwjLxXUo2InQBXCmRL05UybT81nmsi4=; b=YiTlHID9s5c9Ud2b6vBRbhbr1/FtsJgdLf3eXKjwWPl3vf7kbOrRAAwKcR6Y2fM7sE bWV8nsscl6EKouapJLka3z/dubpG1+HhA5Z296MTk7WOH+BWTuCPyJuQk6tcZkefPiYE uIoz4wCw/0aPORl7EdboFMoXiqZO/YAgkNp/f63GAGrg9o2/teFZrtRXUgccudRPvA1C f02YsZiIOi6jl+ch++2uaTN6GQZYI0iVWLoKhzeWs/WASEvLhQpd1JNOioff8fBeE3/2 Nqj0kcQIV/z6babdP0qEhNkscD+agejsqJuQgoRZnL1njnq4w/cnaU95oJnyrY+5ExgG pUQw== X-Gm-Message-State: APjAAAV7RHZ6R/8Jh/ZbA3ydKsWClM5S9cOYCZdOrdU240oUZ2vv8IOw lpqxeum/q2+82ShDYRk4Vp0vaC4DzSH5b0mhWJc= X-Received: by 2002:a05:6402:129a:: with SMTP id w26mr24907280edv.167.1563218367166; Mon, 15 Jul 2019 12:19:27 -0700 (PDT) MIME-Version: 1.0 References: <8736j7gsza.fsf@linux.intel.com> In-Reply-To: From: Uros Bizjak Date: Mon, 15 Jul 2019 21:19:16 +0200 Message-ID: Subject: Re: [RFC PATCH, x86]: Disable CPA cache flush for selfsnoop targets To: Thomas Gleixner Cc: Andi Kleen , LKML , X86 ML , Andrew Lutomirski 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 Mon, Jul 15, 2019 at 8:41 PM Thomas Gleixner wrote: > > On Mon, 15 Jul 2019, Andi Kleen wrote: > > Uros Bizjak writes: > > > > > Recent patch [1] disabled a self-snoop feature on a list of processor > > > models with a known errata, so we are confident that the feature > > > should work on remaining models also for other purposes than to speed > > > up MTRR programming. > > > > MTRR is very different than TLBs. > > > > >From my understanding not flushing with PAT is only safe everywhere when > > the memory is only used for coherent devices (like the Internal GPU on > > Intel CPUs). We don't have any infrastructure to track or enforce > > this unfortunately. > > Right, we don't know where the PAT invocation comes from and whether they > are safe to omit flushing the cache. The module load code would be one > obvious candidate. > > But unless there is some really worthwhile speedup, e.g. for boot, then > adding some flag to let CPA know about the safe 'no flush' operation might > be not worth it. For the reference, FreeBSD implements this approach, later changed to use pmap_invalidate_cache_range ifunc (that calls pmap_invalidate_cache_range_selfsnoop for targets with self-snoop capability) and pmap_force_invalidate_cache_range [1]. The full cross-referenced source is at [2]. [1] https://reviews.freebsd.org/D16736 [2] http://fxr.watson.org/fxr/source/amd64/amd64/pmap.c Uros.