Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp4366439pxu; Tue, 1 Dec 2020 03:13:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxEECQAKVa8HzC/Gu68cIyAtnGaA05twcjWXBfKCpG8SUtkyIVenpuXNun2q2D0xjYCbX7B X-Received: by 2002:a50:cfcf:: with SMTP id i15mr2440442edk.351.1606821189003; Tue, 01 Dec 2020 03:13:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606821188; cv=none; d=google.com; s=arc-20160816; b=xdzgm3EVX3sMPpSxBm15lq67VM5XKlduMbKJw2Nh2LOJIGBtu2sxBX1IkmnIG3Xo+m 4YhBXET0YdDT5ryjuQWzl55Qs4sKpHU37AqRVUReYTTBst6UfJ6GtzdWp4zXZ6soTTF2 zfHaeQ0JgwwJ0+l3n7IFWghW0HWzAsllAx4WKB84pDxnxoPE0Pixn1jYKOiI6nuOSIIf c6wObFQijkuEahEFA1oAFVdnVp1438ChUwjeQWt51Vy+A+9snu+IVJzsH8BoPMzSGYI4 FkM62VgsOb4IFL5C+9pfDRnyCv/z5Vlz3s4am1aM8ibTpZArjyZOJL5oR1iOe+R9mnOv 8DVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=7yEy47MB100mmuwphhCKWZCuPQblXI1mQGNNE1xKOq8=; b=ZHYUq08QjZ6FPYCgV77c1EmvNMfkfby2NDDPsgWVAoohwVHZi3Nt0SxdOhkrJaKxD9 hikp1Z2GSoGXCQ/bclIXcnAUrvKglbYd5mwwsJBe32BQWg1aQ4iNZGHGVB3XoiHHuuMK YTRWdQFWrnYEuE0T9yw2KDSn7oAwnjAdDFPlY+t6vbDlaBhDfZbxtRM9TY7a94B1ecim BHZFbFPtyDnO4Sca1yhP392pUtYsL9pOUQFhsRexRZ/C5X2hKk2JbWsqhHHPgJ8eJvS5 +NvNwlQ6D8BGMphEyRM3ik7k0GYgNRaZ9CTapuhw3QPo1HN2qX0uFS4Atm7gZTHo2Gul pw3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=rKAVGUQU; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=G5oR9DuU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b11si934384edz.485.2020.12.01.03.12.45; Tue, 01 Dec 2020 03:13:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=rKAVGUQU; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=G5oR9DuU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729665AbgLALK1 (ORCPT + 99 others); Tue, 1 Dec 2020 06:10:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726689AbgLALK1 (ORCPT ); Tue, 1 Dec 2020 06:10:27 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1141C0613CF for ; Tue, 1 Dec 2020 03:09:46 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1606820985; 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=7yEy47MB100mmuwphhCKWZCuPQblXI1mQGNNE1xKOq8=; b=rKAVGUQUoPtmaq5HiQbmz+WO0fFpIhqot689y7zDhV7w0UB8ef9jHVoumQXH1v/9UWKDXT WGxyMRuY5KRhc0ZsLjJV+FlKG6W6hAaYlXsB/Na7C0YRduJngT6bvm9dZXSG1Bzsa7nx4a F8LSRWgvHCbQLOHW+5wRRrkXqQwfov+uWCMX2S3368n1dH6gz/lieoffaARwPa41fKhYsh 26surxBlhOMJ8EEJDQyAfU5SV0ABFr65XmL+Z4bcU44VR25uy2+IWXpNAl44P2oVPovL47 pKA1sCGJNeYC1+56rcNMdxr2GhLjaQV6G7SuKNX23cB+Uyr8D7VWRWEF/BhKrw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1606820985; 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=7yEy47MB100mmuwphhCKWZCuPQblXI1mQGNNE1xKOq8=; b=G5oR9DuUgceMKEgQEClFrOblnWhEmDUo+kkFmSGr6fz6zlvNDIMVBa42y8T6q2E+Q2SkqZ oiH5cbaLwmyB0IDQ== To: Sven Schnelle Cc: linux-kernel@vger.kernel.org, hca@linux.ibm.com, Sven Schnelle Subject: Re: [PATCH] entry: split lockdep and syscall work functions In-Reply-To: <20201201083553.50996-2-svens@linux.ibm.com> References: <20201201083553.50996-1-svens@linux.ibm.com> <20201201083553.50996-2-svens@linux.ibm.com> Date: Tue, 01 Dec 2020 12:09:45 +0100 Message-ID: <87lfehhjeu.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sven, On Tue, Dec 01 2020 at 09:35, Sven Schnelle wrote: > On s390, we can not call one function which sets lockdep > state and do the syscall work at the same time. There add > make enter_from_user_mode() and exit_to_user_mode() public, and > add syscall_exit_to_user_mode1() which does the same as > syscall_exit_to_user_mode() but skips the final exit_to_user_mode(). the explanation in the "cover letter" made at least sense, but the above is unparseable word salad. > Signed-off-by: Sven Schnelle > --- > include/linux/entry-common.h | 4 +++- > kernel/entry/common.c | 35 +++++++++++++++++++++++++++-------- > 2 files changed, 30 insertions(+), 9 deletions(-) > > diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h > index 474f29638d2c..496c9a47eab4 100644 > --- a/include/linux/entry-common.h > +++ b/include/linux/entry-common.h > @@ -124,7 +124,7 @@ static inline __must_check int arch_syscall_enter_tracehook(struct pt_regs *regs > * to be done between establishing state and handling user mode entry work. > */ > void syscall_enter_from_user_mode_prepare(struct pt_regs *regs); > - > +void enter_from_user_mode(struct pt_regs *regs); You might have noticed, that all of these function prototypes have proper kernel documentation. So just glueing this on to the previous prototype does not cut it. enter_from/exit_to_user_mode() want to go together into a seperate section. > /** > * syscall_enter_from_user_mode_work - Check and handle work before invoking > * a syscall > @@ -311,6 +311,8 @@ static inline void arch_syscall_exit_tracehook(struct pt_regs *regs, bool step) > * arch_exit_to_user_mode() to handle e.g. speculation mitigations > */ > void syscall_exit_to_user_mode(struct pt_regs *regs); > +void syscall_exit_to_user_mode1(struct pt_regs *regs); Same here and as you mentioned ...mode1() is a pretty horrible name. syscall_exit_to_user_mode_work() perhaps? > +void exit_to_user_mode(void); > > /** > * irqentry_enter_from_user_mode - Establish state before invoking the irq handler > diff --git a/kernel/entry/common.c b/kernel/entry/common.c > index e9e2df3f3f9e..3ad462ebfa15 100644 > --- a/kernel/entry/common.c > +++ b/kernel/entry/common.c > @@ -18,7 +18,7 @@ > * 2) Invoke context tracking if enabled to reactivate RCU > * 3) Trace interrupts off state > */ > -static __always_inline void enter_from_user_mode(struct pt_regs *regs) > +static __always_inline void __enter_from_user_mode(struct pt_regs > *regs) Can you please split the renaming into a seperate preparatory patch? > +__visible noinstr void syscall_exit_to_user_mode1(struct pt_regs *regs) What's the point of marking this function noinstr? Everything it does is instrumentable. Thanks, tglx