Date: Fri, 8 Jun 2018 09:07:53 -0700 From: Matthew Macy <mmacy@freebsd.org> To: Mark Johnston <markj@freebsd.org> 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: <CAPrugNrHh59QmFPAxhA0OUXnNe38EWqwDF9gFs=PeMB7fbOt-w@mail.gmail.com> In-Reply-To: <20180608143448.GB57885@pesky> References: <201806080458.w584w3rn006318@repo.freebsd.org> <20180608143448.GB57885@pesky>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jun 8, 2018 at 07:35 Mark Johnston <markj@freebsd.org> 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. >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPrugNrHh59QmFPAxhA0OUXnNe38EWqwDF9gFs=PeMB7fbOt-w>