ia64/xen-unstable

changeset 3877:21d06c9e4db5

bitkeeper revision 1.1230 (4219c6ad75ERLn-41qrS4GAxcsiIFQ)

Pass a struct xen_regs* to shadow_fault() instead of an error_code.
author maf46@burn.cl.cam.ac.uk
date Mon Feb 21 11:31:57 2005 +0000 (2005-02-21)
parents f9bc35b38b6c
children 47fdecec47f5 89135651ebdb 2fd53607c7ee 7d8023fc0b68 ba1a314ce815
files xen/arch/x86/shadow.c xen/arch/x86/traps.c xen/arch/x86/vmx.c xen/include/asm-x86/shadow.h
line diff
     1.1 --- a/xen/arch/x86/shadow.c	Sun Feb 20 03:52:37 2005 +0000
     1.2 +++ b/xen/arch/x86/shadow.c	Mon Feb 21 11:31:57 2005 +0000
     1.3 @@ -601,13 +601,13 @@ void shadow_invlpg(struct exec_domain *e
     1.4      }
     1.5  }
     1.6  
     1.7 -int shadow_fault(unsigned long va, long error_code)
     1.8 +int shadow_fault(unsigned long va, struct xen_regs *regs)
     1.9  {
    1.10      unsigned long gpte, spte = 0;
    1.11      struct exec_domain *ed = current;
    1.12      struct domain *d = ed->domain;
    1.13  
    1.14 -    SH_VVLOG("shadow_fault( va=%p, code=%lu )", va, error_code );
    1.15 +    SH_VVLOG("shadow_fault( va=%p, code=%lu )", va, regs->error_code );
    1.16  
    1.17      check_pagetable(d, ed->arch.guest_table, "pre-sf");
    1.18  
    1.19 @@ -628,7 +628,7 @@ int shadow_fault(unsigned long va, long 
    1.20          return 0;
    1.21      }
    1.22  
    1.23 -    if ( (error_code & 2)  && !(gpte & _PAGE_RW) )
    1.24 +    if ( (regs->error_code & 2)  && !(gpte & _PAGE_RW) )
    1.25      {
    1.26          /* Write fault on a read-only mapping. */
    1.27          return 0;
    1.28 @@ -656,7 +656,7 @@ int shadow_fault(unsigned long va, long 
    1.29      }
    1.30  
    1.31      /* Write fault? */
    1.32 -    if ( error_code & 2 )  
    1.33 +    if ( regs->error_code & 2 )  
    1.34      {
    1.35          if ( unlikely(!(gpte & _PAGE_RW)) )
    1.36          {
     2.1 --- a/xen/arch/x86/traps.c	Sun Feb 20 03:52:37 2005 +0000
     2.2 +++ b/xen/arch/x86/traps.c	Mon Feb 21 11:31:57 2005 +0000
     2.3 @@ -289,7 +289,7 @@ asmlinkage int do_page_fault(struct xen_
     2.4               ptwr_do_page_fault(addr) )
     2.5          {
     2.6              if ( unlikely(shadow_mode_enabled(d)) )
     2.7 -                (void)shadow_fault(addr, regs->error_code);
     2.8 +                (void)shadow_fault(addr, regs);
     2.9              UNLOCK_BIGLOCK(d);
    2.10              return EXCRET_fault_fixed;
    2.11          }
    2.12 @@ -297,7 +297,7 @@ asmlinkage int do_page_fault(struct xen_
    2.13      }
    2.14  
    2.15      if ( unlikely(shadow_mode_enabled(d)) && 
    2.16 -         (addr < PAGE_OFFSET) && shadow_fault(addr, regs->error_code) )
    2.17 +         (addr < PAGE_OFFSET) && shadow_fault(addr, regs) )
    2.18          return EXCRET_fault_fixed;
    2.19  
    2.20      if ( unlikely(addr >= LDT_VIRT_START(ed)) && 
     3.1 --- a/xen/arch/x86/vmx.c	Sun Feb 20 03:52:37 2005 +0000
     3.2 +++ b/xen/arch/x86/vmx.c	Mon Feb 21 11:31:57 2005 +0000
     3.3 @@ -105,7 +105,7 @@ static void inline __update_guest_eip(un
     3.4  
     3.5  #include <asm/domain_page.h>
     3.6  
     3.7 -static int vmx_do_page_fault(unsigned long va, unsigned long error_code) 
     3.8 +static int vmx_do_page_fault(unsigned long va, struct xen_regs *regs) 
     3.9  {
    3.10      unsigned long eip;
    3.11      unsigned long gpa;
    3.12 @@ -115,8 +115,8 @@ static int vmx_do_page_fault(unsigned lo
    3.13      {
    3.14          __vmread(GUEST_EIP, &eip);
    3.15          VMX_DBG_LOG(DBG_LEVEL_VMMU, 
    3.16 -                "vmx_do_page_fault = 0x%lx, eip = %lx, erro_code = %lx",
    3.17 -                va, eip, error_code);
    3.18 +                "vmx_do_page_fault = 0x%lx, eip = %lx, error_code = %lx",
    3.19 +                va, eip, regs->error_code);
    3.20      }
    3.21  #endif
    3.22  
    3.23 @@ -137,7 +137,7 @@ static int vmx_do_page_fault(unsigned lo
    3.24      if (mmio_space(gpa))
    3.25          handle_mmio(va, gpa);
    3.26  
    3.27 -    if ((result = shadow_fault(va, error_code)))
    3.28 +    if ((result = shadow_fault(va, regs)))
    3.29          return result;
    3.30      
    3.31      return 0;       /* failed to resolve, i.e raise #PG */
    3.32 @@ -757,7 +757,6 @@ asmlinkage void vmx_vmexit_handler(struc
    3.33          int error;
    3.34          unsigned int vector;
    3.35          unsigned long va;
    3.36 -        unsigned long error_code;
    3.37  
    3.38          if ((error = __vmread(VM_EXIT_INTR_INFO, &vector))
    3.39              && !(vector & INTR_INFO_VALID_MASK))
    3.40 @@ -792,14 +791,14 @@ asmlinkage void vmx_vmexit_handler(struc
    3.41          case TRAP_page_fault:
    3.42          {
    3.43              __vmread(EXIT_QUALIFICATION, &va);
    3.44 -            __vmread(VM_EXIT_INTR_ERROR_CODE, &error_code);
    3.45 +            __vmread(VM_EXIT_INTR_ERROR_CODE, &regs.error_code);
    3.46              VMX_DBG_LOG(DBG_LEVEL_VMMU, 
    3.47                      "eax=%lx, ebx=%lx, ecx=%lx, edx=%lx, esi=%lx, edi=%lx",
    3.48                          regs.eax, regs.ebx, regs.ecx, regs.edx, regs.esi,
    3.49                          regs.edi);
    3.50              ed->arch.arch_vmx.vmx_platform.mpci.inst_decoder_regs = &regs;
    3.51  
    3.52 -            if (!(error = vmx_do_page_fault(va, error_code))) {
    3.53 +            if (!(error = vmx_do_page_fault(va, &regs))) {
    3.54                  /*
    3.55                   * Inject #PG using Interruption-Information Fields
    3.56                   */
    3.57 @@ -810,7 +809,7 @@ asmlinkage void vmx_vmexit_handler(struc
    3.58                             INTR_INFO_DELIEVER_CODE_MASK |
    3.59                             TRAP_page_fault);
    3.60                  __vmwrite(VM_ENTRY_INTR_INFO_FIELD, intr_fields);
    3.61 -                __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, error_code);
    3.62 +                __vmwrite(VM_ENTRY_EXCEPTION_ERROR_CODE, regs.error_code);
    3.63                  ed->arch.arch_vmx.cpu_cr2 = va;
    3.64              }
    3.65              break;
     4.1 --- a/xen/include/asm-x86/shadow.h	Sun Feb 20 03:52:37 2005 +0000
     4.2 +++ b/xen/include/asm-x86/shadow.h	Mon Feb 21 11:31:57 2005 +0000
     4.3 @@ -38,7 +38,7 @@
     4.4  
     4.5  extern void shadow_mode_init(void);
     4.6  extern int shadow_mode_control(struct domain *p, dom0_shadow_control_t *sc);
     4.7 -extern int shadow_fault(unsigned long va, long error_code);
     4.8 +extern int shadow_fault(unsigned long va, struct xen_regs *regs);
     4.9  extern void shadow_l1_normal_pt_update(
    4.10      unsigned long pa, unsigned long gpte, 
    4.11      unsigned long *prev_spfn_ptr, l1_pgentry_t **prev_spl1e_ptr);