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 0FB96C433EF for ; Wed, 1 Dec 2021 18:16:18 +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:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xP1A4JJNheCvj3wTeeP64L1pH179SX7ljAEfUsxoP5M=; b=4/NIqq5e6WZ6i4 jxfJNVFh1KijKj9EojFuI/GwkWkV9f7TI8lgWuV+iNqyrEJdQRBCyO08yHHfGoGsIAs+VkoYpLGvb y/gudt4zpsIAhH8SIsRwqO57acuhGfDTBVDG0+TuF9PcUjcmPvIb60L38twItS8cMFKmdMdgIDozc Tk/g9VFDr3wDy1VVIABoA8jb3Il+it4iG92ReEvQ5zQgIg1JKFLYEiIweptyJ6fqu93e531TfYv4l 1ntv91TvB4GIJgJ2Ws8oPgqyv+GbijKzqZDpoPZ+s+RnWqbc5mQMzYvR+LGK8/yYb9blGk3MXi+f5 SqCHEuJ+EGZ+xlWbCs2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1msU80-009iAY-LP; Wed, 01 Dec 2021 18:14:48 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1msU7w-009i9O-8X for linux-arm-kernel@lists.infradead.org; Wed, 01 Dec 2021 18:14:45 +0000 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1638382481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JZSAb6/GFXzqpAkYaa0pvVxSQ5TTrlFnUbJk4nsZrsA=; b=DvbCwi72msZcA00dJHqF3+3iW8LIiuY+HpMxUmh/hG36VK54nzgl3NHbhHgp0M1i+szj7n GxfG8XYcOhYYlWBSVILducd6aXk3m1Q0btlSojo+RDo5iS5Axgj2bE+ezh8C5lz505ensb bj1n1kW23SBs8jPxVvJo50UxMD/Blk5YVbf9pHVY4Or9jmcMn+ReWqXXEwqzfbaybN6ugr SpSWfuuC+xz4jDknr4WLRRzKwBmuid9uUr8R2cjGQTSIzidPAgI6dxPEPeLZ804fn06PTJ cNWzO1rMczXs1YBRiFfdvYS7LUm6R1JBti8Gz8UaImAbdu6tgQdFsJVzaboH6g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1638382481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JZSAb6/GFXzqpAkYaa0pvVxSQ5TTrlFnUbJk4nsZrsA=; b=BU4nDLcVS+KX4XoXWPPEHhIV6eGmxMLyHXhp7cuQ7inHdhdJVp8fjqli2rFj4wvFCjxxJt oiskv79DUnb8NzCA== To: Mark Rutland Cc: Steven Rostedt , Nicolas Saenz Julienne , linux-kernel , linux-arm-kernel , rcu@vger.kernel.org, Peter Zijlstra , paulmck@kernel.org, mtosatti , frederic , Jonathan Corbet Subject: Re: [PATCH] Documentation: Fill the gaps about entry/noinstr constraints In-Reply-To: References: <8719ad46cc29a2c5d7baac3c35770e5460ab8d5c.camel@redhat.com> <875ys9dacq.ffs@tglx> <20211130091356.7336e277@gandalf.local.home> <878rx5b7i5.ffs@tglx> Date: Wed, 01 Dec 2021 19:14:41 +0100 Message-ID: <87v9088a5q.ffs@tglx> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211201_101444_497353_72F1F34E X-CRM114-Status: GOOD ( 22.39 ) 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 Mark, On Wed, Dec 01 2021 at 10:56, Mark Rutland wrote: > On Tue, Nov 30, 2021 at 11:31:30PM +0100, Thomas Gleixner wrote: >> --- >> Documentation/core-api/entry.rst | 268 +++++++++++++++++++++++++++++++++++++++ >> Documentation/core-api/index.rst | 8 + >> kernel/entry/common.c | 1 > > I think the change to kernel/entry/common.c got included by accident? That's what I get from doing such things 30 minutes before midnight... >> + >> +Syscall entry exit code starts obviously in low level architecture specific > > As a small nit, can we remove the "obviously"? It's certainly obvious to you > and me, but it doesn't meaningfully affect the sentence either way. Indeed. >> +assembly code and calls out into C-code after establishing low level >> +architecture specific state and stack frames. This low level code must not >> +be instrumented. A typical syscall handling function invoked from low level >> +assembly code looks like this:: >> + >> + noinstr void do_syscall(struct pt_regs \*regs, int nr) > ^^ > > Is `\*` necessary here? ... and/or should this be an explicit code block (which > IIUC doesn't require this esacping), e.g. > > .. code-block:: c Right. Let me try that. > noinstr void do_syscall(struct pt_regs *regs, int nr) >> + >> +If the interrupt is raised while the CPU executes in kernel space the entry >> +and exit handling is slightly different. RCU state is only updated when the >> +interrupt was raised in context of the idle task because that's the only > > Since we have an idle task for each cpu, perhaps either: > > s/the idle task/an idle task/ > s/the idle task/the CPU's idle task/ Yes, that's more precise >> +Note, that the update of the preemption counter has to be the first >> +operation on enter and the last operation on exit. The reason is that both >> +lockdep and RCU rely on in_nmi() returning true in this case. The >> +preemption count modification in the NMI entry/exit case can obviously not >> +be traced. > > Could we say "must not" instead of "can not", e.g. > > The preemption count modification in the NMI entry/exit must not be traced. > > That way it's clearly a requirement, rather than a limitation. Yes. >> +Architecture specific code looks like this:: >> + >> + noinstr void do_nmi(struct pt_regs \*regs) >> + { >> + arch_nmi_enter(regs); >> + state = irqentry_nmi_enter(regs); >> + >> + instrumentation_begin(); >> + >> + invoke_nmi_handler(regs); >> + >> + instrumentation_end(); >> + irqentry_nmi_exit(regs); >> + } > > To keep the begin/end and enter/exit calls visually balanced, should the > instrumentation_end() call have trailing a line space, e.g. Yup. Thanks, tglx _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel