Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp405409img; Wed, 20 Mar 2019 03:11:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbGO2TavIPvocVUWZXuFx14LLRbbj9cupvDQqomQ6zS71lHYDGWGiAXQrMQupKnCw68KH1 X-Received: by 2002:a63:1322:: with SMTP id i34mr6650139pgl.208.1553076712683; Wed, 20 Mar 2019 03:11:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553076712; cv=none; d=google.com; s=arc-20160816; b=wEjlss/PT6RyrWk3PNqd+8Tnw5qzm7S2+nGP/mqsyM0XRMtMRU2HnpgB7OyyLVrszi 7NSmBgeeyz6iebdfxBsoHEBwmZAXVsWgf6gwrvdnlFPHjdIb/ftVGijWQwvjCkICN7x+ f25J0sodpxpARjaId2mwY/3fXXO19/aunQwfKixdbX2X7BwYLNw6kliR8hhodbuwgxi0 EC8OIyVmM0raXCEmn78WQ6Il/xB7mg+nh7NxIRRVInlJ9XSjhIhprQuwKkn3ChZLTQRg VDqc2VSE4XEZWtwKNGn6/1tTOP9U5L9wX/9iHPGasuT+IgBd6fMFL3AC9djhXj47pOtP Uhbw== 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=XMnpdij0lJYntaQnJxTgXX8uHpknTcgE4njbUx620Ec=; b=MHUhAY+4cKGKx+bW2KSy47ET2eiCwqPl3zizvAiDKeKiCSEihOMAy53HcA9iSVKmxT GPcUOLlTYKUi36AKtrA5Mpnlitp7joqLAtxDY+NtPaYSsU0DPUKLQUmnQiRImScC4lFX Poe/DrLEZn4fFcw7LIORpQQ6v76+nBd7+n6W4apfzxiTn42Uskfl50ZVcZAo2mGJaQuF mLX0UB2kkFwUIlxlWOT+s7QRxv9RTCrNb4MsqFwUjRACjvgRUXG3nUqIk6esXhwyjuiT 8VTEnpSyeJPwUS5y6CjzRRAmAn5u8TtIUVr8EItJhmwWoUYq4DeiP6JCfHzUWaObe09D 5vlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=PvdmPulf; 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 f67si1318263pgc.182.2019.03.20.03.11.36; Wed, 20 Mar 2019 03:11:52 -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=PvdmPulf; 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 S1727916AbfCTKIt (ORCPT + 99 others); Wed, 20 Mar 2019 06:08:49 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:64298 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726944AbfCTKGk (ORCPT ); Wed, 20 Mar 2019 06:06:40 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 44PQYn5FKMz9vC01; Wed, 20 Mar 2019 11:06:37 +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=PvdmPulf; 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 5cGSIn7k_SbG; Wed, 20 Mar 2019 11:06:37 +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 44PQYn4578z9vByx; Wed, 20 Mar 2019 11:06:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1553076397; bh=XMnpdij0lJYntaQnJxTgXX8uHpknTcgE4njbUx620Ec=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=PvdmPulfodAoMdDiTkNtRzcBq9ESvZQ6gx4OJsCeDi4j+xeP0m94uhXO9FtPtFztI ArU8Yo7gt6R3SdmsN0lVhnr9fr0/6KyoOFTzNX1VnPVzQpvmLPxkve9g92eCayvgTr oCgB413oxBr5lNN8XhEicgftRnDasABApQkN/sKE= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id A90818B918; Wed, 20 Mar 2019 11:06:38 +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 87GHPVL2yRWI; Wed, 20 Mar 2019 11:06:38 +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 8E1588B911; Wed, 20 Mar 2019 11:06:38 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 8231063AEF; Wed, 20 Mar 2019 10:06:38 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v1 03/27] powerpc/mm: don't BUG() in slice_mask_for_size() 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:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When no mask is found for the page size, WARN() and return NULL instead of BUG()ing. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/slice.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c index aec91dbcdc0b..011d470ea340 100644 --- a/arch/powerpc/mm/slice.c +++ b/arch/powerpc/mm/slice.c @@ -165,7 +165,8 @@ static struct slice_mask *slice_mask_for_size(struct mm_struct *mm, int psize) if (psize == MMU_PAGE_16G) return &mm->context.mask_16g; #endif - BUG(); + WARN_ON(true); + return NULL; } #elif defined(CONFIG_PPC_8xx) static struct slice_mask *slice_mask_for_size(struct mm_struct *mm, int psize) @@ -178,7 +179,8 @@ static struct slice_mask *slice_mask_for_size(struct mm_struct *mm, int psize) if (psize == MMU_PAGE_8M) return &mm->context.mask_8m; #endif - BUG(); + WARN_ON(true); + return NULL; } #else #error "Must define the slice masks for page sizes supported by the platform" -- 2.13.3