github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/cpvmm/vmm/include/vmm_events_data.h (about)

     1  /*
     2   * Copyright (c) 2013 Intel Corporation
     3   *
     4   * Licensed under the Apache License, Version 2.0 (the "License");
     5   * you may not use this file except in compliance with the License.
     6   * You may obtain a copy of the License at
     7   *     http://www.apache.org/licenses/LICENSE-2.0
     8   * Unless required by applicable law or agreed to in writing, software
     9   * distributed under the License is distributed on an "AS IS" BASIS,
    10   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    11   * See the License for the specific language governing permissions and
    12   * limitations under the License.
    13   */
    14  
    15  #ifndef _VMM_EVENTS_DATA_H_
    16  #define _VMM_EVENTS_DATA_H_
    17  
    18  #include "vmm_defs.h"
    19  #include "event_mgr.h"
    20  
    21  
    22  // Define specific per-event data for event manager
    23  
    24  // EVENT_EMULATOR_BEFORE_MEM_WRITE
    25  // EVENT_EMULATOR_AFTER_MEM_WRITE
    26  typedef struct _EVENT_EMULATOR_MEM_WRITE_DATA {
    27      GPA     gpa;
    28      UINT32  size;
    29      UINT8   padding[4];
    30  } EVENT_EMULATOR_MEM_WRITE_DATA;
    31  
    32  // EVENT_GCPU_BEFORE_GUEST_CR0_WRITE
    33  // EVENT_GCPU_BEFORE_GUEST_CR3_WRITE
    34  // EVENT_GCPU_BEFORE_GUEST_CR4_WRITE
    35  // event is rased before any changes
    36  typedef struct _EVENT_GCPU_GUEST_CR_WRITE_DATA {
    37      UINT64  new_guest_visible_value;
    38  } EVENT_GCPU_GUEST_CR_WRITE_DATA;
    39  
    40  // EVENT_GCPU_INVALIDATE_PAGE
    41  typedef struct _EVENT_GCPU_INVALIDATE_PAGE_DATA {
    42      UINT64  invlpg_addr;
    43  } EVENT_GCPU_INVALIDATE_PAGE_DATA;
    44  
    45  // EVENT_GCPU_BEFORE_EFER_MSR_WRITE
    46  // EVENT_GCPU_BEFORE_PAT_MSR_WRITE
    47  // EVENT_GCPU_BEFORE_MTRR_MSR_WRITE
    48  // event is rased before any changes
    49  typedef struct _EVENT_GCPU_GUEST_MSR_WRITE_DATA {
    50      UINT64  new_guest_visible_value;
    51      MSR_ID  msr_index;
    52      UINT8   padding[4];
    53  } EVENT_GCPU_GUEST_MSR_WRITE_DATA;
    54  
    55  typedef struct _EVENT_GCPU_PAT_MSR_UPDATE_DATA {
    56      UINT64  guest_pat;
    57      UINT64  actual_pat;
    58  } EVENT_GCPU_PAT_MSR_UPDATE_DATA;
    59  
    60  // EVENT_GCPU_PAGE_FAULT
    61  // NOTE: this callback must set processed to TRUE!
    62  typedef struct _EVENT_GCPU_PAGE_FAULT_DATA {
    63      UINT64 pf_address;
    64      UINT64 pf_error_code;
    65      BOOLEAN pf_processed;
    66      UINT8   pad[4];
    67  } EVENT_GCPU_PAGE_FAULT_DATA;
    68  
    69  // EVENT_GCPU_BEFORE_ACTIVITY_STATE_CHANGE
    70  // event is rased before the change
    71  typedef struct _EVENT_GCPU_ACTIVITY_STATE_CHANGE_DATA {
    72      IA32_VMX_VMCS_GUEST_SLEEP_STATE  prev_state;
    73      IA32_VMX_VMCS_GUEST_SLEEP_STATE  new_state;
    74  } EVENT_GCPU_ACTIVITY_STATE_CHANGE_DATA;
    75  
    76  typedef struct _EVENT_GCPU_MTF_DATA {
    77      IA32_VMX_EXIT_QUALIFICATION qualification;
    78      UINT64 guest_linear_address;
    79      BOOLEAN processed;
    80      UINT8   pad[4];
    81  } EVENT_GCPU_MTF_DATA;
    82  
    83  typedef struct _EVENT_GCPU_EPT_VIOLATION_DATA {
    84      IA32_VMX_EXIT_QUALIFICATION qualification;
    85      UINT64 guest_linear_address;
    86      UINT64 guest_physical_address;
    87      BOOLEAN processed;
    88      UINT8   pad[4];
    89  } EVENT_GCPU_EPT_VIOLATION_DATA;
    90  
    91  typedef struct _EVENT_GCPU_EPT_MISCONFIGURATION_DATA {
    92      UINT64 guest_physical_address;
    93      BOOLEAN processed;
    94      UINT8   pad[4];
    95  } EVENT_GCPU_EPT_MISCONFIGURATION_DATA;
    96  
    97  typedef enum _VMM_MEM_OP
    98  {
    99  	VMM_MEM_OP_RECREATE = 1,
   100  	VMM_MEM_OP_SWITCH,
   101  	VMM_MEM_OP_UPDATE,
   102  	VMM_MEM_OP_REMOVE,
   103  } VMM_MEM_OP;
   104  
   105  typedef struct _EVENT_GPM_MODIFICATION_DATA
   106  {
   107      GUEST_ID guest_id;
   108      UINT16 padding;
   109      VMM_MEM_OP operation;
   110  } EVENT_GPM_MODIFICATION_DATA;
   111  
   112  typedef struct _EVENT_GUEST_MEMORY_WRITE
   113  {
   114      GPA       gpa;
   115      BOOLEAN   vtlb_succeed;
   116      GUEST_ID  guest_id;
   117      UINT8     pad[2];
   118  } EVENT_GUEST_MEMORY_WRITE;
   119  
   120  typedef struct _EVENT_GUEST_CREATE_DATA {
   121      GUEST_ID guest_id;
   122  } EVENT_GUEST_CREATE_DATA;
   123  
   124  typedef struct _EVENT_GUEST_DESTROY_DATA {
   125      GUEST_ID guest_id;
   126  } EVENT_GUEST_DESTROY_DATA;
   127  
   128  #endif // _VMM_EVENTS_DATA_H_
   129