From patchwork Tue Jul 4 01:00:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13300565 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 364B4EB64DC for ; Tue, 4 Jul 2023 01:00:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=zK4tVxT4WxeUFVnhdhKEvHcq9fJ+svxu2GVXN+F+jnc=; b=3FXK5TMYxT1Yth ifNOfNGjgudUkRtO+GSZ4Xp6PdSZ9kS4F/4UZ5WRwpMlHrPt/52LoFT41/S6qB3+yDDo5qYQYoBu6 LRgTMT2PCBlG9m0KyyL2TmR3WC2mBMTmbXSo+g70Gjep+Gw6HXBbrvMZAmziIji0xpCrhuFgjYGCP OtXgbsjN5z+Tyhg3xKaoYQzpKY8iadvgMIdy9uebiyPF7aT1e1iTkoHOODPPjMeMFWvUndiz2sdhG 1AgF92T9szM0TdhsqbBUtkYNI/B3iIiEs20WfEKgwfQH0Xa/XDaTxPDfI4hFamxa+PodcKoy90vH1 Htv2hDYWWXbHSTgXoVoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qGUOp-00BnHy-2o; Tue, 04 Jul 2023 01:00:11 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qGUOn-00BnHV-2D for linux-arm-kernel@lists.infradead.org; Tue, 04 Jul 2023 01:00:10 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7BF096006F; Tue, 4 Jul 2023 01:00:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F99AC433C8; Tue, 4 Jul 2023 01:00:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688432406; bh=MXEys2E3ebeRfuAMK0DK9Y1JAWgYItda1NlZ4Ml4tAY=; h=From:To:Cc:Subject:Date:From; b=Xdelt5iKzAzXP8FeIZ/EEjKyFuqIK/Y2AYQ0elzbE8cfG0jq1iouQYhwXdyQAP7FU niNKE23QECbXgkeryxZAS2RcJZomY8PdhNeQLm7kiCctbukYK6hasStvIXKW4iwfkJ 9tGG9JgHcoZUK9/K21ZFZjgljbrJ128ZrxHh+jNRWihHsaVxAHdkS6ZNcvWob8cQkR 1yLy2nEyj/Fe3g/Svv/Sr/bnVD4UYhoF7PlsTUugkL1/K542AgQjdUtkOwFDtfril+ 76IQ8wy50jMtjSDDYa20kpex9Cwq9A/ZTadtSaYVkd8bMDT33gd8eFqp7QEgN1gapw RUrcUyRJLKmTQ== From: SeongJae Park To: akpm@linux-foundation.org Cc: surenb@google.com, Liam.Howlett@oracle.com, torvalds@linux-foundation.org, catalin.marinas@arm.com, will@kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH] arch/arm64/mm/fault: Fix undeclared variable error in do_page_fault() Date: Tue, 4 Jul 2023 01:00:03 +0000 Message-Id: <20230704010003.86352-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230703_180009_791919_B1C2BE13 X-CRM114-Status: GOOD ( 12.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Commit ae870a68b5d1 ("arm64/mm: Convert to using lock_mm_and_find_vma()") made do_page_fault() to use 'vma' even if CONFIG_PER_VMA_LOCK is not defined, but the declaration is still in the ifdef. As a result, building kernel without the config fails with undeclared variable error as below: arch/arm64/mm/fault.c: In function 'do_page_fault': arch/arm64/mm/fault.c:624:2: error: 'vma' undeclared (first use in this function); did you mean 'vmap'? 624 | vma = lock_mm_and_find_vma(mm, addr, regs); | ^~~ | vmap Fix it by moving the declaration out of the ifdef. Fixes: ae870a68b5d1 ("arm64/mm: Convert to using lock_mm_and_find_vma()") Signed-off-by: SeongJae Park --- arch/arm64/mm/fault.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 9d78ff78b0e3..b8c80f7b8a5f 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -536,9 +536,7 @@ static int __kprobes do_page_fault(unsigned long far, unsigned long esr, unsigned long vm_flags; unsigned int mm_flags = FAULT_FLAG_DEFAULT; unsigned long addr = untagged_addr(far); -#ifdef CONFIG_PER_VMA_LOCK struct vm_area_struct *vma; -#endif if (kprobe_page_fault(regs, esr)) return 0;