Skip to content

Commit 63ba67e

Browse files
atishp04palmer-dabbelt
authored andcommitted
RISC-V: Move counter info definition to sbi header file
Counter info encoding format is defined by the SBI specificaiton. KVM implementation of SBI PMU extension will also leverage this definition. Move the definition to common sbi header file from the sbi pmu driver. Signed-off-by: Atish Patra <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 0209b58 commit 63ba67e

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

arch/riscv/include/asm/sbi.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,20 @@ enum sbi_ext_pmu_fid {
122122
SBI_EXT_PMU_COUNTER_FW_READ,
123123
};
124124

125+
union sbi_pmu_ctr_info {
126+
unsigned long value;
127+
struct {
128+
unsigned long csr:12;
129+
unsigned long width:6;
130+
#if __riscv_xlen == 32
131+
unsigned long reserved:13;
132+
#else
133+
unsigned long reserved:45;
134+
#endif
135+
unsigned long type:1;
136+
};
137+
};
138+
125139
#define RISCV_PMU_RAW_EVENT_MASK GENMASK_ULL(55, 0)
126140
#define RISCV_PMU_RAW_EVENT_IDX 0x20000
127141

drivers/perf/riscv_pmu_sbi.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,6 @@
2121
#include <asm/sbi.h>
2222
#include <asm/hwcap.h>
2323

24-
union sbi_pmu_ctr_info {
25-
unsigned long value;
26-
struct {
27-
unsigned long csr:12;
28-
unsigned long width:6;
29-
#if __riscv_xlen == 32
30-
unsigned long reserved:13;
31-
#else
32-
unsigned long reserved:45;
33-
#endif
34-
unsigned long type:1;
35-
};
36-
};
37-
3824
/*
3925
* RISC-V doesn't have hetergenous harts yet. This need to be part of
4026
* per_cpu in case of harts with different pmu counters

0 commit comments

Comments
 (0)