From patchwork Wed Nov 11 14:53:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 11898003 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 05365921 for ; Wed, 11 Nov 2020 14:54:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 99DCE2068D for ; Wed, 11 Nov 2020 14:54:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JC5qn6dW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 99DCE2068D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 938D56B0099; Wed, 11 Nov 2020 09:54:13 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8E8396B009A; Wed, 11 Nov 2020 09:54:13 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7D8EA6B009B; Wed, 11 Nov 2020 09:54:13 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0060.hostedemail.com [216.40.44.60]) by kanga.kvack.org (Postfix) with ESMTP id 53EDC6B0099 for ; Wed, 11 Nov 2020 09:54:13 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id F0B5A8249980 for ; Wed, 11 Nov 2020 14:54:12 +0000 (UTC) X-FDA: 77472432744.12.crate02_120e5df272fe Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id DE2D218016296 for ; Wed, 11 Nov 2020 14:53:52 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,david@redhat.com,,RULES_HIT:30054,0,RBL:216.205.24.124:@redhat.com:.lbl8.mailshell.net-64.10.201.10 62.18.0.100;04yry74y65qkgu7tfdr33domd6oryopscs4swg564jkzbnaar7eqzb3gid8dmsq.o9z1mxduk5wawya3ohwoaqzwpjz5khowuxsw1zpbehikmm78kbx9nyaccdfsgxa.e-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:70,LUA_SUMMARY:none X-HE-Tag: crate02_120e5df272fe X-Filterd-Recvd-Size: 3768 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Wed, 11 Nov 2020 14:53:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605106432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HjIV86G4+zXJRkvdg3A94EY+lDllWpujuARJLy+GgHg=; b=JC5qn6dWq9FNy9U2fNX803zak4VwjZ3PPtf1EECkPQqntMq7nu2hXRVKWXt2Mi9HbgphwN qrdF85oN5oAy1gi3m2LyMpjiLR7Dv8r9aXeGi3R/N8MA5/Mymn7C70TkuCYJ+jyjYbOZKl Jx9UJwZMeFluZLoA4Qn1HmiaUwMlqYU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-293-hceWkfh2NFaINwskg_F-hQ-1; Wed, 11 Nov 2020 09:53:46 -0500 X-MC-Unique: hceWkfh2NFaINwskg_F-hQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C5E7E1099F63; Wed, 11 Nov 2020 14:53:44 +0000 (UTC) Received: from t480s.redhat.com (ovpn-114-151.ams2.redhat.com [10.36.114.151]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F3A2380; Wed, 11 Nov 2020 14:53:42 +0000 (UTC) From: David Hildenbrand To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, David Hildenbrand , Oscar Salvador , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Rashmica Gupta , Andrew Morton , Mike Rapoport , Michal Hocko , Wei Yang Subject: [PATCH v2 5/8] powerpc/mm: print warning in arch_remove_linear_mapping() Date: Wed, 11 Nov 2020 15:53:19 +0100 Message-Id: <20201111145322.15793-6-david@redhat.com> In-Reply-To: <20201111145322.15793-1-david@redhat.com> References: <20201111145322.15793-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Let's print a warning similar to in arch_add_linear_mapping() instead of WARN_ON_ONCE() and eventually crashing the kernel. Reviewed-by: Oscar Salvador Cc: Michael Ellerman Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Rashmica Gupta Cc: Andrew Morton Cc: Mike Rapoport Cc: Michal Hocko Cc: Oscar Salvador Cc: Wei Yang Signed-off-by: David Hildenbrand --- arch/powerpc/mm/mem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index ca5c4b54c366..c5755b9efb64 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c @@ -150,7 +150,9 @@ void __ref arch_remove_linear_mapping(u64 start, u64 size) mutex_lock(&linear_mapping_mutex); ret = remove_section_mapping(start, start + size); mutex_unlock(&linear_mapping_mutex); - WARN_ON_ONCE(ret); + if (ret) + pr_warn("Unable to remove linear mapping for 0x%llx..0x%llx: %d\n", + start, start + size, ret); /* Ensure all vmalloc mappings are flushed in case they also * hit that section of memory