cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

cmb.h (1919B)


      1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
      2#ifndef _UAPIS390_CMB_H
      3#define _UAPIS390_CMB_H
      4
      5#include <linux/types.h>
      6
      7/**
      8 * struct cmbdata - channel measurement block data for user space
      9 * @size: size of the stored data
     10 * @elapsed_time: time since last sampling
     11 * @ssch_rsch_count: number of ssch and rsch
     12 * @sample_count: number of samples
     13 * @device_connect_time: time of device connect
     14 * @function_pending_time: time of function pending
     15 * @device_disconnect_time: time of device disconnect
     16 * @control_unit_queuing_time: time of control unit queuing
     17 * @device_active_only_time: time of device active only
     18 * @device_busy_time: time of device busy (ext. format)
     19 * @initial_command_response_time: initial command response time (ext. format)
     20 *
     21 * All values are stored as 64 bit for simplicity, especially
     22 * in 32 bit emulation mode. All time values are normalized to
     23 * nanoseconds.
     24 * Currently, two formats are known, which differ by the size of
     25 * this structure, i.e. the last two members are only set when
     26 * the extended channel measurement facility (first shipped in
     27 * z990 machines) is activated.
     28 * Potentially, more fields could be added, which would result in a
     29 * new ioctl number.
     30 */
     31struct cmbdata {
     32	__u64 size;
     33	__u64 elapsed_time;
     34 /* basic and exended format: */
     35	__u64 ssch_rsch_count;
     36	__u64 sample_count;
     37	__u64 device_connect_time;
     38	__u64 function_pending_time;
     39	__u64 device_disconnect_time;
     40	__u64 control_unit_queuing_time;
     41	__u64 device_active_only_time;
     42 /* extended format only: */
     43	__u64 device_busy_time;
     44	__u64 initial_command_response_time;
     45};
     46
     47/* enable channel measurement */
     48#define BIODASDCMFENABLE	_IO(DASD_IOCTL_LETTER, 32)
     49/* enable channel measurement */
     50#define BIODASDCMFDISABLE	_IO(DASD_IOCTL_LETTER, 33)
     51/* read channel measurement data */
     52#define BIODASDREADALLCMB	_IOWR(DASD_IOCTL_LETTER, 33, struct cmbdata)
     53
     54#endif /* _UAPIS390_CMB_H */