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>] [day] [month] [year] [list]
Date: Thu, 16 May 2024 23:42:36 +0200
From: Marco Cavenati <cavenati.marco@...il.com>
To: peterz@...radead.org,
	mingo@...hat.com,
	acme@...nel.org
Cc: vincenzo.mezzela@...il.com,
	linux-perf-users@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	Marco Cavenati <cavenati.marco@...il.com>
Subject: [PATCH] perf/x86/intel/pt: Fix outdated and add docs

This patch adds docs for the TOPA_SHIFT constatnt and for the sizes
function, removes two outdated parameters from the documentation of the
struct pt_buffer and renames the constant PT_FILTERS_NUM to
PT_FILTERS_MAX_NUM making clearer that the number of filters can be lower
since it depends on the CPU as specified in Intel's SDM.

Signed-off-by: Marco Cavenati <cavenati.marco@...il.com>
---
 arch/x86/events/intel/pt.h | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/arch/x86/events/intel/pt.h b/arch/x86/events/intel/pt.h
index 96906a62aacd..fd5d9095997b 100644
--- a/arch/x86/events/intel/pt.h
+++ b/arch/x86/events/intel/pt.h
@@ -17,8 +17,18 @@
  */
 #define TOPA_PMI_MARGIN 512
 
+/*
+ * Shift for 4K-aligned values
+ */
 #define TOPA_SHIFT 12
 
+/**
+ * sizes() - compute output buffer size in bytes from ToPA entry encoded size
+ *
+ * @tsz:	encoded ToPA entry size
+ *
+ * Return:	size in bytes
+ */
 static inline unsigned int sizes(unsigned int tsz)
 {
 	return 1 << (tsz + TOPA_SHIFT);
@@ -61,7 +71,6 @@ struct pt_pmu {
  * @cur_idx:	current output region's index within @cur table
  * @output_off:	offset within the current output region
  * @data_size:	running total of the amount of data in this buffer
- * @lost:	if data was lost/truncated
  * @head:	logical write offset inside the buffer
  * @snapshot:	if this is for a snapshot/overwrite counter
  * @single:	use Single Range Output instead of ToPA
@@ -70,7 +79,6 @@ struct pt_pmu {
  * @stop_te:	STOP topa entry pointer
  * @intr_te:	INT topa entry pointer
  * @data_pages:	array of pages from perf
- * @topa_index:	table of topa entries indexed by page offset
  */
 struct pt_buffer {
 	struct list_head	tables;
@@ -87,7 +95,7 @@ struct pt_buffer {
 	void			**data_pages;
 };
 
-#define PT_FILTERS_NUM	4
+#define PT_FILTERS_MAX_NUM	4
 
 /**
  * struct pt_filter - IP range filter configuration
@@ -107,7 +115,7 @@ struct pt_filter {
  * @nr_filters:	number of defined filters in the @filter array
  */
 struct pt_filters {
-	struct pt_filter	filter[PT_FILTERS_NUM];
+	struct pt_filter	filter[PT_FILTERS_MAX_NUM];
 	unsigned int		nr_filters;
 };
 
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ