lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 11 Mar 2010 10:32:55 +0800
From:	Lin Ming <ming.m.lin@...el.com>
To:	Cyrill Gorcunov <gorcunov@...nvz.org>
Cc:	Ingo Molnar <mingo@...e.hu>, "H. Peter Anvin" <hpa@...or.com>,
	Thomas Gleixner <tglx@...utronix.de>,
	Peter Zijlstra <peterz@...radead.org>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Stephane Eranian <eranian@...gle.com>,
	Robert Richter <robert.richter@....com>,
	Frederic Weisbecker <fweisbec@...il.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] x86,perf: Implement minimal P4 PMU driver v14

On Thu, 2010-03-11 at 02:31 +0800, Cyrill Gorcunov wrote:
> +static __initconst struct x86_pmu p4_pmu = {
> +       .name                   = "Netburst P4/Xeon",
> +       .handle_irq             = p4_pmu_handle_irq,
> +       .disable_all            = p4_pmu_disable_all,
> +       .enable_all             = p4_pmu_enable_all,
> +       .enable                 = p4_pmu_enable_event,
> +       .disable                = p4_pmu_disable_event,
> +       .eventsel               = MSR_P4_BPU_CCCR0,
> +       .perfctr                = MSR_P4_BPU_PERFCTR0,
> +       .event_map              = p4_pmu_event_map,
> +       .raw_event              = p4_pmu_raw_event,
> +       .max_events             = ARRAY_SIZE(p4_event_map),
> +       /*
> +        * IF HT disabled we may need to use all
> +        * ARCH_P4_MAX_CCCR counters simulaneously
> +        * though leave it restricted at moment assuming
> +        * HT is on
> +        */
> +       .num_events             = ARCH_P4_MAX_CCCR,
> +       .apic                   = 1,
> +       .event_bits             = 40,
> +       .event_mask             = (1ULL << 40) - 1,
> +       .max_period             = (1ULL << 39) - 1,
> +       .hw_config              = p4_hw_config,
> +       .schedule_events        = p4_pmu_schedule_events,
> +};

commit ca03770(perf, x86: Add PEBS infrastructure) introduces a new
function validate_event that calls x86_pmu.get_event_constraints.

static int validate_event(struct perf_event *event)
{
	...
	c = x86_pmu.get_event_constraints(fake_cpuc, event);
	...
}

So we need to add .get_event_constraints to p4_pmu.

diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c
index 4eb79b1..99a2a7c 100644
--- a/arch/x86/kernel/cpu/perf_event_p4.c
+++ b/arch/x86/kernel/cpu/perf_event_p4.c
@@ -586,6 +586,7 @@ static __initconst struct x86_pmu p4_pmu = {
 	.max_period		= (1ULL << 39) - 1,
 	.hw_config		= p4_hw_config,
 	.schedule_events	= p4_pmu_schedule_events,
+	.get_event_constraints  = x86_get_event_constraints,
 };
 
 static __init int p4_pmu_init(void)

---
Lin Ming


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ