[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH] x86: adjust reserved bit page fault handling
One could even debate whether reserved bit faults are always fatal (and should never be propagated to the guest)... Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx> Index: 2008-01-28/xen/arch/x86/traps.c =================================================================== --- 2008-01-28.orig/xen/arch/x86/traps.c 2008-01-28 11:31:44.000000000 +0100 +++ 2008-01-28/xen/arch/x86/traps.c 2008-01-30 11:47:39.000000000 +0100 @@ -823,6 +823,17 @@ asmlinkage void do_machine_check(struct machine_check_vector(regs, regs->error_code); } +static inline void reserved_bit_page_fault(int guest, unsigned long addr, + struct cpu_user_regs *regs) +{ + if ( guest ) + gdprintk(XENLOG_ERR, "reserved bit in page table entry: "); + else + dprintk(XENLOG_ERR, "reserved bit in page table entry: "); + show_page_walk(addr); + show_execution_state(regs); +} + void propagate_page_fault(unsigned long addr, u16 error_code) { struct trap_info *ti; @@ -852,6 +863,8 @@ void propagate_page_fault(unsigned long v->domain->domain_id, v->vcpu_id, error_code); show_page_walk(addr); } + else if ( unlikely(error_code & PFEC_reserved_bit) ) + reserved_bit_page_fault(1, addr, guest_cpu_user_regs()); } static int handle_gdt_ldt_mapping_fault( @@ -1034,8 +1047,10 @@ static int fixup_page_fault(unsigned lon struct vcpu *v = current; struct domain *d = v->domain; - /* No fixups in interrupt context or when interrupts are disabled. */ - if ( in_irq() || !(regs->eflags & X86_EFLAGS_IF) ) + /* No fixups in interrupt context, when interrupts are disabled, or + * when a reserved bit was found to be set. */ + if ( in_irq() || !(regs->eflags & X86_EFLAGS_IF) || + (regs->error_code & PFEC_reserved_bit) ) return 0; if ( unlikely(IN_HYPERVISOR_RANGE(addr)) ) @@ -1101,6 +1116,8 @@ asmlinkage void do_page_fault(struct cpu if ( likely((fixup = search_exception_table(regs->eip)) != 0) ) { perfc_incr(copy_user_faults); + if ( unlikely(regs->error_code & PFEC_reserved_bit) ) + reserved_bit_page_fault(0, addr, regs); regs->eip = fixup; return; } _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |