ia64/xen-unstable

changeset 3867:f6e13cb6944f

bitkeeper revision 1.1225 (4216b500cJI-yzL_QuE8EtpxoFvapA)

vmx.c:
Handle NMIs. Use existing TRAP_* definitions.
Signed-off-by: Arun Sharma <arun.sharma@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@cl.cam.ac.uk>
author kaf24@scramble.cl.cam.ac.uk
date Sat Feb 19 03:39:44 2005 +0000 (2005-02-19)
parents cb47fd96099e
children 8cf0e6d01dab
files xen/arch/x86/vmx.c
line diff
     1.1 --- a/xen/arch/x86/vmx.c	Fri Feb 18 13:39:13 2005 +0000
     1.2 +++ b/xen/arch/x86/vmx.c	Sat Feb 19 03:39:44 2005 +0000
     1.3 @@ -46,11 +46,7 @@ unsigned int opt_vmx_debug_level;
     1.4  
     1.5  extern long evtchn_send(int lport);
     1.6  extern long do_block(void);
     1.7 -
     1.8 -#define VECTOR_DB   1
     1.9 -#define VECTOR_BP   3
    1.10 -#define VECTOR_GP   13
    1.11 -#define VECTOR_PG   14
    1.12 +void do_nmi(struct xen_regs *, unsigned long);
    1.13  
    1.14  int start_vmx()
    1.15  {
    1.16 @@ -157,7 +153,7 @@ static void vmx_do_general_protection_fa
    1.17      intr_fields = (INTR_INFO_VALID_MASK | 
    1.18  		   INTR_TYPE_EXCEPTION |
    1.19  		   INTR_INFO_DELIEVER_CODE_MASK |
    1.20 -		   VECTOR_GP);
    1.21 +		   TRAP_gp_fault);
    1.22      __vmwrite(VM_ENTRY_INTR_INFO_FIELD, intr_fields);
    1.23      __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, error_code);
    1.24  }
    1.25 @@ -763,14 +759,14 @@ asmlinkage void vmx_vmexit_handler(struc
    1.26          TRACE_3D(TRC_VMX_VECTOR, ed->domain->id, eip, vector);
    1.27          switch (vector) {
    1.28  #ifdef XEN_DEBUGGER
    1.29 -        case VECTOR_DB:
    1.30 +        case TRAP_debug:
    1.31          {
    1.32              save_xen_regs(&regs);
    1.33              pdb_handle_exception(1, &regs, 1);
    1.34              restore_xen_regs(&regs);
    1.35              break;
    1.36          }
    1.37 -        case VECTOR_BP:
    1.38 +        case TRAP_int3:
    1.39          {
    1.40              save_xen_regs(&regs);
    1.41              pdb_handle_exception(3, &regs, 1);
    1.42 @@ -778,12 +774,12 @@ asmlinkage void vmx_vmexit_handler(struc
    1.43              break;
    1.44          }
    1.45  #endif
    1.46 -        case VECTOR_GP:
    1.47 +        case TRAP_gp_fault:
    1.48          {
    1.49              vmx_do_general_protection_fault(&regs);
    1.50              break;  
    1.51          }
    1.52 -        case VECTOR_PG:
    1.53 +        case TRAP_page_fault:
    1.54          {
    1.55              __vmread(EXIT_QUALIFICATION, &va);
    1.56              __vmread(VM_EXIT_INTR_ERROR_CODE, &error_code);
    1.57 @@ -802,13 +798,16 @@ asmlinkage void vmx_vmexit_handler(struc
    1.58                  intr_fields = (INTR_INFO_VALID_MASK | 
    1.59                             INTR_TYPE_EXCEPTION |
    1.60                             INTR_INFO_DELIEVER_CODE_MASK |
    1.61 -                           VECTOR_PG);
    1.62 +                           TRAP_page_fault);
    1.63                  __vmwrite(VM_ENTRY_INTR_INFO_FIELD, intr_fields);
    1.64                  __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, error_code);
    1.65                  ed->arch.arch_vmx.cpu_cr2 = va;
    1.66              }
    1.67              break;
    1.68          }
    1.69 +        case TRAP_nmi:
    1.70 +            do_nmi(&regs, 0);
    1.71 +            break;
    1.72          default:
    1.73              __vmx_bug(&regs);
    1.74              break;