From owner-svn-src-all@freebsd.org Fri Jun 8 16:08:05 2018 Return-Path: Delivered-To: svn-src-all@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 40028101EB71; Fri, 8 Jun 2018 16:08:05 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from smtp.freebsd.org (unknown [IPv6:2610:1c1:1:606c::24b:4]) (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 E58DA69172; Fri, 8 Jun 2018 16:08:04 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com [209.85.214.53]) (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 AAB5D192B6; Fri, 8 Jun 2018 16:08:04 +0000 (UTC) (envelope-from mmacy@freebsd.org) Received: by mail-it0-f53.google.com with SMTP id m194-v6so2995674itg.2; Fri, 08 Jun 2018 09:08:04 -0700 (PDT) X-Gm-Message-State: APt69E1PT1qQl8nz/w49lRaOKxCAoS//c6n9CDqRrwof8mH6PZjKhNVO +V7NiPb5HLdhtgzL7y1/VqSu/Avr+tftQjBKu8c= X-Google-Smtp-Source: ADUXVKIPcBglRawfAjSe1Rt621cz+sw2zZlHLdV1ugSBI6w19lk5UTEVWneTI20Q/vrHJCIR7bma1fk3UhhqTaWH3S0= X-Received: by 2002:a24:459f:: with SMTP id c31-v6mr2248977itd.132.1528474084173; Fri, 08 Jun 2018 09:08:04 -0700 (PDT) MIME-Version: 1.0 References: <201806080458.w584w3rn006318@repo.freebsd.org> <20180608143448.GB57885@pesky> In-Reply-To: <20180608143448.GB57885@pesky> From: Matthew Macy Date: Fri, 8 Jun 2018 09:07:53 -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: src-committers@freebsd.org, 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-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Jun 2018 16:08:05 -0000 On Fri, Jun 8, 2018 at 07:35 Mark Johnston wrote: > 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? > We talked about this online. How would that help without engaging in a huge diversion in to the toolchain? There is nothing wrong with the C code so I resorted to a voodoo fix to get hwpmc working again. If you're volunteering mjg or I or you can disassemble the code prior to my change. > -M > > > > > 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. >