ia64/xen-unstable
changeset 9185:ccca12a2bee2
Fix up #PF error code before propagating to guest kernel.
Signed-off-by: Keir Fraser <keir@xensource.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
author | kaf24@firebug.cl.cam.ac.uk |
---|---|
date | Wed Mar 08 10:33:31 2006 +0100 (2006-03-08) |
parents | 503c4d8454e5 |
children | 13bbfced7b35 |
files | xen/arch/x86/traps.c |
line diff
1.1 --- a/xen/arch/x86/traps.c Tue Mar 07 18:41:37 2006 +0100 1.2 +++ b/xen/arch/x86/traps.c Wed Mar 08 10:33:31 2006 +0100 1.3 @@ -431,6 +431,11 @@ void propagate_page_fault(unsigned long 1.4 v->arch.guest_context.ctrlreg[2] = addr; 1.5 v->vcpu_info->arch.cr2 = addr; 1.6 1.7 + /* Re-set error_code.user flag appropriately for the guest. */ 1.8 + error_code &= ~4; 1.9 + if ( !KERNEL_MODE(v, guest_cpu_user_regs()) ) 1.10 + error_code |= 4; 1.11 + 1.12 ti = &v->arch.guest_context.trap_ctxt[TRAP_page_fault]; 1.13 tb->flags = TBF_EXCEPTION | TBF_EXCEPTION_ERRCODE; 1.14 tb->error_code = error_code; 1.15 @@ -541,7 +546,7 @@ static int fixup_page_fault(unsigned lon 1.16 * #PF error code: 1.17 * Bit 0: Protection violation (=1) ; Page not present (=0) 1.18 * Bit 1: Write access 1.19 - * Bit 2: Supervisor mode 1.20 + * Bit 2: User mode (=1) ; Supervisor mode (=0) 1.21 * Bit 3: Reserved bit violation 1.22 * Bit 4: Instruction fetch 1.23 */