-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathmsr_safe.h
40 lines (33 loc) · 1.35 KB
/
msr_safe.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2011-2021 Lawrence Livermore National Security, LLC and other
// msr-safe Project Developers. See the top-level COPYRIGHT file for
// details.
//
// SPDX-License-Identifier: GPL-2.0-only
/*
* This file defines the ioctl interface for submitting a batch of MSR
* requests. This file should be distributed to a place where kernel
* module interface header files are kept for a distribution running this
* module so that user-space applications and libraries that wish to use
* the batch interface may #include this file to get the interface.
*/
#ifndef MSR_SAFE_HEADER_INCLUDE
#define MSR_SAFE_HEADER_INCLUDE
#include <linux/ioctl.h>
#include <linux/types.h>
struct msr_batch_op
{
__u16 cpu; // In: CPU to execute {rd/wr}msr instruction
__u16 isrdmsr; // In: 0=wrmsr, non-zero=rdmsr
__s32 err; // Out: set if error occurred with this operation
__u32 msr; // In: MSR Address to perform operation
__u64 msrdata; // In/Out: Input/Result to/from operation
__u64 wmask; // Out: Write mask applied to wrmsr
};
struct msr_batch_array
{
__u32 numops; // In: # of operations in operations array
__u32 version; // In: MSR_SAFE_VERSION_u32 (see msr_version.h)
struct msr_batch_op *ops; // In: Array[numops] of operations
};
#define X86_IOC_MSR_BATCH _IOWR('c', 0xA2, struct msr_batch_array)
#endif