Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3951258ybi; Mon, 15 Jul 2019 01:25:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0Oqa6e/88Yhp7fYtv1uor7cc7UAmRYS3J0MW/3nb6aND4xvktJz2JIvlQSkj9weI8OxS0 X-Received: by 2002:a17:90a:cb8e:: with SMTP id a14mr27440186pju.124.1563179154464; Mon, 15 Jul 2019 01:25:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563179154; cv=none; d=google.com; s=arc-20160816; b=H2GSnZYcNATAn0mFVgG2B1ea7v/tdFgckdtwUK5OVvMCytYPx2ptZ7PG7Pb3B7/qw0 q24dzF9telHVGWgUg0PZwlbtzS7HxuryIFIo8zeEkWKen3r3IuBncWjxc/mn15SFWl+X STm5P2DaEwmMInFWpoBhpiWEn/1Ih3b6slvXriFdfBPrXApQRxQCuWy2VA4YL0peLW8E CIS3HTCpZQ717pWBoDM16o9GrN10TauI8/qjhMWRD638CYBkDL6BiE3w0kjjprBzrEzI /pwQNMCc/fgEHNrMZ5nAIZeplalEkensdiiBkZvBWnJ1u7Z0lZWh5P78JiIQSicI61PF yG4g== 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=OHcZoWITmURQNMqpXZskSsfBsDemIx+oSukxdrlbfHI=; b=gjB/sJO0Xtj4AInq2CIaDSEnZor6Os3w+rdWTJn+pheAUbd1qhXV4R60EG1xm5YBCx 5Ye+ixbmjMrbTLq6jNkLzimDuuoLoRgIqZQ+GYDQ3RE1lTEaDBR6EH9pUBO35samAIIf k/4nlOZzgpi1uxOM6K2yPeT17lcTFU4JMj8Xj6kIAy06CiemM0v3lc9zCIG4PkvBoX4B im9bEGFsfmjChOYutUHhK7sOQbFdREB6J32M2YmTgPQ/zS+r+yu2B+lPK+3uBCn/f6Sn 7sF96W0g+CvQ4kPykoVN3hShmvjMHQgUR2JboxICeccrQtLz3usZ7QKedwJmOz7hQxji FuqQ== 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 b3si14177559pls.52.2019.07.15.01.25.35; Mon, 15 Jul 2019 01:25:54 -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 S1729410AbfGOIYa (ORCPT + 99 others); Mon, 15 Jul 2019 04:24:30 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:46660 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726996AbfGOIY1 (ORCPT ); Mon, 15 Jul 2019 04:24:27 -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 1hmwHW-00059u-Qz; Mon, 15 Jul 2019 10:24:24 +0200 Date: Mon, 15 Jul 2019 10:24:21 +0200 (CEST) From: Thomas Gleixner To: Uros Bizjak cc: linux-kernel@vger.kernel.org, x86@kernel.org, Andrew Lutomirski Subject: Re: [RFC PATCH, x86]: Disable CPA cache flush for selfsnoop targets In-Reply-To: Message-ID: References: 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 Uros, On Thu, 11 Jul 2019, Uros Bizjak wrote: > 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. > > I would like to resurrect an old patch [2] that avoids calling clflush > and wbinvd > to invalidate caches when CPU supports selfsnoop. Please do not attach patches, send them inline and please add a proper changelog. Just saying 'Disable CPA cache flush for selfsnoop targets' in the subject line then nada gives absolutely zero information. > The patch was ported to latest Fedora kernel (5.1.16) and tested with > CONFIG_CPA_DEBUG on INTEL_FAM6_IVYBRIDGE_X. The relevant ports of > dmesg show: > > ... > < hundreds of CPA protect messages, resulting from set_memory_rw CPA > undo test in mm/init_64.c > > CPA protect Rodata RO: 0xffffffffbd1fe000 - 0xffffffffbd1fefff PFN > 1461fe req 8000000000000063 prevent 0000000000000002 > CPA protect Rodata RO: 0xffff889c461fe000 - 0xffff889c461fefff PFN > 1461fe req 8000000000000063 prevent 0000000000000002 > Testing CPA: again > Freeing unused kernel image memory: 2016K > Freeing unused kernel image memory: 4K > x86/mm: Checked W+X mappings: passed, no W+X pages found. > rodata_test: all tests were successful > x86/mm: Checking user space page tables > x86/mm: Checked W+X mappings: passed, no W+X pages found. > > and from CPA selftest: > > CPA self-test: > 4k 36352 large 4021 gb 0 x 81[ffff889b00098000-ffff889bdf7ff000] miss 133120 > 4k 180224 large 3740 gb 0 x 81[ffff889b00098000-ffff889bdf7ff000] miss 133120 > 4k 180224 large 3740 gb 0 x 81[ffff889b00098000-ffff889bdf7ff000] miss 133120 > ok. These outputs are pretty useless simply because the selftest only verifies the inner workings of CPA itself, but has nothing to do with the correctness vs. cache flushing. Thanks, tglx