mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Nathan Chancellor <nathan@kernel.org>,
	Frederic Weisbecker <frederic@kernel.org>,
	Sami Tolvanen <samitolvanen@google.com>,
	Kees Cook <keescook@chromium.org>,
	llvm@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-next@vger.kernel.org
Subject: Re: Contextual conflict between kspp and rcu trees
Date: Wed, 15 Jun 2022 18:26:29 -0700	[thread overview]
Message-ID: <20220616012629.GL1790663@paulmck-ThinkPad-P17-Gen-1> (raw)
In-Reply-To: <20220616091634.55ebbdb0@canb.auug.org.au>

On Thu, Jun 16, 2022 at 09:16:34AM +1000, Stephen Rothwell wrote:
> Hi Nathan,
> 
> On Wed, 15 Jun 2022 12:55:53 -0700 Nathan Chancellor <nathan@kernel.org> wrote:
> >
> > There is a contextual conflict between commit e1d337335207 ("cfi: Fix
> > __cfi_slowpath_diag RCU usage with cpuidle") in the kspp tree and commit
> > dcc0c11aa87b ("rcu/context-tracking: Remove rcu_irq_enter/exit()") in
> > the rcu tree, which is visible when building ARCH=arm64 defconfig +
> > CONFIG_LTO_CLANG_THIN=y + CONFIG_CFI_CLANG=y with clang:
> > 
> >   kernel/cfi.c:298:3: error: call to undeclared function 'rcu_irq_enter'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
> >                   rcu_irq_enter();
> >                   ^
> >   kernel/cfi.c:298:3: note: did you mean 'ct_irq_enter'?
> >   ./include/linux/context_tracking_irq.h:6:6: note: 'ct_irq_enter' declared here
> >   void ct_irq_enter(void);
> >        ^
> >   kernel/cfi.c:307:3: error: call to undeclared function 'rcu_irq_exit'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
> >                   rcu_irq_exit();
> >                   ^
> >   kernel/cfi.c:307:3: note: did you mean 'ct_irq_exit'?
> >   ./include/linux/context_tracking_irq.h:7:6: note: 'ct_irq_exit' declared here
> >   void ct_irq_exit(void);
> >        ^
> >   2 errors generated.
> > 
> > 
> > Per the above RCU commit and commit 6c5218715286 ("context_tracking:
> > Take IRQ eqs entrypoints over RCU"), it appears that the following diff
> > is the proper fix up. Would you mind applying it to the merge of
> > whichever tree comes second if possible? I did build and boot test it
> > but it would not be a bad idea for Sami and Frederic to verify that it
> > is correct so that Kees/Paul can mention it to Linus :)
> > 
> > Cheers,
> > Nathan
> > 
> > diff --git a/kernel/cfi.c b/kernel/cfi.c
> > index 08102d19ec15..2046276ee234 100644
> > --- a/kernel/cfi.c
> > +++ b/kernel/cfi.c
> > @@ -295,7 +295,7 @@ static inline cfi_check_fn find_check_fn(unsigned long ptr)
> >  	rcu_idle = !rcu_is_watching();
> >  	if (rcu_idle) {
> >  		local_irq_save(flags);
> > -		rcu_irq_enter();
> > +		ct_irq_enter();
> >  	}
> >  
> >  	if (IS_ENABLED(CONFIG_CFI_CLANG_SHADOW))
> > @@ -304,7 +304,7 @@ static inline cfi_check_fn find_check_fn(unsigned long ptr)
> >  		fn = find_module_check_fn(ptr);
> >  
> >  	if (rcu_idle) {
> > -		rcu_irq_exit();
> > +		ct_irq_exit();
> >  		local_irq_restore(flags);
> >  	}
> >  
> 
> I will apply that to the merge of the rcu tree today (unless Paul finds
> time to update (and test :-) ) the rcu tree before I get to it) as the
> CFI fix is now in Linus' tree.

Please!

In theory, I could rebase -rcu to linus/master now, but in practice the
odds of it producing something useful are all too low.  I will take care
of it tomorrow (Thursday) morning, Pacific Time.

							Thanx, Paul

  reply	other threads:[~2022-06-16  1:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 19:55 Nathan Chancellor
2022-06-15 20:25 ` Kees Cook
2022-06-15 20:28 ` Kees Cook
2022-06-15 20:34   ` Paul E. McKenney
2022-06-15 20:35   ` Nathan Chancellor
2022-06-15 21:12     ` Paul E. McKenney
2022-06-15 23:09       ` Stephen Rothwell
2022-06-15 20:30 ` Paul E. McKenney
2022-06-15 23:16 ` Stephen Rothwell
2022-06-16  1:26   ` Paul E. McKenney [this message]
2022-06-16  1:40     ` Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220616012629.GL1790663@paulmck-ThinkPad-P17-Gen-1 \
    --to=paulmck@kernel.org \
    --cc=frederic@kernel.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=samitolvanen@google.com \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®