LKML Archive on lore.kernel.org
 help / color / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	stable@vger.kernel.org, linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH] perf/x86/intel: Make cpuc allocations consistent
Date: Fri, 15 Mar 2019 09:14:10 +0100
Message-ID: <20190315081410.GR5996@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <20190314211014.GA25646@roeck-us.net>

On Thu, Mar 14, 2019 at 02:10:14PM -0700, Guenter Roeck wrote:
> On Tue, Mar 05, 2019 at 10:23:15PM +0100, Peter Zijlstra (Intel) wrote:
> > The cpuc data structure allocation is different between fake and real
> > cpuc's; use the same code to init/free both.
> > 
> > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> 
> With allmodconfig-CONFIG_CPU_SUP_INTEL, this patch results in:
> 
> In file included from arch/x86/events/amd/core.c:8:0:
> arch/x86/events/amd/../perf_event.h:1036:45: warning: ‘struct cpu_hw_event’ declared inside parameter list will not be visible outside of this definition or declaration
>  static inline int intel_cpuc_prepare(struct cpu_hw_event *cpuc, int cpu)
>                                              ^~~~~~~~~~~~
> arch/x86/events/amd/../perf_event.h:1041:45: warning: ‘struct cpu_hw_event’ declared inside parameter list will not be visible outside of this definition or declaration
>  static inline void intel_cpuc_finish(struct cpu_hw_event *cpuc)
>                                              ^~~~~~~~~~~~
> 
> With -Werror, this is fatal, and I think it may be buggy (should it be
> cpu_hw_events) ?

Yep it should be. Won't result in a bug though, an unused pointer is an
unused poiner, no matter what known or unknown type it points to.

> The patch has been applied to stable releases. Any idea, anyone, why
> this is the case ? It doesn't look like a bug fix to me, and reverting
> it from v4.14.106 didn't seem to have a negative impact.

Reverting just this one patch will make your kernel go boom when you run
on a skylake or more recent Intel cpu, have updated your microcode and
do:

  echo 0 > /sys/bus/event_source/devices/cpu/allow_tsx_force_abort

And then try and create perf events. See also commit:

  400816f60c54 ("perf/x86/intel: Implement support for TSX Force Abort")

---
Subject: perf/x86: Fixup typo in stub functions

Guenter reported a build warning for CONFIG_CPU_SUP_INTEL=n. While
harmless (an unsed pointer is an unused pointer, no matter the type) it
needs fixing.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Fixes: d01b1f96a82e ("perf/x86/intel: Make cpuc allocations consistent")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 arch/x86/events/perf_event.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/events/perf_event.h b/arch/x86/events/perf_event.h
index b04ae6c8775e..a75955741c50 100644
--- a/arch/x86/events/perf_event.h
+++ b/arch/x86/events/perf_event.h
@@ -1033,12 +1033,12 @@ static inline int intel_pmu_init(void)
 	return 0;
 }
 
-static inline int intel_cpuc_prepare(struct cpu_hw_event *cpuc, int cpu)
+static inline int intel_cpuc_prepare(struct cpu_hw_events *cpuc, int cpu)
 {
 	return 0;
 }
 
-static inline void intel_cpuc_finish(struct cpu_hw_event *cpuc)
+static inline void intel_cpuc_finish(struct cpu_hw_events *cpuc)
 {
 }
 

  reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14 21:10 Guenter Roeck
2019-03-15  8:14 ` Peter Zijlstra [this message]
2019-03-15 12:16   ` [tip:perf/urgent] perf/x86: Fixup typo in stub functions tip-bot for Peter Zijlstra

Reply instructions:

You may reply publically 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=20190315081410.GR5996@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=mingo@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /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

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox