Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2359897imm; Mon, 28 May 2018 06:42:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLz6sfPSXt0G2ljlui/6EkimuP1l6mG1MK+O6Pk0Zcu3R95ObmVMkM8dLiDCsjCdd5v0Xg0 X-Received: by 2002:a62:9e0b:: with SMTP id s11-v6mr4790541pfd.198.1527514945749; Mon, 28 May 2018 06:42:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527514945; cv=none; d=google.com; s=arc-20160816; b=O4++Po86LtcM8opibbpC5tghDz1U9Vq7Hca/31poSmd/ezpZJsj0Kzp0RHa5etREc8 Z5KKldj1YJ3TjaWNI6803eESiYxtq7OdPDLCXd1gi4wXgyLsmTlxxom+/TWwynn7JZdm qCM8P9BYz2jbt0Cqm+Bvt6UVngS0Lv24EC8MWhEGok4g6iIbFMg6B5lvRrqaMDvvDp0g x3OYfO6Xzhbtec431gTOSNRyC02gkIxZXT+rjov5Kyuh+82cM1nQcxxMj5EnnfvvHPLB be7yOrq7BzA8+ukZluAUITVqvlAXpmW+VjWgvozjMhs5GTHbXTjUKnOsMmEqg1aUFd6N kXmA== 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 :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=jKu783h4rtHDrjLO0zL+gT+hIhIi7IV6bvAh30dHc+8=; b=pOiKl6nBaITYiJMZ1dj2tAmSS2hfwjpDPdZC4hAzNEfi1wsLu2ouogk7petBr+9voY Mn2ZMItn1vWkcBDavy7la4AAkjAagPBGz6BBErEn5SzLiA7J5duuuYXnLam9O/eYqvlG BSsPFFcJawzdZONIqmw+v7IziQQbgGe4w25OKfBezkWtA3Jtol8OhXtXDRP4ZB3l9v8O 4y9ddgZwOAARgmGoKPGEpi+sDQuGSnL1zx/v/VhX/ZS25odJlKLWESvRBK6epGESHgG1 monnjI842Zu6dbRzK566rbyRyHcfacnAH0ya271ZHcBYlsNJoz55EY/cw3gLqgH653bE JqqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zmKfnq0j; 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 i61-v6si19992640plb.138.2018.05.28.06.42.11; Mon, 28 May 2018 06:42:25 -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=@kernel.org header.s=default header.b=zmKfnq0j; 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 S939237AbeE1Nld (ORCPT + 99 others); Mon, 28 May 2018 09:41:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:35128 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968913AbeE1KoV (ORCPT ); Mon, 28 May 2018 06:44:21 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 96E21204EE; Mon, 28 May 2018 10:44:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504261; bh=jXnYp0OW6Yf0Q7p8ldOTHDNNw2nP4IDEqJc+e+4qV5Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zmKfnq0jMGM/P+AvTaKgb+F+zv08iLqw3m2QaT3h9V/u7spx/PHvtlFZCgfcynbeW GaiPGnjCfMF2G8ucXbO7QJGDkIIZib9uc3dkpbl3Ifo2rk70NqCWnrkatj7ZqipCO9 ZnRG6STYSCDDllpthSGgej/IkrHyI7YXiC9Wzl60= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, greg@kroah.com Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Ellerman , Mauricio Faria de Oliveira Subject: [PATCH 4.14 040/496] powerpc/rfi-flush: Differentiate enabled and patched flush types Date: Mon, 28 May 2018 11:57:05 +0200 Message-Id: <20180528100321.364198845@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mauricio Faria de Oliveira commit 0063d61ccfc011f379a31acaeba6de7c926fed2c upstream. Currently the rfi-flush messages print 'Using flush' for all enabled_flush_types, but that is not necessarily true -- as now the fallback flush is always enabled on pseries, but the fixup function overwrites its nop/branch slot with other flush types, if available. So, replace the 'Using flush' messages with ' flush is available'. Also, print the patched flush types in the fixup function, so users can know what is (not) being used (e.g., the slower, fallback flush, or no flush type at all if flush is disabled via the debugfs switch). Suggested-by: Michael Ellerman Signed-off-by: Mauricio Faria de Oliveira Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/kernel/setup_64.c | 6 +++--- arch/powerpc/lib/feature-fixups.c | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -860,15 +860,15 @@ static void init_fallback_flush(void) void setup_rfi_flush(enum l1d_flush_type types, bool enable) { if (types & L1D_FLUSH_FALLBACK) { - pr_info("rfi-flush: Using fallback displacement flush\n"); + pr_info("rfi-flush: fallback displacement flush available\n"); init_fallback_flush(); } if (types & L1D_FLUSH_ORI) - pr_info("rfi-flush: Using ori type flush\n"); + pr_info("rfi-flush: ori type flush available\n"); if (types & L1D_FLUSH_MTTRIG) - pr_info("rfi-flush: Using mttrig type flush\n"); + pr_info("rfi-flush: mttrig type flush available\n"); enabled_flush_types = types; --- a/arch/powerpc/lib/feature-fixups.c +++ b/arch/powerpc/lib/feature-fixups.c @@ -153,7 +153,14 @@ void do_rfi_flush_fixups(enum l1d_flush_ patch_instruction(dest + 2, instrs[2]); } - printk(KERN_DEBUG "rfi-flush: patched %d locations\n", i); + printk(KERN_DEBUG "rfi-flush: patched %d locations (%s flush)\n", i, + (types == L1D_FLUSH_NONE) ? "no" : + (types == L1D_FLUSH_FALLBACK) ? "fallback displacement" : + (types & L1D_FLUSH_ORI) ? (types & L1D_FLUSH_MTTRIG) + ? "ori+mttrig type" + : "ori type" : + (types & L1D_FLUSH_MTTRIG) ? "mttrig type" + : "unknown"); } #endif /* CONFIG_PPC_BOOK3S_64 */