github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/cpvmm/vmm/guest/guest_cpu/guest_save_area.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 _GUEST_SAVE_AREA_H
    16  #define _GUEST_SAVE_AREA_H
    17  
    18  #include "vmm_defs.h"
    19  #include "guest_cpu.h"
    20  #include "guest_cpu_control.h"
    21  #include <common_libc.h>
    22  #include "vmcs_hierarchy.h"
    23  #include "vmcs_actual.h"
    24  #include "emulator_if.h"
    25  #include "flat_page_tables.h"
    26  
    27  
    28  // Guest CPU
    29  #pragma PACK_ON
    30  
    31  typedef struct _VMM_OTHER_MSRS {
    32      UINT64 pat;
    33      UINT64 padding; // not in use;
    34  } VMM_OTHER_MSRS;
    35  
    36  //JLM(FIX): duplicated
    37  typedef struct _GUEST_CPU_SAVE_AREA {
    38      // the next 2 fields must be the first in this structure because they are
    39      // referenced in assembler
    40      VMM_GP_REGISTERS    gp;     // note: RSP, RIP and RFLAGS are not used - use VMCS
    41                                  // RSP      entry is used for CR2
    42                                  // RFLAGS   entry is used for CR3
    43                                  // RIP      entry is used for CR8
    44      ALIGN16(VMM_XMM_REGISTERS,   xmm);    // restored AFTER FXRSTOR
    45      // not referenced in assembler
    46      VMM_DEBUG_REGISTERS debug;  // DR7 is not used - use VMCS
    47      // must be aligned on 16-byte boundary
    48      ALIGN16 (UINT8,       fxsave_area[512]);
    49      VMM_OTHER_MSRS temporary_cached_msrs;
    50  } PACKED GUEST_CPU_SAVE_AREA;
    51  
    52  #pragma PACK_OFF
    53  #endif