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: 115532 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp893670vqx; Mon, 3 Jul 2023 18:10:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlGzRxWtiMUwNsXodno+GpRSOp+9f+VWu3l0l1q6PMHMS/S36A0KsKwR6f082hU3jimzqie/ X-Received: by 2002:a92:d98a:0:b0:345:aee1:eaed with SMTP id r10-20020a92d98a000000b00345aee1eaedmr12660753iln.23.1688433020611; Mon, 03 Jul 2023 18:10:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688433020; cv=none; d=google.com; s=arc-20160816; b=RNQwnFFPr46UZfvbQnBQsVUGU+YP66ugZhe8EOLmqSqGbaAnKR5ECf0fby3On/K7rv MlbWmpKgDKU0cpILC+PQD8/ip5Pvu9kY8LU0XlFaw2qNN4KE+r+Ez2aHL70XPjexV+BR CIrXvR3rLUy40TpxxFQvQb4ly6ZNrA0585TVTq6+vER0SoHSIZ4J//AKzrwqcLCqjcrR Lk2pjfltwUHzJS6O8RyIgbOBi+prRc9tI1CryzXe89GDoXk4OKfK0W0CoX0vZ9VGtXCb iDb+CSI4DI/yxu+FQseJtgDavtN5NvTrhPb+7opbOJf409ddUaquh9UwMtxzYnC+2MNo PGuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=wZmwLhXUybuDIWyIow74RTl/H75QKsJ9E1wkXb9Ip1E=; fh=oV73hD5Vrm7+MUJ/t06/7XI0er6TOzcjPnLWt7qW8vc=; b=MDKx3vK/9AEykjCGzJkWn8ZjcE3/WClmS2ZUZjgpRoKwdXsHUrC8TSicg6K1LItYx/ qI0zXVWnqNRnFFA4jEeBYfDQygxo9MDycx8haxnLCqwD1ANJyf6tIosIbVtUR0sciNBK Zs04FiXVob9wb6jWJQIkriPEE3bWCpOFL67yDBJXy1eZRiWYB1UjQU+nS1OIdb8Avbey baTZsDOEwL/wdsZrGU8iTH+1aG4k5+clzJqH0FdpVaNgwinZpw4DkSvIOUL0Ywo89WvK t61g1irQt+iMx+wvB5pXE9+efjuTVAlrAfbJ0MWXVJfjSIPOoJCvXb3z/Cb0kgOENkwZ yLkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xdelt5iK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y11-20020a634b0b000000b005578023de91si19284865pga.170.2023.07.03.18.10.07; Mon, 03 Jul 2023 18:10:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Xdelt5iK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229896AbjGDBAK (ORCPT + 99 others); Mon, 3 Jul 2023 21:00:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229622AbjGDBAJ (ORCPT ); Mon, 3 Jul 2023 21:00:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05BD4136 for ; Mon, 3 Jul 2023 18:00:08 -0700 (PDT) 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 7E60761017 for ; 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-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770450342964425278?= X-GMAIL-MSGID: =?utf-8?q?1770450342964425278?= 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;