From owner-svn-src-head@freebsd.org Sat Jun 9 17:51:08 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 9F9631017723; Sat, 9 Jun 2018 17:51:08 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it0-x241.google.com (mail-it0-x241.google.com [IPv6:2607:f8b0:4001:c0b::241]) (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)) by mx1.freebsd.org (Postfix) with ESMTPS id 304686867C; Sat, 9 Jun 2018 17:51:08 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it0-x241.google.com with SMTP id 16-v6so1304608itl.5; Sat, 09 Jun 2018 10:51:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/pXQ/uw67nQAi7tmUCNfw2qGydHkGc4hmrsmfE+UahQ=; b=PmR35CWMFHGzzcDShT9jHR1P07EHhG6k53dOGsudrTC+ulZncrMnV9qUaccvyPzdEX 3HQrEIWG6hfRGGqDaY33AnSqcKdGhtWTubNzbcdYp/ZOVJxMiiqdAtmNDenFMETAOJoK FhwyKsz0Al0PgRIBjZ1otV3aMheULGbB+s0IYERzVS1n7zYDsLXXEiFntotq5uo0fyZC +WqA6AIz6faiskjp+EBt3C8XztHOiVl+gm71a9cRGlz07hwoFvkzJudIUZo0Em1amWl3 FwDF9cefo2BT+QAhjkTrXUjTW4gEfgBj91advF4P0Vqy5ebZ9FIXOrhmYCIgkBs7np3/ 1sYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=/pXQ/uw67nQAi7tmUCNfw2qGydHkGc4hmrsmfE+UahQ=; b=cDmxpKlNNGDS5kETiA3kaHEBbunuI6xrCJyQDtkCIzrLETTh8CP00rPmIFmoKCdYoJ PjDyQ+mp70PAySS6nSqvL6DcTktLsH3FqS3WXI3iXzRV1KV2Aa5cbsHhp5LzY9/p1Roz bvSqNSWdQonsI0cu9Fk8fKD15nAo2EiNcUyZEk/vS95hv95QRkBPW0W6hFLpXUpE4PT+ dGHbOm0c5qrAcenpxPA7xqE8vb6G2glSZcUh97aYgkQdrYN5ZJwzdEE+SqT8sDko2pfC mB/+LhQb00uETuv5VjyO8o7EM1fzJ5aKxPdT38/3JpRjCkG2XlScqKvfpt16SN4TVtfp rZ4A== X-Gm-Message-State: APt69E3HJesfZ0yPOA0zhXPOcqZMxl/jt2NRZdkxg0/Al3+y/t7PaZCI oXTloExy48ZlyfSc9vHszZvisr/U X-Google-Smtp-Source: ADUXVKJHvs45UD1tBA3enlqEjY3opvEnvA3PfBNq+itWiPrE+rcQRCgGNqXOW6upcE3hG0UnzcMkRg== X-Received: by 2002:a24:42d2:: with SMTP id i201-v6mr1866222itb.125.1528566667280; Sat, 09 Jun 2018 10:51:07 -0700 (PDT) Received: from pesky ([137.122.64.159]) by smtp.gmail.com with ESMTPSA id z11-v6sm8165947ioc.8.2018.06.09.10.51.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Jun 2018 10:51:06 -0700 (PDT) Sender: Mark Johnston Date: Sat, 9 Jun 2018 13:51:04 -0400 From: Mark Johnston To: John Baldwin Cc: Matthew Macy , src-committers , 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: <20180609175104.GC1394@pesky> References: <201806080458.w584w3rn006318@repo.freebsd.org> <20180608143448.GB57885@pesky> <20180608162701.GA65388@pesky> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) 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 17:51:08 -0000 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.