Received: by 10.223.176.5 with SMTP id f5csp715976wra; Fri, 9 Feb 2018 06:08:29 -0800 (PST) X-Google-Smtp-Source: AH8x226APUVUNotOjplh7NfayrZHdb9QaBQlnKRVo0K9xauGJCLitlxv3C0sme3d5MWx3yZZdiEg X-Received: by 10.98.32.157 with SMTP id m29mr3039365pfj.182.1518185309336; Fri, 09 Feb 2018 06:08:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518185309; cv=none; d=google.com; s=arc-20160816; b=kd1XXB5uZb59k0ebp+qQftkRIplcuURH4I6CkSVwpRawxxmTRTGPGaD9z09gNJ6zFV owuwrPrcKfd2h9EGfEbVHCTVO72vrTRHiDiaxRfckKiwMdmRwXyi8wcdxOeREj7yvvZI mHVPe7p3v9Gkwqmcn4YoXoInLajxOhiXsQo0fcAbWlG2PgM0dFMrEidIn1mVG/5czBLm X9ji729LSS4mxAPRcYrH55DceknRfE6rAezHwWHpYtktDxf9WpQOiOrVSpMtwu6s+b5w GFoFffIPD8idGjukQEvk0Ams54ciPH4LFiSXelUHnsWsaCsO8GVnb7dmbsnHz3W5h0og ID+A== 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 :arc-authentication-results; bh=Md/cfxDtb1z+8Dva7bwBMe6KWPvUgJrPnoG5fYNSSM0=; b=qV9aAx+CacC/BKovrDvgDYFy8wyen+MBba348s6Lt7xqe54YJU3iJO80n9kvYC0gEo /X21sc/cDtfsEfvExjMjgGstrezMqXZD45V/LHT88Fh6F5aZZ1mEBxnfC6fjmYoUnv+1 LZDcg6C/wXCZeLmCG49YC/l7ARSBKpMaOyD62a09xKEdFw79WKTziORbFvn2ZG5ceuGC T6nh+evXCfVpKdYW6g7fq8hflOpiEcSMdBdvLz5OCGQKzRcf6F9lIx9vBlO2S4AdTSkx cveRlRgi6f2JvtxUPiQNe27efo8WV+EvjI8rKKF+I8g5e5vBMh1fE5U+suq/N2oDRoBo Rjig== 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 e3si1413015pgt.217.2018.02.09.06.08.09; Fri, 09 Feb 2018 06:08:29 -0800 (PST) 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 S1753040AbeBINmp (ORCPT + 99 others); Fri, 9 Feb 2018 08:42:45 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:49952 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752946AbeBINmn (ORCPT ); Fri, 9 Feb 2018 08:42:43 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 676CEFB6; Fri, 9 Feb 2018 13:42:42 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oliver OHalloran , Michael Ellerman Subject: [PATCH 4.9 09/92] powerpc/powernv: Check device-tree for RFI flush settings Date: Fri, 9 Feb 2018 14:38:38 +0100 Message-Id: <20180209133931.925990571@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180209133931.211869118@linuxfoundation.org> References: <20180209133931.211869118@linuxfoundation.org> User-Agent: quilt/0.65 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.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Oliver O'Halloran commit 6e032b350cd1fdb830f18f8320ef0e13b4e24094 upstream. New device-tree properties are available which tell the hypervisor settings related to the RFI flush. Use them to determine the appropriate flush instruction to use, and whether the flush is required. Signed-off-by: Oliver O'Halloran Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/platforms/powernv/setup.c | 50 +++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) --- a/arch/powerpc/platforms/powernv/setup.c +++ b/arch/powerpc/platforms/powernv/setup.c @@ -35,13 +35,63 @@ #include #include #include +#include +#include #include "powernv.h" +static void pnv_setup_rfi_flush(void) +{ + struct device_node *np, *fw_features; + enum l1d_flush_type type; + int enable; + + /* Default to fallback in case fw-features are not available */ + type = L1D_FLUSH_FALLBACK; + enable = 1; + + np = of_find_node_by_name(NULL, "ibm,opal"); + fw_features = of_get_child_by_name(np, "fw-features"); + of_node_put(np); + + if (fw_features) { + np = of_get_child_by_name(fw_features, "inst-l1d-flush-trig2"); + if (np && of_property_read_bool(np, "enabled")) + type = L1D_FLUSH_MTTRIG; + + of_node_put(np); + + np = of_get_child_by_name(fw_features, "inst-l1d-flush-ori30,30,0"); + if (np && of_property_read_bool(np, "enabled")) + type = L1D_FLUSH_ORI; + + of_node_put(np); + + /* Enable unless firmware says NOT to */ + enable = 2; + np = of_get_child_by_name(fw_features, "needs-l1d-flush-msr-hv-1-to-0"); + if (np && of_property_read_bool(np, "disabled")) + enable--; + + of_node_put(np); + + np = of_get_child_by_name(fw_features, "needs-l1d-flush-msr-pr-0-to-1"); + if (np && of_property_read_bool(np, "disabled")) + enable--; + + of_node_put(np); + of_node_put(fw_features); + } + + setup_rfi_flush(type, enable > 0); +} + static void __init pnv_setup_arch(void) { set_arch_panic_timeout(10, ARCH_PANIC_TIMEOUT); + pnv_setup_rfi_flush(); + /* Initialize SMP */ pnv_smp_init();