Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp404198img; Wed, 20 Mar 2019 03:10:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/xpPfa5R5nuab4O32I9gvO6GT2iRDhhF/wH/Kt86Vsxh8N0ZNdG9VRD55z1Iqb0PSjwji X-Received: by 2002:aa7:90c7:: with SMTP id k7mr6749583pfk.186.1553076627780; Wed, 20 Mar 2019 03:10:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553076627; cv=none; d=google.com; s=arc-20160816; b=vD5vMTfx1VAlx6m5jPv6743EL7e5NZQWIj77PNjATovKKF/7PcYOzUi8Pg7f5QwEN8 Oyzukl/BxP+z3ZEFNgvoP01MD8r8GT4UreBgejVDsRs+baLTT2I3hnflfmuP+01/KPvl YXMFwG8ISm6zkxu78Uu2p1BEVbFpyFXB1WQuI5n2EjjE4k7fyd2lVmkh+fGtiBsbmk8v SmmzyAND3dyRSQsAs7lAD417cz2el7OjIGEI84IsTTyx1tJ2w9c/g7LbocDlWqtG1b6p qvdoFuObMSuRr0/8lifDj9MflqOiHYA2qKPKcjvAQP76bL+H7bozFD5CWGvSnMFYy4kN cr+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=kIQ5rK5h2H8yjZ42iGKBgk/GXUmRuZIgLz9zU3XqFOs=; b=WW+v+nVX3/UDswsd/mVHpUQzzW8Vf627RlC/rYFzf28h8N/m7slIKfhrmjFE3oxfgq PKR0FZfTo7m9sp3CbL2FCHpIhI/prI+Mjo1SZapgJXA+p8HL5bCKiw6cmVV/pLOlqoY+ gYAnrjziEJnWS0PvE/bfOkuLaZB1ovfIw2/CdtszLDwJzfU3vHNPV9jaBHk+7WZwXAXL uY8KRUXTBRS77b+Vi5aXMV8uj5ZNhFMFBvxj53Bu6d8akhMWVTu8BLcvJkwXSMNFcvcV yc78L/PTtyb/VMXrfc4tdngkYqFHcp/rvnwDLvX0SPO9cDs1EKLbY3n8TjLiVyCOrK3V jOZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=EwI3Ojuk; 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 h124si1297160pgc.25.2019.03.20.03.10.12; Wed, 20 Mar 2019 03:10:27 -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=@c-s.fr header.s=mail header.b=EwI3Ojuk; 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 S1726647AbfCTKGi (ORCPT + 99 others); Wed, 20 Mar 2019 06:06:38 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:56767 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726020AbfCTKGi (ORCPT ); Wed, 20 Mar 2019 06:06:38 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 44PQYl507Tz9vC00; Wed, 20 Mar 2019 11:06:35 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=EwI3Ojuk; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id juJjm4Lwl1kv; Wed, 20 Mar 2019 11:06:35 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 44PQYl3klVz9vByx; Wed, 20 Mar 2019 11:06:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1553076395; bh=kIQ5rK5h2H8yjZ42iGKBgk/GXUmRuZIgLz9zU3XqFOs=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=EwI3OjukfKzYb81KMKchegESYYsXjFFyujtQawfFLPoO7miLHVFUYQgf+h0Uofek0 zhUAfvKPSIVFg3P0hXNz2pZ1IIuwjyZuBqMqfPFkEW0eq9S4OWtmb8QOupjPpcndTc JITeGqZPplJ5pv/mTDduNTFRVESZRdqnLtRAVenY= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 9FEBE8B918; Wed, 20 Mar 2019 11:06:36 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id yXLsfSSYsgaZ; Wed, 20 Mar 2019 11:06:36 +0100 (CET) Received: from po16846vm.idsi0.si.c-s.fr (unknown [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 7BDDA8B911; Wed, 20 Mar 2019 11:06:36 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 72BEC63AEF; Wed, 20 Mar 2019 10:06:36 +0000 (UTC) Message-Id: <9d6b0fe78346ff8e81a969a75a616bab59bc5cf5.1553076180.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v1 01/27] powerpc/mm: Don't BUG() in hugepd_page() To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , aneesh.kumar@linux.ibm.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Wed, 20 Mar 2019 10:06:36 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Don't BUG(), just warn and return NULL. If the NULL value is not handled, it will get catched anyway. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/hugetlb.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/hugetlb.h b/arch/powerpc/include/asm/hugetlb.h index 8d40565ad0c3..48c29686c78e 100644 --- a/arch/powerpc/include/asm/hugetlb.h +++ b/arch/powerpc/include/asm/hugetlb.h @@ -14,7 +14,8 @@ */ static inline pte_t *hugepd_page(hugepd_t hpd) { - BUG_ON(!hugepd_ok(hpd)); + if (WARN_ON(!hugepd_ok(hpd))) + return NULL; /* * We have only four bits to encode, MMU page size */ @@ -42,7 +43,8 @@ static inline void flush_hugetlb_page(struct vm_area_struct *vma, static inline pte_t *hugepd_page(hugepd_t hpd) { - BUG_ON(!hugepd_ok(hpd)); + if (WARN_ON(!hugepd_ok(hpd))) + return NULL; #ifdef CONFIG_PPC_8xx return (pte_t *)__va(hpd_val(hpd) & ~HUGEPD_SHIFT_MASK); #else -- 2.13.3