From owner-svn-src-head@freebsd.org Sat Jun 9 18:05:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49CB4101AB45; Sat, 9 Jun 2018 18:05:40 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E9FA16A2BC; Sat, 9 Jun 2018 18:05:39 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-io0-f178.google.com (mail-io0-f178.google.com [209.85.223.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: mmacy) by smtp.freebsd.org (Postfix) with ESMTPSA id B10DE230CA; Sat, 9 Jun 2018 18:05:39 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-io0-f178.google.com with SMTP id r24-v6so19428909ioh.9; Sat, 09 Jun 2018 11:05:39 -0700 (PDT) X-Gm-Message-State: APt69E36eyzjq+tp8VlJqyZc3O0yRlwmQVnQyiqbC/ZZyFeGR2LZnY7Z z6BGa559Pj+htR21p9E4j6gMaIbxnbEPD3KM+hs= X-Google-Smtp-Source: ADUXVKLfgit2ErbwuA8BaA4be1nLO5QyT+5AbkuuxeUEBBWewA5pLT5eaFGCOAMDEoZeAo3cMP6+Izc/N10qq4j9jzo= X-Received: by 2002:a6b:9654:: with SMTP id y81-v6mr9006340iod.237.1528567539070; Sat, 09 Jun 2018 11:05:39 -0700 (PDT) MIME-Version: 1.0 References: <201806080458.w584w3rn006318@repo.freebsd.org> <20180608143448.GB57885@pesky> <20180608162701.GA65388@pesky> <20180609175104.GC1394@pesky> In-Reply-To: <20180609175104.GC1394@pesky> From: Matthew Macy Date: Sat, 9 Jun 2018 11:05:28 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334827 - in head/sys: amd64/amd64 arm/arm dev/hwpmc i386/i386 kern mips/atheros mips/cavium powerpc/powerpc sys To: Mark Johnston Cc: John Baldwin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 18:05:40 -0000 On Sat, Jun 9, 2018 at 10:51 Mark Johnston 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