From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x224ljEbTB6t0971C3gXU/7gZsTwRaGY8ijudknmrp7cjVX5nNdCOPAaBQWLlVC49tldfw/S1 ARC-Seal: i=1; a=rsa-sha256; t=1516611041; cv=none; d=google.com; s=arc-20160816; b=syfY5GYWZ7a0yUpyn7wjzpnXq3pTvYieVDD24hYSN2lkWCyWQ/5bxB1iOoCJpyKzrM OFr/+6dTFaq0ocT4lv8e9lgUKccsJ511BoWTGx0y48jXtJpTbrGYHHnvKauMxY1MCOud flGys37iS7H0pJKpgDHxIix6ubbG/3KpO74hYFv+mv2eEs3KFnIItH2kraHfhoMtyEw+ CAoKvZHA0RSCpge+1l5hhRxFvNoE4kKcML0g4XlhKSChbRjs6dxL9Hh1gdo0QUZMLZyG ZrrTKyvpeSiBrc5realSN21BVVW9CLe/aAT8b0N/pv2yQC4/iTpxGOO1piFV8vkg03JW EJdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=q55H7oeT3wZATggoVLcVuwDB5IHvyAN4RKaCBRaL/VQ=; b=qTJiRJtc8ewn5sOdsrZNH+KZoMUeLfzF+T41mU+3JG0Hvjl8ppasC6qGMrmQl4RU/T UeAisgB5HrlXXRcIYNq5YwNw8JXe197ai9O/DWPY86PqBnI1zxVQ4tTcLhqHwa+afb48 L5Cmce3HLMrsq+H8A+RBgw+P2JH5Qesy7/WDIXeqvUJVDpfFrowSJajlPBu6gbnXyf0H nzidqzaPPNuzJq0q3V0Cyy9L2F94qtZNh+R2MvhYWRH2uoqKYq5Er9Hw+JNj2CdIOOb6 oAaKIPWZl2Hal2KzRiSkwJYLZRI63PlT8Moc4qHGjOkvB5Qhh5n5CffLIsIsgftMS3Xu Ll1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org 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.14 15/89] powerpc/powernv: Check device-tree for RFI flush settings Date: Mon, 22 Jan 2018 09:44:55 +0100 Message-Id: <20180122083956.217589929@linuxfoundation.org> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180122083954.683903493@linuxfoundation.org> References: <20180122083954.683903493@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590281939530374266?= X-GMAIL-MSGID: =?utf-8?q?1590281939530374266?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.14-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 | 49 +++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) --- a/arch/powerpc/platforms/powernv/setup.c +++ b/arch/powerpc/platforms/powernv/setup.c @@ -36,13 +36,62 @@ #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();