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-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1108031200390.703@cl320.eecs.utk.edu>
Date:	Wed, 3 Aug 2011 12:05:54 -0400
From:	Vince Weaver <vweaver1@...s.utk.edu>
To:	<linux-kernel@...r.kernel.org>
CC:	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Paul Mackerras <paulus@...ba.org>, Ingo Molnar <mingo@...e.hu>,
	Arnaldo Carvalho de Melo <acme@...stprotocols.net>
Subject: [perf] enable raw OFFCORE_EVENTS for non-perf userspace

Hello

I propose we just enable raw OFFCORE_EVENT support and get it over with.

There is a lot of demand for this from PAPI users, and so we encourage 
them to apply the below patch.  PAPI supports this out of the box.

The current "block" against using this feature *DOES NOT WORK*.
It silently fails if you try to use the config1 field to set it.

Even worse, if some previous user has set the OFFCORE_RSP_0 msr
(say by running "perf stat -e LLC-load-misses") then
the msr *stays set* and if you try to set the config1 field on your own
it looks like it worked, but instead it is using whatever value the
kernel last used.

So there's a lot of userspace confusion about this, and you can't even 
reliably tell if the feature is turned off or not because it fails 
silently in unpredictable ways.

Thanks

Vince
vweaver1@...s.utk.edu

diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 4ee3abf..28f9ca9 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -604,12 +604,8 @@ static int x86_setup_perfctr(struct perf_event *event)
 			return -EOPNOTSUPP;
 	}
 
-	/*
-	 * Do not allow config1 (extended registers) to propagate,
-	 * there's no sane user-space generalization yet:
-	 */
 	if (attr->type == PERF_TYPE_RAW)
-		return 0;
+		return x86_pmu_extra_regs(event->attr.config, event);
 
 	if (attr->type == PERF_TYPE_HW_CACHE)
 		return set_ext_hw_attr(hwc, event);

--
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