Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp903129imu; Tue, 11 Dec 2018 09:18:31 -0800 (PST) X-Google-Smtp-Source: AFSGD/WbTWZTq5C1T7iJlbeQIm0D1lXV+lw9iniWpiHzwstMJ6INwJuhs6xS/eiq/QXLy1yEwYi5 X-Received: by 2002:a17:902:9345:: with SMTP id g5mr16315565plp.148.1544548711107; Tue, 11 Dec 2018 09:18:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544548711; cv=none; d=google.com; s=arc-20160816; b=lDw0Bpbnkd3kkmtL7TBOcj6oyk+tyAXn8DSdNmyBJrBImElLatePP0pXHZBqJr/ahi vl8/Bm+jmbAc+cQDPUgvPnBeZyrftKsgCTAtdswfcHtq6zF+qA2o4j/kKhU4N5RZjhNW vDmLKStdJDxkq5bFxFtCASn1XmafIHDVySvLcSQ6TjsUEosxqwVXJ4iOjz3/kzox01b/ eYjmBlPMpOKGK6IgJLgcxnO2ieZom6mdiAz2kKNeQ2D/0vHZ3Cl0PFNO1404mJpwwxhY /GIWClkIYA3xW+6FZJGEOf+VAk0ib4V+s6IrGY9esfTnprRck/XevPX2G0tdhI6m+K9L 46GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ietvAVHvMjqxcAW/Qe9W0+9WoezSkG0ivK4DhYGCJxA=; b=zPqb4XOUWdJX2s1LwolQTTi5MoIfexibMy4Lb+63qXXsqBvHryPGIKA/Zsc1X3NHwN ciczSVGsF/SzxUCIt6MVqceMtLkCd7G5ybCpILbNkRvQgGuNhwJjOLDIt9zKHBeCjBaY jZ8NMFtjLpoT9RZHvGQEh6s4znvsUdqAVPXVfbrv0MIP4n4w+8XEB+c7f7rTr5TBxrno WOMPWMjQNwwLhpt2cljvB+gBLvG0n9w1rKe+eUwspoJVIkun+nzNJsrwxTG8ixIx86Mv tM4Av1KZw7FnbcU0NgNJtdEbtUTzvECjD/mx4kTPxAuCKmdlKmov1GXgHUk0SmS7B6Hz YXeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="SmJqkKv/"; 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 d14si12101017pgi.158.2018.12.11.09.17.54; Tue, 11 Dec 2018 09:18:31 -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; dkim=pass header.i=@kernel.org header.s=default header.b="SmJqkKv/"; 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 S1731060AbeLKP6n (ORCPT + 99 others); Tue, 11 Dec 2018 10:58:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:48214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731048AbeLKP6l (ORCPT ); Tue, 11 Dec 2018 10:58:41 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 D9A09205C9; Tue, 11 Dec 2018 15:58:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544543920; bh=m+ulCkNmKM407BMsqM2mIyiq8hRNKYsFDUcZVTBrGZ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SmJqkKv/C8RQZNPiMhWA978LDImUVkZg7yr1bvqrlhQpYAhjTmTfPBuPUSK+QzMt2 l6yR39BobD8yDgmhXf7AlEZTqXvRqgHVqgHhEjmU8ssVgjTJ8NvTOprtKRqgr1f0fb kVEIHYJW1DwYCdutZoQ+RLyKkVJQntB5juRy3h4k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kunihiko Hayashi , James Morse , Will Deacon , Catalin Marinas Subject: [PATCH 4.19 080/118] arm64: hibernate: Avoid sending cross-calling with interrupts disabled Date: Tue, 11 Dec 2018 16:41:39 +0100 Message-Id: <20181211151647.498633571@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181211151644.216668863@linuxfoundation.org> References: <20181211151644.216668863@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Will Deacon commit b4aecf78083d8c6424657c1746c7c3de6e61669f upstream. Since commit 3b8c9f1cdfc50 ("arm64: IPI each CPU after invalidating the I-cache for kernel mappings"), a call to flush_icache_range() will use an IPI to cross-call other online CPUs so that any stale instructions are flushed from their pipelines. This triggers a WARN during the hibernation resume path, where flush_icache_range() is called with interrupts disabled and is therefore prone to deadlock: | Disabling non-boot CPUs ... | CPU1: shutdown | psci: CPU1 killed. | CPU2: shutdown | psci: CPU2 killed. | CPU3: shutdown | psci: CPU3 killed. | WARNING: CPU: 0 PID: 1 at ../kernel/smp.c:416 smp_call_function_many+0xd4/0x350 | Modules linked in: | CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.20.0-rc4 #1 Since all secondary CPUs have been taken offline prior to invalidating the I-cache, there's actually no need for an IPI and we can simply call __flush_icache_range() instead. Cc: Fixes: 3b8c9f1cdfc50 ("arm64: IPI each CPU after invalidating the I-cache for kernel mappings") Reported-by: Kunihiko Hayashi Tested-by: Kunihiko Hayashi Tested-by: James Morse Signed-off-by: Will Deacon Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman --- arch/arm64/kernel/hibernate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/arm64/kernel/hibernate.c +++ b/arch/arm64/kernel/hibernate.c @@ -214,7 +214,7 @@ static int create_safe_exec_page(void *s } memcpy((void *)dst, src_start, length); - flush_icache_range(dst, dst + length); + __flush_icache_range(dst, dst + length); pgdp = pgd_offset_raw(allocator(mask), dst_addr); if (pgd_none(READ_ONCE(*pgdp))) {