public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Lin Ming <ming.m.lin@intel.com>,
	Peter Zijlstra <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86,perf: Unmask LVTPC only if we have APIC supported
Date: Sat, 13 Mar 2010 13:40:36 +0100	[thread overview]
Message-ID: <20100313124036.GA17769@elte.hu> (raw)
In-Reply-To: <20100313123256.GC5179@lenovo>


* Cyrill Gorcunov <gorcunov@gmail.com> wrote:

> On Sat, Mar 13, 2010 at 01:24:32PM +0100, Ingo Molnar wrote:
> > 
> > * Cyrill Gorcunov <gorcunov@openvz.org> wrote:
> > 
> > > Ingo reported
> > > |
> > > | There's a build failure on -tip with the P4 driver, on UP 32-bit, if
> > > | PERF_EVENTS is enabled but UP_APIC is disabled:
> > > |
> > > | arch/x86/built-in.o: In function `p4_pmu_handle_irq':
> > > | perf_event.c:(.text+0xa756): undefined reference to `apic'
> > > | perf_event.c:(.text+0xa76e): undefined reference to `apic'
> > > |
> > > 
> > > So we have to unmask LVTPC only if we're configured to have one.
> > > 
> > > Reported-by: Ingo Molnar <mingo@elte.hu>
> > > CC: Lin Ming <ming.m.lin@intel.com>
> > > CC: Peter Zijlstra <peterz@infradead.org>
> > > Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
> > > ---
> > >  arch/x86/kernel/cpu/perf_event_p4.c |    2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > Index: linux-2.6.git/arch/x86/kernel/cpu/perf_event_p4.c
> > > =====================================================================
> > > --- linux-2.6.git.orig/arch/x86/kernel/cpu/perf_event_p4.c
> > > +++ linux-2.6.git/arch/x86/kernel/cpu/perf_event_p4.c
> > > @@ -365,8 +365,10 @@ static int p4_pmu_handle_irq(struct pt_r
> > >  	}
> > >  
> > >  	if (handled) {
> > > +#ifdef CONFIG_X86_LOCAL_APIC
> > >  		/* p4 quirk: unmask it again */
> > >  		apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED);
> > > +#endif
> > >  		inc_irq_stat(apic_perf_irqs);
> > 
> > This ugly #ifdef looks like a workaround though. Why doesnt apic_write() map 
> > to nothing in that case?
> > 
> > 	Ingo
> > 
> 
> It is. I mean -- it maps to nothing if apic is disabled. But the scenario is 
> that no apic configured at all. Actually I wonder how this code is supposed 
> to work without apic support.
> 
> Pehpaps better to make a p4 quirk helper here, since #ifdef at this point 
> looks ugly indeed.
> 
> Don't apply it then. Will back with other solution.

apic_write() is really just equivalent to a spin_lock() on UP without 
UP_IOAPIC set - it should do nothing. So if it does something and fails the 
build, then that should be fixed - not the P4 PMU code.

	Ingo

  reply	other threads:[~2010-03-13 12:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-13  8:11 [PATCH] x86,perf: Unmask LVTPC only if we have APIC supported Cyrill Gorcunov
2010-03-13 12:24 ` Ingo Molnar
2010-03-13 12:32   ` Cyrill Gorcunov
2010-03-13 12:40     ` Ingo Molnar [this message]
2010-03-13 12:42       ` Ingo Molnar
2010-03-13 13:42       ` Cyrill Gorcunov
2010-03-13 13:50         ` Ingo Molnar
2010-03-13 14:08           ` Cyrill Gorcunov
2010-03-13 15:03           ` Cyrill Gorcunov
2010-03-13 16:21 ` [tip:perf/core] x86, perf: " tip-bot for Cyrill Gorcunov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100313124036.GA17769@elte.hu \
    --to=mingo@elte.hu \
    --cc=gorcunov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ming.m.lin@intel.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox