geopm
3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
|
#include <MSRIO.hpp>
Public Types | |
enum | m_driver_e { M_DRIVER_MSRSAFE , M_DRIVER_MSR , M_NUM_DRIVER } |
Public Member Functions | |
MSRIO ()=default | |
virtual | ~MSRIO ()=default |
virtual uint64_t | read_msr (int cpu_idx, uint64_t offset)=0 |
Read from a single MSR on a CPU. More... | |
virtual void | write_msr (int cpu_idx, uint64_t offset, uint64_t raw_value, uint64_t write_mask)=0 |
Write to a single MSR on a CPU. More... | |
virtual int | create_batch_context (void)=0 |
Add a new batch context to the set of managed contexts. More... | |
virtual int | add_read (int cpu_idx, uint64_t offset)=0 |
Extend the set of MSRs for batch read with a single offset. Note: uses the default batch context. More... | |
virtual int | add_read (int cpu_idx, uint64_t offset, int batch_ctx)=0 |
Extend the set of MSRs for batch read with a single offset. More... | |
virtual void | read_batch (void)=0 |
Batch read a set of MSRs configured by a previous call to the batch_config() method. The memory used to store the result should have been returned by add_read(). Note: uses the default batch context. More... | |
virtual void | read_batch (int batch_ctx)=0 |
Batch read a set of MSRs configured by a previous call to the batch_config() method. The memory used to store the result should have been returned by add_read(). More... | |
virtual int | add_write (int cpu_idx, uint64_t offset)=0 |
Add another offset to the list of MSRs to be written in batch. Note: uses the default batch context. More... | |
virtual int | add_write (int cpu_idx, uint64_t offset, int batch_ctx)=0 |
Add another offset to the list of MSRs to be written in batch. More... | |
virtual void | adjust (int batch_idx, uint64_t value, uint64_t write_mask)=0 |
Adjust a value that was previously added with the add_write() method. Note: uses the default batch context. More... | |
virtual void | adjust (int batch_idx, uint64_t value, uint64_t write_mask, int batch_ctx)=0 |
Adjust a value that was previously added with the add_write() method. More... | |
virtual uint64_t | sample (int batch_idx) const =0 |
Read the full 64-bit value of the MSR that was previously added to the MSRIO with add_read(). read_batch() must be called prior to calling this function. Note: uses the default batch context. More... | |
virtual uint64_t | sample (int batch_idx, int batch_ctx) const =0 |
Read the full 64-bit value of the MSR that was previously added to the MSRIO with add_read(). read_batch() must be called prior to calling this function. More... | |
virtual void | write_batch (void)=0 |
Write all adjusted values. Note: uses the default batch context. More... | |
virtual void | write_batch (int batch_ctx)=0 |
Write all adjusted values. More... | |
virtual uint64_t | system_write_mask (uint64_t offset)=0 |
Return the system write mask for a given offset. More... | |
Static Public Member Functions | |
static std::unique_ptr< MSRIO > | make_unique (int driver_type) |
Returns a unique_ptr to a concrete object constructed using the underlying implementation. More... | |
|
default |
|
virtualdefault |
|
pure virtual |
Extend the set of MSRs for batch read with a single offset. Note: uses the default batch context.
[in] | cpu_idx | logical Linux CPU index to read from when read_batch() method is called. |
[in] | offset | MSR offset to be read when read_batch() is called. |
Implemented in geopm::MSRIOImp.
|
pure virtual |
Extend the set of MSRs for batch read with a single offset.
[in] | cpu_idx | logical Linux CPU index to read from when read_batch() method is called. |
[in] | offset | MSR offset to be read when read_batch() is called. |
[in] | batch_ctx | batch context index where the read will be added. |
Implemented in geopm::MSRIOImp.
|
pure virtual |
Add another offset to the list of MSRs to be written in batch. Note: uses the default batch context.
[in] | cpu_idx | logical Linux CPU index to write to when write_batch() method is called. |
[in] | offset | MSR offset to be written when write_batch() method is called. |
Implemented in geopm::MSRIOImp.
|
pure virtual |
Add another offset to the list of MSRs to be written in batch.
[in] | cpu_idx | logical Linux CPU index to write to when write_batch() method is called. |
[in] | offset | MSR offset to be written when write_batch() method is called. |
[in] | batch_ctx | batch context index where the write will be added. |
Implemented in geopm::MSRIOImp.
|
pure virtual |
Adjust a value that was previously added with the add_write() method. Note: uses the default batch context.
Implemented in geopm::MSRIOImp.
|
pure virtual |
Adjust a value that was previously added with the add_write() method.
[in] | batch_ctx | index of batch context where value will be adjusted. |
Implemented in geopm::MSRIOImp.
|
pure virtual |
Add a new batch context to the set of managed contexts.
Implemented in geopm::MSRIOImp.
|
static |
Returns a unique_ptr to a concrete object constructed using the underlying implementation.
|
pure virtual |
Batch read a set of MSRs configured by a previous call to the batch_config() method. The memory used to store the result should have been returned by add_read().
[in] | batch_ctx | index for batch context to use for the read. |
Implemented in geopm::MSRIOImp.
|
pure virtual |
Batch read a set of MSRs configured by a previous call to the batch_config() method. The memory used to store the result should have been returned by add_read(). Note: uses the default batch context.
Implemented in geopm::MSRIOImp.
|
pure virtual |
Read from a single MSR on a CPU.
[in] cpu_idx logical Linux CPU index to read from.
[in] | offset | The MSR offset to read from. |
Implemented in geopm::MSRIOImp.
|
pure virtual |
Read the full 64-bit value of the MSR that was previously added to the MSRIO with add_read(). read_batch() must be called prior to calling this function. Note: uses the default batch context.
Implemented in geopm::MSRIOImp.
|
pure virtual |
Read the full 64-bit value of the MSR that was previously added to the MSRIO with add_read(). read_batch() must be called prior to calling this function.
[in] | batch_ctx | index of batch context from which the value will be read. |
Implemented in geopm::MSRIOImp.
|
pure virtual |
Return the system write mask for a given offset.
[in] | offset | MSR offset to query |
Implemented in geopm::MSRIOImp.
|
pure virtual |
Write all adjusted values.
[in] | batch_ctx | index for batch context to use for the write. |
Implemented in geopm::MSRIOImp.
|
pure virtual |
Write all adjusted values. Note: uses the default batch context.
Implemented in geopm::MSRIOImp.
|
pure virtual |
Write to a single MSR on a CPU.
[in] | cpu_idx | logical Linux CPU index to write to. |
[in] | offset | The MSR offset to write to. |
[in] | raw_value | The raw encoded MSR value to write, only bits where the write_mask is set will be written, other bits in the MSR will be unmodified. |
[in] | write_mask | The mask determines the bits of the MSR that will be modified. An error will occur if bits are set in the raw_value that are not in the write mask. |
Implemented in geopm::MSRIOImp.