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 X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E09D7C433C1 for ; Mon, 22 Mar 2021 17:24:42 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7149C6198E for ; Mon, 22 Mar 2021 17:24:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7149C6198E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DfWuEZ3kRUs07KZH6mhbCYYWNl2kM6hC0rX98Fh7xEA=; b=Ye9RwhtoDwIgNHDKpunbWGmq+ pf2P4FJujCrm6vuApzlzN+zvlX38H7k85bhZ+udwJOwcQrZykNjp1hezCYh0ilgbhxxOnDIf1R+v+ hwm+HUK8ehmQimxFMpAHID0vg7TaFLSV+4saFcFGwYtXtGNhc3XcdXe9OGu0aCvC5lZMYzmBUKKjR Puu8FQSpyyqHxSQqIhmy4uIOH2tghIdrWa/u+WhLIJyCxJBsRHm9vC7rC/Yp7/e4RCmM+qqopkJVP 07ZXzerzTnjWp9O0e1xcIWy/WE3cDDOk+ycOXsOSipA8LSsYyZ2Bh7oBpDVDFL+JW5v2wu98o6g54 aZBtyjpbA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lOOGR-00C9as-LZ; Mon, 22 Mar 2021 17:22:52 +0000 Received: from foss.arm.com ([217.140.110.172]) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lOOGN-00C9aX-PW for linux-arm-kernel@lists.infradead.org; Mon, 22 Mar 2021 17:22:49 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 52A7A1063; Mon, 22 Mar 2021 10:22:46 -0700 (PDT) Received: from C02TD0UTHF1T.local (unknown [10.57.23.154]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 05CB23F719; Mon, 22 Mar 2021 10:22:43 -0700 (PDT) Date: Mon, 22 Mar 2021 17:22:41 +0000 From: Mark Rutland To: Russell King - ARM Linux admin Cc: Dmitry Vyukov , syzbot , Arnd Bergmann , Linux ARM , Alexandre Chartre , LKML , Masami Hiramatsu , Peter Zijlstra , syzkaller-bugs , Thomas Gleixner Subject: Re: [syzbot] upstream boot error: WARNING in __context_tracking_enter Message-ID: <20210322172241.GB80352@C02TD0UTHF1T.local> References: <0000000000004f14c105bde08f75@google.com> <20210319101043.GU1463@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210319101043.GU1463@shell.armlinux.org.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210322_172248_050597_584A0FD5 X-CRM114-Status: GOOD ( 18.24 ) 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 Hi Russell, On Fri, Mar 19, 2021 at 10:10:43AM +0000, Russell King - ARM Linux admin wrote: > On Fri, Mar 19, 2021 at 10:54:48AM +0100, Dmitry Vyukov wrote: > > .On Fri, Mar 19, 2021 at 10:44 AM syzbot > > wrote: > > > syzbot found the following issue on: > > > > > > HEAD commit: 8b12a62a Merge tag 'drm-fixes-2021-03-19' of git://anongit.. > > > git tree: upstream > > > console output: https://syzkaller.appspot.com/x/log.txt?x=17e815aed00000 > > > kernel config: https://syzkaller.appspot.com/x/.config?x=cfeed364fc353c32 > > > dashboard link: https://syzkaller.appspot.com/bug?extid=f09a12b2c77bfbbf51bd > > > userspace arch: arm > > > > > > IMPORTANT: if you fix the issue, please add the following tag to the commit: > > > Reported-by: syzbot+f09a12b2c77bfbbf51bd@syzkaller.appspotmail.com > > > > > > +Mark, arm > > It did not get far with CONFIG_CONTEXT_TRACKING_FORCE (kernel doesn't boot). > > It seems that the path: > > context_tracking_user_enter() > user_enter() > context_tracking_enter() > __context_tracking_enter() > vtime_user_enter() > > expects preemption to be disabled. It effectively is, because local > interrupts are disabled by context_tracking_enter(). > > However, the requirement for preemption to be disabled is not > documented... so shrug. Maybe someone can say what the real requirements > are here. >From dealing with this recently on arm64, theis is a bit messy. To handle this robustly we need to do a few things in sequence, including using the *_irqoff() variants of the context_tracking_user_*() functions. I wrote down the constraints in commit: 23529049c6842382 ("arm64: entry: fix non-NMI user<->kernel transitions") For user->kernel transitions, the arch code needs the following sequence before invoking arbitrary kernel C code: lockdep_hardirqs_off(CALLER_ADDR0); user_exit_irqoff(); trace_hardirqs_off_finish(); For kernel->user transitions, the arch code needs the following sequence once it will no longer invoke arbitrary kernel C code, just before returning to userspace: trace_hardirqs_on_prepare(); lockdep_hardirqs_on_prepare(CALLER_ADDR0); user_enter_irqoff(); lockdep_hardirqs_on(CALLER_ADDR0); Thanks, Mark. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel