Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4657487ybi; Mon, 15 Jul 2019 12:30:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/bbISJwW8PNLO+fZSlslFQPxg1gF99wcFxffhQU9budwsIgJg8wd03uxMChaVCReE7X3S X-Received: by 2002:a63:6686:: with SMTP id a128mr21518823pgc.361.1563219057524; Mon, 15 Jul 2019 12:30:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563219057; cv=none; d=google.com; s=arc-20160816; b=ojTR0ww7GSGEc0W785aLLTyX79B8eJi/GRQg0GU7y953pbbQ6Dz/wzoft98wyaaXa3 0aimHLODyjvabp1ZrL9+MRzwvqUSN1S0HL7Bvl7xDm66tTCBy5DtlbVGOC2nrtmX3aiF yz5jO6eQSMRXj5afNPTzp+3w6Mx+Q9viWxbYEbH79uq6FoKeAYVSs0htB7pb9VyiC2s4 E6n4MYqOXHx3NKVz1HHjMSWnYaKY0UJKai2YF5dS4H4zKWZ76EGe/YNCRVrSGRNbY8I7 gn7WJE1+W5m+MEskQbki/bWVDZdgelfqaXMwtQJYt4uFJvz4YtDs0Ou0wlf6/SRXrTdA HGQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=yP3PKBFqnVKA5cqb9I7LY2QwnEsywLkR7oBe+KhP8us=; b=aYfy/9F2xGFHPR0WCKlOY4M0LOCW/3hxT/Bz8z6SPONGq6Fo5ViwSfRXDt+2naGYb4 CtWt9CtGE14s3dAVzQOCa93E/jNDsV761SnOTnGRFPti6tehFrFCHEAMECO5Y4x/p2fA l8Bffbih/QnNsyX+J7AclEj9gzkQQum8zVUGgMS+Usxy7ksqcHbvgOkwEQcxWIeisDqw ySyKU3WmPJ6w9xC1Jh6i3AA22aQCHlI/ZmayoF4fxGz0IxWNlbKOzfPO527IUGUU1BMw HR6EPmsk63HUdik6obFN6GoZfRz1wspIWCYKN937nvAAVQulN+8C0+H9vBgKcT/1XAYL Z6tQ== 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 u123si13358233pgb.12.2019.07.15.12.30.40; Mon, 15 Jul 2019 12:30:57 -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; 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 S1730574AbfGOTaQ (ORCPT + 99 others); Mon, 15 Jul 2019 15:30:16 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:48670 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729948AbfGOTaP (ORCPT ); Mon, 15 Jul 2019 15:30:15 -0400 Received: from pd9ef1cb8.dip0.t-ipconnect.de ([217.239.28.184] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hn6fs-00057m-Q9; Mon, 15 Jul 2019 21:30:12 +0200 Date: Mon, 15 Jul 2019 21:30:12 +0200 (CEST) From: Thomas Gleixner To: Uros Bizjak cc: Andi Kleen , LKML , X86 ML , Andrew Lutomirski Subject: Re: [RFC PATCH, x86]: Disable CPA cache flush for selfsnoop targets In-Reply-To: Message-ID: References: <8736j7gsza.fsf@linux.intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 15 Jul 2019, Uros Bizjak wrote: > 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]. That does not answer the question whether it's worthwhile to do that. Thanks, tglx