Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Jun 2018 11:05:28 -0700
From:      Matthew Macy <mmacy@freebsd.org>
To:        Mark Johnston <markj@freebsd.org>
Cc:        John Baldwin <jhb@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r334827 - in head/sys: amd64/amd64 arm/arm dev/hwpmc i386/i386 kern mips/atheros mips/cavium powerpc/powerpc sys
Message-ID:  <CAPrugNo84vMBdGgD-Ur0%2BcgBFGvsyEPmt8CKQc4JBWc-EFs%2BCg@mail.gmail.com>
In-Reply-To: <20180609175104.GC1394@pesky>
References:  <201806080458.w584w3rn006318@repo.freebsd.org> <20180608143448.GB57885@pesky> <CAPrugNrHh59QmFPAxhA0OUXnNe38EWqwDF9gFs=PeMB7fbOt-w@mail.gmail.com> <20180608162701.GA65388@pesky> <CAPrugNqShOCJ6S0CEhkT-ayM2bVhZ14fBsio3Pyaiz0-qFvw8Q@mail.gmail.com> <f7d07d35-08f0-bd0f-a5c3-e80171a6481c@FreeBSD.org> <20180609175104.GC1394@pesky>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jun 9, 2018 at 10:51 Mark Johnston <markj@freebsd.org> wrote:

> On Sat, Jun 09, 2018 at 08:11:15AM -0400, John Baldwin wrote:
> > On 6/8/18 12:34 PM, Matthew Macy wrote:
> > >> The fact that our NMI handler isn't re-entrant can lead to subtle
> > >> problems. If while executing the NMI handler we hit a dtrace
> > >> probe or DDB breakpoint, the iret executed upon return to the handler
> > >> will re-enable NMIs. Then, if a second NMI arrives before the handler
> > >> for the first has returned, the trapframe will be clobbered. Did you
> > >> rule out an issue like this?
> > >
> > > No, but it happened instantly on all CPUs an a non-debug kernel 100%
> > > of the time after I changed pmc_process_interrupt earlier this week.
> > > My voodoo fix now avoids it. What you're describing sounds episodic
> > > and doesn't sound like it would be fixed / worked around by my change.
> >
> > OTOH, a compiler bug will crop up in other places.  It is best to run
> > it to ground.  Can you describe what the bug was in more detail?
> > It would probably not be hard to come up with something you can run
> > creduce against to get down to a test case.  If you do that, the
> > LLVM folks are quite helpful and able at fixing the issue which fixes
> > it in more places than just here.
>
> The bug is the rdtscp() intrinsic added in r334746 is wrong. It was just
> copied from rdtsc(), but unlike rdtsc, rdtscp clobbers rcx, which is the
> register containing the tf pointer.
>
Thanks for identifying that. Are you going to update it?

-M



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPrugNo84vMBdGgD-Ur0%2BcgBFGvsyEPmt8CKQc4JBWc-EFs%2BCg>