# US 2026/0093803 A1 · Apparatus and method for fine grain user mode control for reading performance monitor counters

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2026/0093803 A1
- Document ID: US20260093803A1
- Status: Published application
- Kind: A1
- Application number: 18/900,545
- Filed: 2024-09-27
- Published: 2026-04-02
- Earliest claimed: 2024-09-27
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Andreas Kleen; Ahmad Yasin; Moshe Cohen
- Web page: https://patentgrep.com/patent/US20260093803A1

## CPC

- G06F 11/3466: {Performance evaluation by tracing or monitoring}
- G06F 21/54: by adding security routines or objects to programs
- G06F 11/3024: {where the computing system component is a central processing unit [CPU]}
- G06F 11/348: {Circuit details, i.e. tracer hardware}
- G06F 21/604: {Tools and structures for managing or administering access control systems}
- G06F 2201/865: Monitoring of software
- G06F 2201/88: Monitoring involving counting
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An apparatus for managing access to performance counters. one embodiment of a processor comprises: a plurality of cores to execute first program code at a first privilege level and second program code at a second privilege level higher than the first privilege level, a core of the plurality of cores comprising: performance monitoring circuitry including a plurality of performance counter control registers to indicate events to be counted by a corresponding plurality of performance counters; and a processor control register to store a global control value to indicate whether the first program code is permitted to read values from the corresponding plurality of performance counters; wherein each performance counter control register is to store a per-counter control value to indicate whether the first program code executed at the first privilege level is permitted to read a corresponding value from a respective performance counter, regardless of the global control value.

## Claims

### Claim 1

A processor, comprising:
a plurality of cores to execute first program code at a first privilege level and second program code at a second privilege level of higher privilege than the first privilege level,
a core of the plurality of cores comprising:
performance monitoring circuitry including a plurality of performance counter control registers to indicate events to be counted by a corresponding plurality of performance counters; and
a processor control register to store a global control value to indicate whether the first program code is permitted to read values from the corresponding plurality of performance counters;
wherein each performance counter control register is to store a per-counter control value to indicate whether the first program code executed at the first privilege level is permitted to read a corresponding value from a respective performance counter, regardless of the global control value.

### Claim 2 (depends on 1)

The processor of claim 1, wherein the performance monitoring circuitry further includes:
a plurality of fixed function performance counters to count a corresponding plurality of preconfigured events; and
a fixed counter control register to store a fixed function counter control value to indicate whether the first program code executed at the first privilege level is permitted to read a value from any of the fixed function performance counters, regardless of the global control value.

### Claim 3 (depends on 1)

The processor of claim 1, wherein the per-counter control value comprises a first binary value which, when set to 1, indicates that the first program code executed at the first privilege level is not permitted to read a value from the corresponding performance counter, regardless of the global control value.

### Claim 4 (depends on 3)

The processor of claim 3, wherein the global control value comprises a second binary value which, when set to 1, indicates that the first program code executed at the first privilege level is permitted to read the corresponding plurality of performance counters.

### Claim 5 (depends on 4)

The processor of claim 4, wherein, when the first binary value is set to 0 and the second binary value is set to 1, the first program code is permitted to read a value from the corresponding performance counter.

### Claim 6 (depends on 5)

The processor of claim 5, wherein the first program code executed at the first privilege level is to execute a Read Performance Monitor Counter (RDPMC) instruction to attempt to read the corresponding performance counter, wherein the RDPMC instruction is to return a 0 if the first binary value is set to 1 and is to return the value from the corresponding performance counter if the first binary value is set to 0 and the second binary value is set to 1.

### Claim 7 (depends on 1)

The processor of claim 1, wherein the first privilege level comprises a privilege level corresponding to user applications and the second privilege level comprises a privilege level corresponding to an operating system kernel or driver.

### Claim 8 (depends on 1)

The processor of claim 1, further comprising:
an interconnect to couple the plurality of cores to a shared cache and a memory controller, the memory controller to couple the plurality of cores to a system memory, wherein each core of the plurality of cores comprises:
fetch circuitry to fetch instructions of the program code from the system memory;
decode circuitry to decode the instructions; and
execution circuitry to execute the instructions;
wherein the plurality of performance counter control registers are to indicate that the corresponding plurality of performance counters are to count events occurring within one or more of: the interconnect, the memory controller, the fetch circuitry, the decode circuitry, and the execution circuitry.

### Claim 9

A method, comprising:
executing, on a core of a plurality of cores, first program code at a first privilege level and second program code at a second privilege level higher than the first privilege level;
indicating, in a plurality of performance counter control registers, events to be counted by a corresponding plurality of performance counters;
storing, in a processor control register, a global control value to indicate whether the first program code is permitted to read values from the corresponding plurality of performance counters; and
storing, in each performance counter control register, a per-counter control value to indicate whether the first program code executed at the first privilege level is permitted to read a corresponding value from a respective performance counter, regardless of the global control value.

### Claim 10 (depends on 9)

The method of claim 9, further comprising:
counting, by a plurality of fixed function performance counters, a plurality of preconfigured events; and
storing, in a fixed counter control register, a fixed function counter control value to indicate whether the first program code executed at the first privilege level is permitted to read a value from any of the fixed function performance counters, regardless of the global control value.

### Claim 11 (depends on 9)

The method of claim 9, wherein the per-counter control value comprises a first binary value which, when set to 1, indicates that the first program code executed at the first privilege level is not permitted to read a value from the corresponding performance counter, regardless of the global control value.

### Claim 12 (depends on 11)

The method of claim 11, wherein the global control value comprises a second binary value which, when set to 1, indicates that the first program code executed at the first privilege level is permitted to read the corresponding plurality of performance counters.

### Claim 13 (depends on 12)

The method of claim 12, wherein, when the first binary value is set to 0 and the second binary value is set to 1, the first program code is permitted to read a value from the corresponding performance counter.

### Claim 14 (depends on 13)

The method of claim 13, wherein the first program code executed at the first privilege level is to execute a Read Performance Monitor Counter (RDPMC) instruction to attempt to read the corresponding performance counter, wherein the RDPMC instruction is to return a 0 if the first binary value is set to 1 and is to return the value from the corresponding performance counter if the first binary value is set to 0 and the second binary value is set to 1.

### Claim 15 (depends on 9)

The method of claim 9, wherein the first privilege level comprises a privilege level corresponding to user applications and the second privilege level comprises a privilege level corresponding to an operating system kernel or driver.

### Claim 16

A machine-readable medium having program code stored thereon which, when executed by a machine, causes the machine to perform the operations of:
executing, on a core of a plurality of cores, first program code at a first privilege level and second program code at a second privilege level higher than the first privilege level;
indicating, in a plurality of performance counter control registers, events to be counted by a corresponding plurality of performance counters;
storing, in a processor control register, a global control value to indicate whether the first program code is permitted to read values from the corresponding plurality of performance counters; and
storing, in each performance counter control register, a per-counter control value to indicate whether the first program code executed at the first privilege level is permitted to read a corresponding value from a respective performance counter, regardless of the global control value.

### Claim 17 (depends on 16)

The machine-readable medium of claim 16, further comprising program code to cause the machine to perform the operations of:
counting, by a plurality of fixed function performance counters, a plurality of preconfigured events; and
storing, in a fixed counter control register, a fixed function counter control value to indicate whether the first program code executed at the first privilege level is permitted to read a value from any of the fixed function performance counters, regardless of the global control value.

### Claim 18 (depends on 16)

The machine-readable medium of claim 16, wherein the per-counter control value comprises a first binary value which, when set to 1, indicates that the first program code executed at the first privilege level is not permitted to read a value from the corresponding performance counter, regardless of the global control value.

### Claim 19 (depends on 18)

The machine-readable medium of claim 18, wherein the global control value comprises a second binary value which, when set to 1, indicates that the first program code executed at the first privilege level is permitted to read the corresponding plurality of performance counters.

### Claim 20 (depends on 19)

The machine-readable medium of claim 19, wherein, when the first binary value is set to 0 and the second binary value is set to 1, the first program code is permitted to read a value from the corresponding performance counter.
