Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2361198imm; Mon, 28 May 2018 06:43:59 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqLT33wvezVbaefwneIg67ehU0gNBQql3nCzpVqT0qx6su0R45PiDcAPn2rU9ER4mjI2KVB X-Received: by 2002:a62:fb14:: with SMTP id x20-v6mr13595917pfm.48.1527515038991; Mon, 28 May 2018 06:43:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527515038; cv=none; d=google.com; s=arc-20160816; b=qWRptw+R5OPea8uk50hheCw7JRpDte2tifb2QpvscRpNt9yIVr2sgqyQbG5IEeizMm 0wZ3hMWUdSv743dyCPMjNNIf3StIPNUMqi1qP19Zrrmk/uOhp3yK18f6EGPZVPKPLEdc 4g2gKwI7gemOceOU4mZkkRkHwlMIwFt8yfn1fA++cla9s7R1JzK57e2Z00PNomQ6QuM0 XNayhD4PQ+a8zQvx6b8n7RcxTihr+h7RD6KZUuZKLFx0ZYHNfr6aHzlfETukmE6RIT1s tHWHWFAX8QToYn0UXWD6UJ26V/AqbQv1AX5myqkK5q0FVAjU3OvGfI/+GPxtQ4dvZJT0 fDbQ== 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=iEiNo39do+VnYtkMTPUVs9kdqcZ8lURVAZy3DsCuNIw=; b=dLo0bRRLrPC1c1eWkeCg3uYA3WLH1NHwARtn3DtVQQaygRz8Lrzbb8bICrxmt3Ne1A sPXtZoiRtW3Tqw9ckyzL8FmJb6KSpX0dblA/5wbHFezPlx2RV09QF4WY8Y5UsXNBygMz zO8KOhLvPGAo5HGA05v40K2myZOFJIsnPrRFXtPvTe8PL4ZAkdhYCAzYHBwoV8Kasw3S /C29SzwLaBHEz5+0qttxV0FluOmeBh9av7GShIBbHu7m7nEZPox9qWpyE0DqviB8sbmK QG5IHs2UkReETae9xoPB6CyBxp4R2RVATK2Jvwg7wNB1YdrdT0+K9i2BBhFV8ctNzPBK VF+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oPAUZv5u; 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 x2-v6si29193971plv.388.2018.05.28.06.43.44; Mon, 28 May 2018 06:43:58 -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=oPAUZv5u; 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 S1165372AbeE1Nlw (ORCPT + 99 others); Mon, 28 May 2018 09:41:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:35060 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968891AbeE1KoQ (ORCPT ); Mon, 28 May 2018 06:44:16 -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 3869E204EE; Mon, 28 May 2018 10:44:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504255; bh=sOauCQL5GXE0u1nK0NtD/yWDKV/OB/+e4AhiyV+Hj94=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oPAUZv5uSgvk62oJu/QuvPyaXCCqKXTU0SF2UqayWlXJ/MY40KvSf20LvGsy8cMU3 N5wDQN1+3UPUsJdETlaM+/nNiUPL+Hu8yjtvRNiO1GVCYXtwUxdHhk3co7p8dRh8BJ JsJlUYc2Mxk5yisDOLYBQfHu9dbtdcpnLWThsGdw= 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 038/496] powerpc/rfi-flush: Make it possible to call setup_rfi_flush() again Date: Mon, 28 May 2018 11:57:03 +0200 Message-Id: <20180528100321.270122932@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: Michael Ellerman commit abf110f3e1cea40f5ea15e85f5d67c39c14568a7 upstream. For PowerVM migration we want to be able to call setup_rfi_flush() again after we've migrated the partition. To support that we need to check that we're not trying to allocate the fallback flush area after memblock has gone away (i.e., boot-time only). Signed-off-by: Michael Ellerman Signed-off-by: Mauricio Faria de Oliveira Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/include/asm/setup.h | 2 +- arch/powerpc/kernel/setup_64.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) --- a/arch/powerpc/include/asm/setup.h +++ b/arch/powerpc/include/asm/setup.h @@ -49,7 +49,7 @@ enum l1d_flush_type { L1D_FLUSH_MTTRIG = 0x8, }; -void __init setup_rfi_flush(enum l1d_flush_type, bool enable); +void setup_rfi_flush(enum l1d_flush_type, bool enable); void do_rfi_flush_fixups(enum l1d_flush_type types); #endif /* !__ASSEMBLY__ */ --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c @@ -836,6 +836,10 @@ static void init_fallback_flush(void) u64 l1d_size, limit; int cpu; + /* Only allocate the fallback flush area once (at boot time). */ + if (l1d_flush_fallback_area) + return; + l1d_size = ppc64_caches.l1d.size; limit = min(safe_stack_limit(), ppc64_rma_size); @@ -853,7 +857,7 @@ static void init_fallback_flush(void) } } -void __init setup_rfi_flush(enum l1d_flush_type types, bool enable) +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");