Received: by 10.223.185.116 with SMTP id b49csp2384106wrg; Thu, 15 Feb 2018 10:47:03 -0800 (PST) X-Google-Smtp-Source: AH8x226x+OfJsb+y+IHcID7pq45LU5Gy3aRHJJAnH7Z5pPl3PBCN+vSPoIbUlOPTXEyfPpDwSsCi X-Received: by 2002:a17:902:5305:: with SMTP id b5-v6mr3305040pli.61.1518720423072; Thu, 15 Feb 2018 10:47:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518720423; cv=none; d=google.com; s=arc-20160816; b=WXXUV66FxV86mURqzjWlNmoCDIBZPmV31brQPckESNCGCU8ReqeKaaxjhh6a5fQNAg /X5ruBJlQPEkjbbeJ/guBAW3AbolJkIRjKjzTdA19QQddXlyeRXsZm/HvNxCIXulsv2h d1gn1BcctM27cJ1mn8ROdmpwxRFQMSziFYU88MvPx765sYWiH8/eACcFmdO/z0HVJln9 ZbrriJGVqDcRPcXT6pr0+U/NO2Y4/q3BUwDigy0uAWE4in0qIDGE+HMG70ZCC/LZBHxM mLBp6S98GFlo5tRjbGJtPdlgKxqEaTMfuS2yg0N3ONfDRsfc51TxM4e9+D1EzSCYIDdG L2Iw== 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=W434HqLNjxqYGO/9T3OiuXUo4H6gC5DU3Bkh4lgG+XQ=; b=sgHxxA3Otj/MC1ObMkk++JCbDrBrJIJ/WvvmdNplX24NDbCFsYw/rtTsiv3pAhDGnF 83WyVPlPbdkORq0KXueolnTORTLe0UzT0Yq6pNMtP/LJYcrxSmFRR99OVol1qIKTWbwL xQH80GFbg/2RNJXq7QxgkV5mYvsRxVNA6benBKvfVIYSYYX4eMWxIrP8Wa76+wFf0yF2 wlOg3okB0EvWhURyxbF2WTyC34J2Rt4GwlBPniPwuQ42kb5aq61JVJNvI2PsQ2YjmnCQ dj70t6M6LqQz5yPtCbN54faFWu6xlldE678j01h7SfP3rdAONARZYyU/vYlk+6g59iOX /3jw== 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 p8-v6si4678669plk.192.2018.02.15.10.46.48; Thu, 15 Feb 2018 10:47:03 -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 S1162549AbeBOPXE (ORCPT + 99 others); Thu, 15 Feb 2018 10:23:04 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:50474 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161910AbeBOPXA (ORCPT ); Thu, 15 Feb 2018 10:23:00 -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 538F6DD6; Thu, 15 Feb 2018 15:22:39 +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.4 014/108] powerpc/powernv: Check device-tree for RFI flush settings Date: Thu, 15 Feb 2018 16:16:11 +0100 Message-Id: <20180215151224.462003315@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180215151222.267507937@linuxfoundation.org> References: <20180215151222.267507937@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.4-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();