Re: [PATCH] kgdbts: fix hw_access_break_test

From: Greg Kroah-Hartman
Date: Wed Aug 14 2024 - 11:57:31 EST


On Wed, Aug 14, 2024 at 04:38:43PM +0100, Daniel Thompson wrote:
> On Mon, Aug 12, 2024 at 01:04:22PM -0700, Doug Anderson wrote:
> > Hi,
> >
> > On Mon, Aug 12, 2024 at 1:55 AM Florian Rommel <mail@xxxxxxxxxxxx> wrote:
> > >
> > > The test for access watchpoints (hw_access_break_test) was broken
> > > (always failed) because the compiler optimized out the write to the
> > > static helper variable (hw_break_val2), as it is never read anywhere.
> > > This resulted in the target variable (hw_break_val) not being accessed
> > > and thus the breakpoint not being triggered.
> > >
> > > Remove the helper variable (hw_break_val2), and use READ_ONCE to force
> > > reading the target variable (hw_break_val).
> > >
> > > Signed-off-by: Florian Rommel <mail@xxxxxxxxxxxx>
> > > ---
> > > drivers/misc/kgdbts.c | 4 ++--
> > > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > Reviewed-by: Douglas Anderson <dianders@xxxxxxxxxxxx>
>
> Looks good. I pushed this through kgdbtest and it likes it too. I can
> turn one of the XFAILs off (yay).
>
> Acked-by: Daniel Thompson <daniel.thompson@xxxxxxxxxx>
> Tested-by: Daniel Thompson <daniel.thompson@xxxxxxxxxx>
>
> Arnd/Greg: Are you happy to pick this up or should I take it through the kgdb
> tree? FWIW right now there are zero other patches for kgdb this cycle, although
> that could change!

I've already picked it up, thanks!

greg k-h