Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp507093ybg; Wed, 3 Jun 2020 06:35:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvHRZ+o9cos4j+HfWiSSQX9wnp4/SUwO5rLzGB+CL+yRJbxQ1KRXE+fZc5KTIBQulaLJkB X-Received: by 2002:a50:a7a5:: with SMTP id i34mr30557285edc.55.1591191318734; Wed, 03 Jun 2020 06:35:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591191318; cv=none; d=google.com; s=arc-20160816; b=IP5BYPwQzE1m6E5O/9xlEmaDEbfGoL/JtIHY3IFjqT/ouAALengtUioNQ93nQtTt52 RfjNhN9ijxQJZwbyY2/5FcPJ6KgZ6aVHb028N/UfOW9OvX3uBmwUqbt4WSuPOH/MX3bt 0z6HK8lEeXCOUA2uGJR3uLvlAGTPgNtTtXxpA/IZ45HPXghjkP2x8l///pVxzatNnzIQ aLB+qBiY/8hCaY4ruJ1cdBPOX8z+5C0TnIbRMq5q5OSrbEnCj/YX9zwp0oSeoH7RBF4o Wzbq7uTO8GKqcxMrtMOm9XsTCaOIHsLB9rfgxEDuCaSo6DHNVVx7asgVeT6C3QOqGdLp Ophw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=mYSBQgV72MRmw0li66FtzsILqxHgXJi5qBjoSwKEYHc=; b=FxN575YYFQ1n3vNw5Ji6L5tMgTMxPWbzpaaRJWSwrT30GJnyUCjofE9krKc+2axrhI 4D7cbVyz8krvSmmv8aCyBaiJU8O/hbTwdRHXXeY0BdtryZaqHax9cybqLTlBQ8ACG55d djyJ3bsttyH7/ImO1u2pThUx7W+udyA+DNl/3gc85NXbfm1tqz1a55Wfqt0jl63y1Hux /a8zLPZ+pc4JY2/RJFZFmA0Qj9iS9Yy74fmiDIYqVlvbzLz1ajJ59/LKexItuk6PrF3m SEMlDn0yylqzfbDlA3wI3KWO0aD/m0MEEvXE/lCJNs8wkcRagxrsuYFNYxCG6oZhuHzk zT/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y43si1308554ede.404.2020.06.03.06.34.53; Wed, 03 Jun 2020 06:35:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725936AbgFCNdD (ORCPT + 99 others); Wed, 3 Jun 2020 09:33:03 -0400 Received: from mx2.suse.de ([195.135.220.15]:48008 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725836AbgFCNdC (ORCPT ); Wed, 3 Jun 2020 09:33:02 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 636FDAE92; Wed, 3 Jun 2020 13:33:03 +0000 (UTC) Date: Wed, 3 Jun 2020 15:32:57 +0200 From: Joerg Roedel To: Abdul Haleem Cc: linuxppc-dev , linux-next , linux-kernel , mpe , Stephen Rothwell , sachinp , manvanth , "aneesh.kumar" , akpm@linux-foundation.org, Steven Rostedt , hch Subject: Re: [mainline][Oops][bisected 2ba3e6 ] 5.7.0 boot fails with kernel panic on powerpc Message-ID: <20200603133257.GL6857@suse.de> References: <1591181457.9020.13.camel@abdul> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1591181457.9020.13.camel@abdul> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 03, 2020 at 04:20:57PM +0530, Abdul Haleem wrote: > @Joerg, Could you please have a look? Can you please try the attached patch? diff --git a/include/asm-generic/5level-fixup.h b/include/asm-generic/5level-fixup.h index 58046ddc08d0..afbab31fbd7e 100644 --- a/include/asm-generic/5level-fixup.h +++ b/include/asm-generic/5level-fixup.h @@ -17,6 +17,11 @@ ((unlikely(pgd_none(*(p4d))) && __pud_alloc(mm, p4d, address)) ? \ NULL : pud_offset(p4d, address)) +#define pud_alloc_track(mm, p4d, address, mask) \ + ((unlikely(pgd_none(*(p4d))) && \ + (__pud_alloc(mm, p4d, address) || ({*(mask)|=PGTBL_P4D_MODIFIED;0;})))? \ + NULL : pud_offset(p4d, address)) + #define p4d_alloc(mm, pgd, address) (pgd) #define p4d_alloc_track(mm, pgd, address, mask) (pgd) #define p4d_offset(pgd, start) (pgd) diff --git a/include/linux/mm.h b/include/linux/mm.h index 7e07f4f490cb..d46bf03b804f 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2088,35 +2088,35 @@ static inline pud_t *pud_alloc(struct mm_struct *mm, p4d_t *p4d, NULL : pud_offset(p4d, address); } -static inline p4d_t *p4d_alloc_track(struct mm_struct *mm, pgd_t *pgd, +static inline pud_t *pud_alloc_track(struct mm_struct *mm, p4d_t *p4d, unsigned long address, pgtbl_mod_mask *mod_mask) - { - if (unlikely(pgd_none(*pgd))) { - if (__p4d_alloc(mm, pgd, address)) + if (unlikely(p4d_none(*p4d))) { + if (__pud_alloc(mm, p4d, address)) return NULL; - *mod_mask |= PGTBL_PGD_MODIFIED; + *mod_mask |= PGTBL_P4D_MODIFIED; } - return p4d_offset(pgd, address); + return pud_offset(p4d, address); } -#endif /* !__ARCH_HAS_5LEVEL_HACK */ - -static inline pud_t *pud_alloc_track(struct mm_struct *mm, p4d_t *p4d, +static inline p4d_t *p4d_alloc_track(struct mm_struct *mm, pgd_t *pgd, unsigned long address, pgtbl_mod_mask *mod_mask) + { - if (unlikely(p4d_none(*p4d))) { - if (__pud_alloc(mm, p4d, address)) + if (unlikely(pgd_none(*pgd))) { + if (__p4d_alloc(mm, pgd, address)) return NULL; - *mod_mask |= PGTBL_P4D_MODIFIED; + *mod_mask |= PGTBL_PGD_MODIFIED; } - return pud_offset(p4d, address); + return p4d_offset(pgd, address); } +#endif /* !__ARCH_HAS_5LEVEL_HACK */ + static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) { return (unlikely(pud_none(*pud)) && __pmd_alloc(mm, pud, address))?