cachepc-qemu

Fork of AMDESE/qemu with changes for cachepc side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-qemu
Log | Files | Refs | Submodules | LICENSE | sfeed.txt

hax-windows.h (3648B)


      1/*
      2 * QEMU HAXM support
      3 *
      4 * Copyright IBM, Corp. 2008
      5 *
      6 * Authors:
      7 *  Anthony Liguori   <aliguori@us.ibm.com>
      8 *
      9 * Copyright (c) 2011 Intel Corporation
     10 *  Written by:
     11 *  Jiang Yunhong<yunhong.jiang@intel.com>
     12 *  Xin Xiaohui<xiaohui.xin@intel.com>
     13 *  Zhang Xiantao<xiantao.zhang@intel.com>
     14 *
     15 * This work is licensed under the terms of the GNU GPL, version 2 or later.
     16 * See the COPYING file in the top-level directory.
     17 *
     18 */
     19
     20#ifndef TARGET_I386_HAX_WINDOWS_H
     21#define TARGET_I386_HAX_WINDOWS_H
     22
     23#include <winioctl.h>
     24#include <windef.h>
     25
     26#include "hax-accel-ops.h"
     27
     28#define HAX_INVALID_FD INVALID_HANDLE_VALUE
     29
     30static inline void hax_mod_close(struct hax_state *hax)
     31{
     32    CloseHandle(hax->fd);
     33}
     34
     35static inline void hax_close_fd(hax_fd fd)
     36{
     37    CloseHandle(fd);
     38}
     39
     40static inline int hax_invalid_fd(hax_fd fd)
     41{
     42    return (fd == INVALID_HANDLE_VALUE);
     43}
     44
     45#define HAX_DEVICE_TYPE 0x4000
     46
     47#define HAX_IOCTL_VERSION       CTL_CODE(HAX_DEVICE_TYPE, 0x900, \
     48                                         METHOD_BUFFERED, FILE_ANY_ACCESS)
     49#define HAX_IOCTL_CREATE_VM     CTL_CODE(HAX_DEVICE_TYPE, 0x901, \
     50                                         METHOD_BUFFERED, FILE_ANY_ACCESS)
     51#define HAX_IOCTL_CAPABILITY    CTL_CODE(HAX_DEVICE_TYPE, 0x910, \
     52                                         METHOD_BUFFERED, FILE_ANY_ACCESS)
     53
     54#define HAX_VM_IOCTL_VCPU_CREATE   CTL_CODE(HAX_DEVICE_TYPE, 0x902, \
     55                                            METHOD_BUFFERED, FILE_ANY_ACCESS)
     56#define HAX_VM_IOCTL_ALLOC_RAM     CTL_CODE(HAX_DEVICE_TYPE, 0x903, \
     57                                            METHOD_BUFFERED, FILE_ANY_ACCESS)
     58#define HAX_VM_IOCTL_SET_RAM       CTL_CODE(HAX_DEVICE_TYPE, 0x904, \
     59                                            METHOD_BUFFERED, FILE_ANY_ACCESS)
     60#define HAX_VM_IOCTL_VCPU_DESTROY  CTL_CODE(HAX_DEVICE_TYPE, 0x905, \
     61                                            METHOD_BUFFERED, FILE_ANY_ACCESS)
     62#define HAX_VM_IOCTL_ADD_RAMBLOCK  CTL_CODE(HAX_DEVICE_TYPE, 0x913, \
     63                                            METHOD_BUFFERED, FILE_ANY_ACCESS)
     64
     65#define HAX_VCPU_IOCTL_RUN      CTL_CODE(HAX_DEVICE_TYPE, 0x906, \
     66                                         METHOD_BUFFERED, FILE_ANY_ACCESS)
     67#define HAX_VCPU_IOCTL_SET_MSRS CTL_CODE(HAX_DEVICE_TYPE, 0x907, \
     68                                         METHOD_BUFFERED, FILE_ANY_ACCESS)
     69#define HAX_VCPU_IOCTL_GET_MSRS CTL_CODE(HAX_DEVICE_TYPE, 0x908, \
     70                                         METHOD_BUFFERED, FILE_ANY_ACCESS)
     71#define HAX_VCPU_IOCTL_SET_FPU  CTL_CODE(HAX_DEVICE_TYPE, 0x909, \
     72                                         METHOD_BUFFERED, FILE_ANY_ACCESS)
     73#define HAX_VCPU_IOCTL_GET_FPU  CTL_CODE(HAX_DEVICE_TYPE, 0x90a, \
     74                                         METHOD_BUFFERED, FILE_ANY_ACCESS)
     75
     76#define HAX_VCPU_IOCTL_SETUP_TUNNEL  CTL_CODE(HAX_DEVICE_TYPE, 0x90b, \
     77                                              METHOD_BUFFERED, FILE_ANY_ACCESS)
     78#define HAX_VCPU_IOCTL_INTERRUPT     CTL_CODE(HAX_DEVICE_TYPE, 0x90c, \
     79                                              METHOD_BUFFERED, FILE_ANY_ACCESS)
     80#define HAX_VCPU_SET_REGS            CTL_CODE(HAX_DEVICE_TYPE, 0x90d, \
     81                                              METHOD_BUFFERED, FILE_ANY_ACCESS)
     82#define HAX_VCPU_GET_REGS            CTL_CODE(HAX_DEVICE_TYPE, 0x90e, \
     83                                              METHOD_BUFFERED, FILE_ANY_ACCESS)
     84
     85#define HAX_VM_IOCTL_NOTIFY_QEMU_VERSION CTL_CODE(HAX_DEVICE_TYPE, 0x910, \
     86                                                  METHOD_BUFFERED,        \
     87                                                  FILE_ANY_ACCESS)
     88#endif /* TARGET_I386_HAX_WINDOWS_H */