From mboxrd@z Thu Jan 1 00:00:00 1970 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 51568C77B7A for ; Fri, 26 May 2023 18:49:01 +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:Cc:To:From:Subject:Message-ID: Mime-Version:Date: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=WA1pAk32fiH7/yjCb/11dnlj+Tcn9xZQQOUUd3Vv51I=; b=DDT jjOmTyA2MJI0FhYxegXS8gWK/b2CSQ1YUCUCuG7sxIgKHHJWh0kgX9hSBoxOdrFivYrRt3PH23HpJ 62Zc5pB8dM2/CaV4rmy5vCMgmBAE1eRkS3DEcTXzBy5DkEvClzOrLTMOrcWXYwwk7fGbHaAjulO+b 1zABsq45RO+Pa0ZHg+gQD9DACIqO6WFqyLA302Zml6pS5ZY1UMpXiPYGMnDczdt44z76hb1NpGvnL tQc8IwgXK0jZ7y/s1geSc+ixQz5OJ2pOGzPTe076bB5rUtoDDXzyqWDl2uhd3HBtJ4HnMGGVu8Xim hjw394GP3a4QqlqQIxglsWFqZhEMg/g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q2cUM-003Xwj-06; Fri, 26 May 2023 18:48:34 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q2cUJ-003Xvp-0W for linux-arm-kernel@lists.infradead.org; Fri, 26 May 2023 18:48:32 +0000 Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-babb5e91ab4so2395697276.0 for ; Fri, 26 May 2023 11:48:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1685126909; x=1687718909; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=pr0CfxQy0sGUiXzLTyaj373l3U9KzezGvaWkoYzA3QE=; b=qgAB1W5NVq0jFTTBMjUg8Hw2q2NCZNUP+DbQz09KcF8PA6oV1ga9KYZU8oGCp5XDsc YuYYUi7x1xKpvEXZD59MCmcTwYmJgER8UKA56ZeiLEvH0lZVfq4r1Q9FJDx3hSqHFfVV cdF+xUutRZlK83XxrwxlR165AcmV3ycZH9lKCDkInV021tXS/6QItALaayAdaf0KPxGd kku0H6olSVdfFiUq01Lly+my+AaSOkIJJ51Xm6s1jzONF6tNwuNpUzyBwNDE1K/uj1qD knBzoTTVOEDEj3TfmEZ30cInDdSnw7Nue2SYcVHnEd6dIBDcEItqUUZc/FsuTXX1GKPk d8OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685126909; x=1687718909; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=pr0CfxQy0sGUiXzLTyaj373l3U9KzezGvaWkoYzA3QE=; b=hXRjzujkQ200asYl1DpfMaN+bfX/OxOFV5DDaU1NVH0RgubIz0tRbgOJjOvf1Kwyvg UOs66Abrb16/aYV4DHeaWryJr1OVe7foXg1ecnRhg/KsBoth24iAVK9ZinU5QET6BsUS axAmNyrraU2QqPsF63ZZLzhmpkuhgQwx5eMjq0CQxUziHz6hDiiPKRUmhrt8Jl+6Mt+K ytj/MmXbw2Ln8t9TFKkGI4A+ta0exU+Euzk3QiDVvrhqx5TkDySBMIO0eBi1/frjUauD ZGO2IO/xNFQ+zgCctvT1WugE6VIHTfjEQloJI+VxZhDIxfiT9eGhDC5Z+yvGQzoJQorz MbGQ== X-Gm-Message-State: AC+VfDwkXifalteo4+zjRYw++0uXfv6EVZciAjpuuwj0grm1C+4LTSN7 qyhKLymIIGHtlWf5T44q6Sp69s4zrGS6cnry X-Google-Smtp-Source: ACHHUZ6077spJQTaPUlSVLjSqG56tK6rDRYM2ZgXdtOqglWP3smaalqlaryzjjW08qQlk4ow1hxNRPpHBCuDcQbo X-Received: from ericchancf.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:4139]) (user=ericchancf job=sendgmr) by 2002:a05:6902:1826:b0:bac:bae6:b363 with SMTP id cf38-20020a056902182600b00bacbae6b363mr1450617ybb.3.1685126909551; Fri, 26 May 2023 11:48:29 -0700 (PDT) Date: Fri, 26 May 2023 18:48:23 +0000 Mime-Version: 1.0 X-Mailer: git-send-email 2.41.0.rc0.172.g3f132b7071-goog Message-ID: <20230526184823.1230974-1-ericchancf@google.com> Subject: [PATCH] arm64: Fix 'lock held when returning to user space' lockdep warning From: Eric Chan To: Catalin Marinas , Will Deacon Cc: Mark Rutland , "Paul E . McKenney" , Mark Brown , Frederic Weisbecker , Mukesh Ojha , Josh Poimboeuf , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Eric Chan X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230526_114831_201048_314E127E X-CRM114-Status: GOOD ( 11.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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The arm64 architecture lacks support for CONFIG_GENERIC_ENTRY, resulting in the failure to report the lockdep warning "lock held when returning to user space" when lockdep is enabled. Rename the function to align with exit_to_user_mode_prepare in kernel/entry/common.c to improve readability. Signed-off-by: Eric Chan --- arch/arm64/kernel/entry-common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/entry-common.c b/arch/arm64/kernel/entry-common.c index 3af3c01c93a6..9d6827201b6c 100644 --- a/arch/arm64/kernel/entry-common.c +++ b/arch/arm64/kernel/entry-common.c @@ -126,7 +126,7 @@ static __always_inline void __exit_to_user_mode(void) lockdep_hardirqs_on(CALLER_ADDR0); } -static __always_inline void prepare_exit_to_user_mode(struct pt_regs *regs) +static __always_inline void exit_to_user_mode_prepare(struct pt_regs *regs) { unsigned long flags; @@ -135,11 +135,13 @@ static __always_inline void prepare_exit_to_user_mode(struct pt_regs *regs) flags = read_thread_flags(); if (unlikely(flags & _TIF_WORK_MASK)) do_notify_resume(regs, flags); + + lockdep_sys_exit(); } static __always_inline void exit_to_user_mode(struct pt_regs *regs) { - prepare_exit_to_user_mode(regs); + exit_to_user_mode_prepare(regs); mte_check_tfsr_exit(); __exit_to_user_mode(); } -- 2.41.0.rc0.172.g3f132b7071-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel