From owner-svn-src-head@freebsd.org Fri Jun 8 14:35: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 789F9101C5A6; Fri, 8 Jun 2018 14:35:08 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x22d.google.com (mail-qt0-x22d.google.com [IPv6:2607:f8b0:400d:c0d::22d]) (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 1144484ADE; Fri, 8 Jun 2018 14:35:08 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x22d.google.com with SMTP id q13-v6so13627783qtp.4; Fri, 08 Jun 2018 07:35: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=BbkCeOMV1FKAS9R5BSREX2yNyQm0aeIwgCsYsjfBVJ4=; b=J5P2Xi6KP4tbwM35lYl14ggiTltH7xPn2jzjMEUYbBZQ+K4QcS4RDAi/q5X808oP8h 2AOya3y+eEKlvzWDxCVTqnGQI1p6RJhvJOzzUGxE9i78J5VomLUCvyVGkp8rxpq/bz1O ApsSHy3KSObjSaGX70uWTK/Ap1STy+kFZkxJEcymMCfeoF/lCoty2goVHG058+CCB6p/ JXdbXbYpfVnKcR7obQxzUVxgU5eh57tHZ9LJ/B3o/zsZbsAnb314GcssL13brX9kz0Ph Tfymvg9hRIi7NxmKQjdn6nEjReOAc5oWC00hDrr9MQl3IU9U5enJcvja6Keh4QDfZ6G4 r5GA== 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=BbkCeOMV1FKAS9R5BSREX2yNyQm0aeIwgCsYsjfBVJ4=; b=mhCR1NU/O/z1vit4Lacm8xoOCXblAUZji1vt6ZyKd3Cd50vQvIGMbhZ3ojiK6pnKDS rBFc0jSj4fQ1ouCbcMCcjM9gp93rgEevUwO7gnDee4kJjcnf0csMBmf/tyUEHf7acPfa 8oF44AVRBqlamFEiu/BlLVWfC0TpamtkS1/C6jrwrboAJdIR3+AObjTuxbZwlhv4oKjZ xSERVf0t/6h4NZz19wctwtIzuVrf8SLAVEmc9wlRyi7dTw+no/I2UCiXJPCmkmqigTiT 229XnfDSMAxSsV/UCXJfv+Fi++UTp1WNFbXiVa5Y9xXQgMjY6A4gimRrMaHffQxkVXge dUXg== X-Gm-Message-State: APt69E08FCQhFv0YQOaClJdxw0jIkyeavFgWwipgj7J1BI+OC4Zkshxw 5H18FxsYne14VMhT6almO8HJHw== X-Google-Smtp-Source: ADUXVKLHENzie8RgtS388NKukewQvg5FgRgsYgg6UPGmd05I3h6WPGTPOeLt1FvxXiS4Kzmr9r8UhQ== X-Received: by 2002:ac8:65d1:: with SMTP id t17-v6mr6273732qto.347.1528468507356; Fri, 08 Jun 2018 07:35:07 -0700 (PDT) Received: from pesky ([137.122.64.159]) by smtp.gmail.com with ESMTPSA id l25-v6sm11956761qkk.49.2018.06.08.07.35.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 Jun 2018 07:35:06 -0700 (PDT) Sender: Mark Johnston Date: Fri, 8 Jun 2018 10:34:48 -0400 From: Mark Johnston To: Matt Macy Cc: 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: <20180608143448.GB57885@pesky> References: <201806080458.w584w3rn006318@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201806080458.w584w3rn006318@repo.freebsd.org> 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: Fri, 08 Jun 2018 14:35:08 -0000 On Fri, Jun 08, 2018 at 04:58:03AM +0000, Matt Macy wrote: > Author: mmacy > Date: Fri Jun 8 04:58:03 2018 > New Revision: 334827 > URL: https://svnweb.freebsd.org/changeset/base/334827 > > Log: > hwpmc: simplify calling convention for hwpmc interrupt handling > > pmc_process_interrupt takes 5 arguments when only 3 are needed. > cpu is always available in curcpu and inuserspace can always be > derived from the passed trapframe. > > While facially a reasonable cleanup this change was motivated > by the need to workaround a compiler bug. What is the compiler bug? Do you have disassembly of the subroutines in question? > > core2_intr(cpu, tf) -> > pmc_process_interrupt(cpu, ring, pmc, tf, inuserspace) -> > pmc_add_sample(cpu, ring, pm, tf, inuserspace) > > In the process of optimizing the tail call the tf pointer was getting > clobbered: > > (kgdb) up > at /storage/mmacy/devel/freebsd/sys/dev/hwpmc/hwpmc_mod.c:4709 > 4709 pmc_save_kernel_callchain(ps->ps_pc, > (kgdb) up > 1205 error = pmc_process_interrupt(cpu, PMC_HR, pm, tf, > > resulting in a crash in pmc_save_kernel_callchain.