From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: [PATCH 09/10] x86/traps: use unambiguous register names Date: Tue, 20 Dec 2016 03:42:59 -0700 Message-ID: <58591943020000780012AE0C@prv-mh.provo.novell.com> References: <58590E27020000780012AD5E@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part41784D23.2__=" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJHsv-0001tn-QR for xen-devel@lists.xenproject.org; Tue, 20 Dec 2016 10:43:06 +0000 In-Reply-To: <58590E27020000780012AD5E@prv-mh.provo.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: xen-devel Cc: George Dunlap , Andrew Cooper List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part41784D23.2__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline This is in preparation of eliminating the mis-naming of 64-bit fields with 32-bit register names (eflags instead of rflags etc). Use the guaranteed 32-bit underscore prefixed names for now where appropriate. Signed-off-by: Jan Beulich --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -202,7 +202,7 @@ static void show_guest_stack(struct vcpu return; } =20 - stack =3D (unsigned long *)regs->esp; + stack =3D (unsigned long *)regs->rsp; printk("Guest stack trace from "__OP"sp=3D%p:\n ", stack); =20 if ( !access_ok(stack, sizeof(*stack)) ) @@ -367,8 +367,8 @@ static void _show_trace(unsigned long sp break; frame =3D (unsigned long *)next; next =3D frame[0]; - addr =3D frame[(offsetof(struct cpu_user_regs, eip) - - offsetof(struct cpu_user_regs, ebp)) + addr =3D frame[(offsetof(struct cpu_user_regs, rip) - + offsetof(struct cpu_user_regs, rbp)) / BYTES_PER_LONG]; } else @@ -623,7 +623,7 @@ void fatal_trap(const struct cpu_user_re panic("FATAL TRAP: vector =3D %d (%s)\n" "[error_code=3D%04x] %s", trapnr, trapstr(trapnr), regs->error_code, - (regs->eflags & X86_EFLAGS_IF) ? "" : ", IN INTERRUPT CONTEXT");= + (regs->_eflags & X86_EFLAGS_IF) ? "" : ", IN INTERRUPT = CONTEXT"); } =20 void pv_inject_event(const struct x86_event *event) @@ -663,7 +663,7 @@ void pv_inject_event(const struct x86_ev trace_pv_page_fault(event->cr2, error_code); } else - trace_pv_trap(vector, regs->eip, use_error_code, error_code); + trace_pv_trap(vector, regs->rip, use_error_code, error_code); =20 if ( use_error_code ) { @@ -697,11 +697,11 @@ static inline void do_guest_trap(unsigne pv_inject_event(&event); } =20 -static void instruction_done(struct cpu_user_regs *regs, unsigned long = eip) +static void instruction_done(struct cpu_user_regs *regs, unsigned long = rip) { - regs->eip =3D eip; - regs->eflags &=3D ~X86_EFLAGS_RF; - if ( regs->eflags & X86_EFLAGS_TF ) + regs->rip =3D rip; + regs->_eflags &=3D ~X86_EFLAGS_RF; + if ( regs->_eflags & X86_EFLAGS_TF ) { current->arch.debugreg[6] |=3D DR_STEP | DR_STATUS_RESERVED_ONE; do_guest_trap(TRAP_debug, regs); @@ -799,12 +799,12 @@ void do_trap(struct cpu_user_regs *regs) return; } =20 - if ( likely((fixup =3D search_exception_table(regs->eip)) !=3D 0) ) + if ( likely((fixup =3D search_exception_table(regs->rip)) !=3D 0) ) { dprintk(XENLOG_ERR, "Trap %d: %p -> %p\n", - trapnr, _p(regs->eip), _p(fixup)); - this_cpu(last_extable_addr) =3D regs->eip; - regs->eip =3D fixup; + trapnr, _p(regs->rip), _p(fixup)); + this_cpu(last_extable_addr) =3D regs->rip; + regs->rip =3D fixup; return; } =20 @@ -1042,10 +1042,10 @@ void pv_cpuid(struct cpu_user_regs *regs struct vcpu *curr =3D current; struct domain *currd =3D curr->domain; =20 - leaf =3D a =3D regs->eax; - b =3D regs->ebx; - subleaf =3D c =3D regs->ecx; - d =3D regs->edx; + leaf =3D a =3D regs->_eax; + b =3D regs->_ebx; + subleaf =3D c =3D regs->_ecx; + d =3D regs->_edx; =20 if ( cpuid_hypervisor_leaves(leaf, subleaf, &a, &b, &c, &d) ) goto out; @@ -1065,10 +1065,10 @@ void pv_cpuid(struct cpu_user_regs *regs limit =3D cpuid_eax(limit); if ( leaf > limit ) { - regs->eax =3D 0; - regs->ebx =3D 0; - regs->ecx =3D 0; - regs->edx =3D 0; + regs->rax =3D 0; + regs->rbx =3D 0; + regs->rcx =3D 0; + regs->rdx =3D 0; return; } } @@ -1382,10 +1382,10 @@ void pv_cpuid(struct cpu_user_regs *regs } =20 out: - regs->eax =3D a; - regs->ebx =3D b; - regs->ecx =3D c; - regs->edx =3D d; + regs->rax =3D a; + regs->rbx =3D b; + regs->rcx =3D c; + regs->rdx =3D d; } =20 static int emulate_invalid_rdtscp(struct cpu_user_regs *regs) @@ -1394,7 +1394,7 @@ static int emulate_invalid_rdtscp(struct unsigned long eip, rc; struct vcpu *v =3D current; =20 - eip =3D regs->eip; + eip =3D regs->rip; if ( (rc =3D copy_from_user(opcode, (char *)eip, sizeof(opcode))) = !=3D 0 ) { pv_inject_page_fault(0, eip + sizeof(opcode) - rc); @@ -1413,7 +1413,7 @@ static int emulate_forced_invalid_op(str char sig[5], instr[2]; unsigned long eip, rc; =20 - eip =3D regs->eip; + eip =3D regs->rip; =20 /* Check for forced emulation signature: ud2 ; .ascii "xen". */ if ( (rc =3D copy_from_user(sig, (char *)eip, sizeof(sig))) !=3D 0 ) @@ -1437,7 +1437,7 @@ static int emulate_forced_invalid_op(str /* If cpuid faulting is enabled and CPL>0 inject a #GP in place of = #UD. */ if ( current->arch.cpuid_faulting && !guest_kernel_mode(current, = regs) ) { - regs->eip =3D eip; + regs->rip =3D eip; do_guest_trap(TRAP_gp_fault, regs); return EXCRET_fault_fixed; } @@ -1448,7 +1448,7 @@ static int emulate_forced_invalid_op(str =20 instruction_done(regs, eip); =20 - trace_trap_one_addr(TRC_PV_FORCED_INVALID_OP, regs->eip); + trace_trap_one_addr(TRC_PV_FORCED_INVALID_OP, regs->rip); =20 return EXCRET_fault_fixed; } @@ -1457,7 +1457,7 @@ void do_invalid_op(struct cpu_user_regs { const struct bug_frame *bug =3D NULL; u8 bug_insn[2]; - const char *prefix =3D "", *filename, *predicate, *eip =3D (char = *)regs->eip; + const char *prefix =3D "", *filename, *predicate, *eip =3D (char = *)regs->rip; unsigned long fixup; int id =3D -1, lineno; const struct virtual_region *region; @@ -1473,12 +1473,12 @@ void do_invalid_op(struct cpu_user_regs return; } =20 - if ( !is_active_kernel_text(regs->eip) || + if ( !is_active_kernel_text(regs->rip) || __copy_from_user(bug_insn, eip, sizeof(bug_insn)) || memcmp(bug_insn, "\xf\xb", sizeof(bug_insn)) ) goto die; =20 - region =3D find_text_region(regs->eip); + region =3D find_text_region(regs->rip); if ( region ) { for ( id =3D 0; id < BUGFRAME_NR; id++ ) @@ -1507,7 +1507,7 @@ void do_invalid_op(struct cpu_user_regs void (*fn)(struct cpu_user_regs *) =3D bug_ptr(bug); =20 fn(regs); - regs->eip =3D (unsigned long)eip; + regs->rip =3D (unsigned long)eip; return; } =20 @@ -1528,7 +1528,7 @@ void do_invalid_op(struct cpu_user_regs case BUGFRAME_warn: printk("Xen WARN at %s%s:%d\n", prefix, filename, lineno); show_execution_state(regs); - regs->eip =3D (unsigned long)eip; + regs->rip =3D (unsigned long)eip; return; =20 case BUGFRAME_bug: @@ -1558,10 +1558,10 @@ void do_invalid_op(struct cpu_user_regs } =20 die: - if ( (fixup =3D search_exception_table(regs->eip)) !=3D 0 ) + if ( (fixup =3D search_exception_table(regs->rip)) !=3D 0 ) { - this_cpu(last_extable_addr) =3D regs->eip; - regs->eip =3D fixup; + this_cpu(last_extable_addr) =3D regs->rip; + regs->rip =3D fixup; return; } =20 @@ -1622,7 +1622,7 @@ static int handle_gdt_ldt_mapping_fault( { if ( guest_mode(regs) ) trace_trap_two_addr(TRC_PV_GDT_LDT_MAPPING_FAULT, - regs->eip, offset); + regs->rip, offset); } else { @@ -1764,7 +1764,7 @@ leaf: * - Page fault in kernel mode */ if ( (cr4 & X86_CR4_SMAP) && !(error_code & PFEC_user_mode) && - (((regs->cs & 3) =3D=3D 3) || !(regs->eflags & X86_EFLAGS_AC)= ) ) + (((regs->cs & 3) =3D=3D 3) || !(regs->_eflags & X86_EFLAGS_AC= )) ) return smap_fault; } =20 @@ -1794,7 +1794,7 @@ static int fixup_page_fault(unsigned lon struct domain *d =3D v->domain; =20 /* No fixups in interrupt context or when interrupts are disabled. */ - if ( in_irq() || !(regs->eflags & X86_EFLAGS_IF) ) + if ( in_irq() || !(regs->_eflags & X86_EFLAGS_IF) ) return 0; =20 if ( !(regs->error_code & PFEC_page_present) && @@ -1841,7 +1841,7 @@ static int fixup_page_fault(unsigned lon =20 ret =3D paging_fault(addr, regs); if ( ret =3D=3D EXCRET_fault_fixed ) - trace_trap_two_addr(TRC_PV_PAGING_FIXUP, regs->eip, addr); + trace_trap_two_addr(TRC_PV_PAGING_FIXUP, regs->rip, addr); return ret; } =20 @@ -1888,13 +1888,13 @@ void do_page_fault(struct cpu_user_regs if ( pf_type !=3D real_fault ) return; =20 - if ( likely((fixup =3D search_exception_table(regs->eip)) !=3D 0) = ) + if ( likely((fixup =3D search_exception_table(regs->rip)) !=3D 0) = ) { perfc_incr(copy_user_faults); if ( unlikely(regs->error_code & PFEC_reserved_bit) ) reserved_bit_page_fault(addr, regs); - this_cpu(last_extable_addr) =3D regs->eip; - regs->eip =3D fixup; + this_cpu(last_extable_addr) =3D regs->rip; + regs->rip =3D fixup; return; } =20 @@ -1944,9 +1944,9 @@ void __init do_early_page_fault(struct c =20 BUG_ON(smp_processor_id() !=3D 0); =20 - if ( (regs->eip !=3D prev_eip) || (cr2 !=3D prev_cr2) ) + if ( (regs->rip !=3D prev_eip) || (cr2 !=3D prev_cr2) ) { - prev_eip =3D regs->eip; + prev_eip =3D regs->rip; prev_cr2 =3D cr2; stuck =3D 0; return; @@ -1956,7 +1956,7 @@ void __init do_early_page_fault(struct c { console_start_sync(); printk("Early fatal page fault at %04x:%p (cr2=3D%p, ec=3D%04x)\n"= , - regs->cs, _p(regs->eip), _p(cr2), regs->error_code); + regs->cs, _p(regs->rip), _p(cr2), regs->error_code); fatal_trap(regs, 0); } } @@ -3699,7 +3699,7 @@ static void emulate_gate_op(struct cpu_u return; } push(regs->ss); - push(regs->esp); + push(regs->rsp); if ( nparm ) { const unsigned int *ustkp; @@ -3735,7 +3735,7 @@ static void emulate_gate_op(struct cpu_u else { sel |=3D (regs->cs & 3); - esp =3D regs->esp; + esp =3D regs->rsp; ss =3D regs->ss; if ( !read_descriptor(ss, v, &base, &limit, &ar, 0) || ((ar >> 13) & 3) !=3D (sel & 3) ) @@ -3756,9 +3756,9 @@ static void emulate_gate_op(struct cpu_u } } push(regs->cs); - push(regs->eip + insn_len); + push(regs->rip + insn_len); #undef push - regs->esp =3D esp; + regs->rsp =3D esp; regs->ss =3D ss; } else @@ -3811,7 +3811,7 @@ void do_general_protection(struct cpu_us ti =3D &v->arch.pv_vcpu.trap_ctxt[vector]; if ( permit_softint(TI_GET_DPL(ti), v, regs) ) { - regs->eip +=3D 2; + regs->rip +=3D 2; do_guest_trap(vector, regs); return; } @@ -3826,7 +3826,7 @@ void do_general_protection(struct cpu_us if ( (regs->error_code =3D=3D 0) && emulate_privileged_op(regs) ) { - trace_trap_one_addr(TRC_PV_EMULATE_PRIVOP, regs->eip); + trace_trap_one_addr(TRC_PV_EMULATE_PRIVOP, regs->rip); return; } =20 @@ -3836,12 +3836,12 @@ void do_general_protection(struct cpu_us =20 gp_in_kernel: =20 - if ( likely((fixup =3D search_exception_table(regs->eip)) !=3D 0) ) + if ( likely((fixup =3D search_exception_table(regs->rip)) !=3D 0) ) { dprintk(XENLOG_INFO, "GPF (%04x): %p -> %p\n", - regs->error_code, _p(regs->eip), _p(fixup)); - this_cpu(last_extable_addr) =3D regs->eip; - regs->eip =3D fixup; + regs->error_code, _p(regs->rip), _p(fixup)); + this_cpu(last_extable_addr) =3D regs->rip; + regs->rip =3D fixup; return; } =20 @@ -4091,20 +4091,20 @@ void do_debug(struct cpu_user_regs *regs =20 if ( !guest_mode(regs) ) { - if ( regs->eflags & X86_EFLAGS_TF ) + if ( regs->_eflags & X86_EFLAGS_TF ) { /* In SYSENTER entry path we can't zap TF until EFLAGS is = saved. */ if ( (regs->rip >=3D (unsigned long)sysenter_entry) && (regs->rip <=3D (unsigned long)sysenter_eflags_saved) ) { if ( regs->rip =3D=3D (unsigned long)sysenter_eflags_saved= ) - regs->eflags &=3D ~X86_EFLAGS_TF; + regs->_eflags &=3D ~X86_EFLAGS_TF; goto out; } if ( !debugger_trap_fatal(TRAP_debug, regs) ) { WARN(); - regs->eflags &=3D ~X86_EFLAGS_TF; + regs->_eflags &=3D ~X86_EFLAGS_TF; } } else @@ -4115,7 +4115,7 @@ void do_debug(struct cpu_user_regs *regs * watchpoint set on it. No need to bump EIP; the only = faulting * trap is an instruction breakpoint, which can't happen to = us. */ - WARN_ON(!search_exception_table(regs->eip)); + WARN_ON(!search_exception_table(regs->rip)); } goto out; } --=__Part41784D23.2__= Content-Type: text/plain; name="x86-regnames-traps.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-regnames-traps.patch" x86/traps: use unambiguous register names=0A=0AThis is in preparation of = eliminating the mis-naming of 64-bit fields=0Awith 32-bit register names = (eflags instead of rflags etc). Use the=0Aguaranteed 32-bit underscore = prefixed names for now where appropriate.=0A=0ASigned-off-by: Jan Beulich = =0A=0A--- a/xen/arch/x86/traps.c=0A+++ b/xen/arch/x86/tr= aps.c=0A@@ -202,7 +202,7 @@ static void show_guest_stack(struct vcpu=0A = return;=0A }=0A =0A- stack =3D (unsigned long *)regs->esp;=0A+ = stack =3D (unsigned long *)regs->rsp;=0A printk("Guest stack trace = from "__OP"sp=3D%p:\n ", stack);=0A =0A if ( !access_ok(stack, = sizeof(*stack)) )=0A@@ -367,8 +367,8 @@ static void _show_trace(unsigned = long sp=0A break;=0A frame =3D (unsigned long = *)next;=0A next =3D frame[0];=0A- addr =3D = frame[(offsetof(struct cpu_user_regs, eip) -=0A- = offsetof(struct cpu_user_regs, ebp))=0A+ addr =3D frame[(offset= of(struct cpu_user_regs, rip) -=0A+ offsetof(stru= ct cpu_user_regs, rbp))=0A / BYTES_PER_LONG];=0A = }=0A else=0A@@ -623,7 +623,7 @@ void fatal_trap(const = struct cpu_user_re=0A panic("FATAL TRAP: vector =3D %d (%s)\n"=0A = "[error_code=3D%04x] %s",=0A trapnr, trapstr(trapnr), = regs->error_code,=0A- (regs->eflags & X86_EFLAGS_IF) ? "" : ", IN = INTERRUPT CONTEXT");=0A+ (regs->_eflags & X86_EFLAGS_IF) ? "" : = ", IN INTERRUPT CONTEXT");=0A }=0A =0A void pv_inject_event(const struct = x86_event *event)=0A@@ -663,7 +663,7 @@ void pv_inject_event(const struct = x86_ev=0A trace_pv_page_fault(event->cr2, error_code);=0A }=0A = else=0A- trace_pv_trap(vector, regs->eip, use_error_code, = error_code);=0A+ trace_pv_trap(vector, regs->rip, use_error_code, = error_code);=0A =0A if ( use_error_code )=0A {=0A@@ -697,11 = +697,11 @@ static inline void do_guest_trap(unsigne=0A pv_inject_event(= &event);=0A }=0A =0A-static void instruction_done(struct cpu_user_regs = *regs, unsigned long eip)=0A+static void instruction_done(struct cpu_user_r= egs *regs, unsigned long rip)=0A {=0A- regs->eip =3D eip;=0A- = regs->eflags &=3D ~X86_EFLAGS_RF;=0A- if ( regs->eflags & X86_EFLAGS_TF = )=0A+ regs->rip =3D rip;=0A+ regs->_eflags &=3D ~X86_EFLAGS_RF;=0A+ = if ( regs->_eflags & X86_EFLAGS_TF )=0A {=0A current->arch.de= bugreg[6] |=3D DR_STEP | DR_STATUS_RESERVED_ONE;=0A do_guest_trap(T= RAP_debug, regs);=0A@@ -799,12 +799,12 @@ void do_trap(struct cpu_user_regs= *regs)=0A return;=0A }=0A =0A- if ( likely((fixup =3D = search_exception_table(regs->eip)) !=3D 0) )=0A+ if ( likely((fixup =3D = search_exception_table(regs->rip)) !=3D 0) )=0A {=0A dprintk(XE= NLOG_ERR, "Trap %d: %p -> %p\n",=0A- trapnr, _p(regs->eip), = _p(fixup));=0A- this_cpu(last_extable_addr) =3D regs->eip;=0A- = regs->eip =3D fixup;=0A+ trapnr, _p(regs->rip), _p(fixup))= ;=0A+ this_cpu(last_extable_addr) =3D regs->rip;=0A+ = regs->rip =3D fixup;=0A return;=0A }=0A =0A@@ -1042,10 = +1042,10 @@ void pv_cpuid(struct cpu_user_regs *regs=0A struct vcpu = *curr =3D current;=0A struct domain *currd =3D curr->domain;=0A =0A- = leaf =3D a =3D regs->eax;=0A- b =3D regs->ebx;=0A- subleaf =3D c = =3D regs->ecx;=0A- d =3D regs->edx;=0A+ leaf =3D a =3D regs->_eax;=0A= + b =3D regs->_ebx;=0A+ subleaf =3D c =3D regs->_ecx;=0A+ d =3D = regs->_edx;=0A =0A if ( cpuid_hypervisor_leaves(leaf, subleaf, &a, &b, = &c, &d) )=0A goto out;=0A@@ -1065,10 +1065,10 @@ void pv_cpuid(stru= ct cpu_user_regs *regs=0A limit =3D cpuid_eax(limit);=0A = if ( leaf > limit )=0A {=0A- regs->eax =3D 0;=0A- = regs->ebx =3D 0;=0A- regs->ecx =3D 0;=0A- = regs->edx =3D 0;=0A+ regs->rax =3D 0;=0A+ regs->rbx = =3D 0;=0A+ regs->rcx =3D 0;=0A+ regs->rdx =3D 0;=0A = return;=0A }=0A }=0A@@ -1382,10 +1382,10 @@ void = pv_cpuid(struct cpu_user_regs *regs=0A }=0A =0A out:=0A- regs->eax = =3D a;=0A- regs->ebx =3D b;=0A- regs->ecx =3D c;=0A- regs->edx = =3D d;=0A+ regs->rax =3D a;=0A+ regs->rbx =3D b;=0A+ regs->rcx = =3D c;=0A+ regs->rdx =3D d;=0A }=0A =0A static int emulate_invalid_rdtsc= p(struct cpu_user_regs *regs)=0A@@ -1394,7 +1394,7 @@ static int emulate_in= valid_rdtscp(struct=0A unsigned long eip, rc;=0A struct vcpu *v = =3D current;=0A =0A- eip =3D regs->eip;=0A+ eip =3D regs->rip;=0A = if ( (rc =3D copy_from_user(opcode, (char *)eip, sizeof(opcode))) !=3D 0 = )=0A {=0A pv_inject_page_fault(0, eip + sizeof(opcode) - = rc);=0A@@ -1413,7 +1413,7 @@ static int emulate_forced_invalid_op(str=0A = char sig[5], instr[2];=0A unsigned long eip, rc;=0A =0A- eip =3D = regs->eip;=0A+ eip =3D regs->rip;=0A =0A /* Check for forced = emulation signature: ud2 ; .ascii "xen". */=0A if ( (rc =3D copy_from_u= ser(sig, (char *)eip, sizeof(sig))) !=3D 0 )=0A@@ -1437,7 +1437,7 @@ = static int emulate_forced_invalid_op(str=0A /* If cpuid faulting is = enabled and CPL>0 inject a #GP in place of #UD. */=0A if ( current->arc= h.cpuid_faulting && !guest_kernel_mode(current, regs) )=0A {=0A- = regs->eip =3D eip;=0A+ regs->rip =3D eip;=0A do_guest_trap(= TRAP_gp_fault, regs);=0A return EXCRET_fault_fixed;=0A }=0A@@ = -1448,7 +1448,7 @@ static int emulate_forced_invalid_op(str=0A =0A = instruction_done(regs, eip);=0A =0A- trace_trap_one_addr(TRC_PV_FORCED_I= NVALID_OP, regs->eip);=0A+ trace_trap_one_addr(TRC_PV_FORCED_INVALID_OP,= regs->rip);=0A =0A return EXCRET_fault_fixed;=0A }=0A@@ -1457,7 = +1457,7 @@ void do_invalid_op(struct cpu_user_regs=0A {=0A const = struct bug_frame *bug =3D NULL;=0A u8 bug_insn[2];=0A- const char = *prefix =3D "", *filename, *predicate, *eip =3D (char *)regs->eip;=0A+ = const char *prefix =3D "", *filename, *predicate, *eip =3D (char *)regs->ri= p;=0A unsigned long fixup;=0A int id =3D -1, lineno;=0A const = struct virtual_region *region;=0A@@ -1473,12 +1473,12 @@ void do_invalid_op= (struct cpu_user_regs=0A return;=0A }=0A =0A- if ( = !is_active_kernel_text(regs->eip) ||=0A+ if ( !is_active_kernel_text(reg= s->rip) ||=0A __copy_from_user(bug_insn, eip, sizeof(bug_insn)) = ||=0A memcmp(bug_insn, "\xf\xb", sizeof(bug_insn)) )=0A = goto die;=0A =0A- region =3D find_text_region(regs->eip);=0A+ region = =3D find_text_region(regs->rip);=0A if ( region )=0A {=0A = for ( id =3D 0; id < BUGFRAME_NR; id++ )=0A@@ -1507,7 +1507,7 @@ void = do_invalid_op(struct cpu_user_regs=0A void (*fn)(struct cpu_user_re= gs *) =3D bug_ptr(bug);=0A =0A fn(regs);=0A- regs->eip =3D = (unsigned long)eip;=0A+ regs->rip =3D (unsigned long)eip;=0A = return;=0A }=0A =0A@@ -1528,7 +1528,7 @@ void do_invalid_op(struct = cpu_user_regs=0A case BUGFRAME_warn:=0A printk("Xen WARN at = %s%s:%d\n", prefix, filename, lineno);=0A show_execution_state(regs= );=0A- regs->eip =3D (unsigned long)eip;=0A+ regs->rip =3D = (unsigned long)eip;=0A return;=0A =0A case BUGFRAME_bug:=0A@@ = -1558,10 +1558,10 @@ void do_invalid_op(struct cpu_user_regs=0A }=0A = =0A die:=0A- if ( (fixup =3D search_exception_table(regs->eip)) !=3D 0 = )=0A+ if ( (fixup =3D search_exception_table(regs->rip)) !=3D 0 )=0A = {=0A- this_cpu(last_extable_addr) =3D regs->eip;=0A- = regs->eip =3D fixup;=0A+ this_cpu(last_extable_addr) =3D regs->rip;= =0A+ regs->rip =3D fixup;=0A return;=0A }=0A =0A@@ = -1622,7 +1622,7 @@ static int handle_gdt_ldt_mapping_fault(=0A = {=0A if ( guest_mode(regs) )=0A trace_trap_two_= addr(TRC_PV_GDT_LDT_MAPPING_FAULT,=0A- = regs->eip, offset);=0A+ regs->rip, = offset);=0A }=0A else=0A {=0A@@ -1764,7 +1764,7 @@ = leaf:=0A * - Page fault in kernel mode=0A */=0A = if ( (cr4 & X86_CR4_SMAP) && !(error_code & PFEC_user_mode) &&=0A- = (((regs->cs & 3) =3D=3D 3) || !(regs->eflags & X86_EFLAGS_AC)) )=0A+ = (((regs->cs & 3) =3D=3D 3) || !(regs->_eflags & X86_EFLAGS_AC)) = )=0A return smap_fault;=0A }=0A =0A@@ -1794,7 +1794,7 @@ = static int fixup_page_fault(unsigned lon=0A struct domain *d =3D = v->domain;=0A =0A /* No fixups in interrupt context or when interrupts = are disabled. */=0A- if ( in_irq() || !(regs->eflags & X86_EFLAGS_IF) = )=0A+ if ( in_irq() || !(regs->_eflags & X86_EFLAGS_IF) )=0A = return 0;=0A =0A if ( !(regs->error_code & PFEC_page_present) &&=0A@@ = -1841,7 +1841,7 @@ static int fixup_page_fault(unsigned lon=0A =0A = ret =3D paging_fault(addr, regs);=0A if ( ret =3D=3D EXCRET_fault_f= ixed )=0A- trace_trap_two_addr(TRC_PV_PAGING_FIXUP, regs->eip, = addr);=0A+ trace_trap_two_addr(TRC_PV_PAGING_FIXUP, regs->rip, = addr);=0A return ret;=0A }=0A =0A@@ -1888,13 +1888,13 @@ void = do_page_fault(struct cpu_user_regs=0A if ( pf_type !=3D real_fault = )=0A return;=0A =0A- if ( likely((fixup =3D search_excep= tion_table(regs->eip)) !=3D 0) )=0A+ if ( likely((fixup =3D = search_exception_table(regs->rip)) !=3D 0) )=0A {=0A = perfc_incr(copy_user_faults);=0A if ( unlikely(regs->error_code= & PFEC_reserved_bit) )=0A reserved_bit_page_fault(addr, = regs);=0A- this_cpu(last_extable_addr) =3D regs->eip;=0A- = regs->eip =3D fixup;=0A+ this_cpu(last_extable_addr) =3D = regs->rip;=0A+ regs->rip =3D fixup;=0A return;=0A = }=0A =0A@@ -1944,9 +1944,9 @@ void __init do_early_page_fault(struct = c=0A =0A BUG_ON(smp_processor_id() !=3D 0);=0A =0A- if ( (regs->eip = !=3D prev_eip) || (cr2 !=3D prev_cr2) )=0A+ if ( (regs->rip !=3D = prev_eip) || (cr2 !=3D prev_cr2) )=0A {=0A- prev_eip =3D = regs->eip;=0A+ prev_eip =3D regs->rip;=0A prev_cr2 =3D = cr2;=0A stuck =3D 0;=0A return;=0A@@ -1956,7 +1956,7 @@ = void __init do_early_page_fault(struct c=0A {=0A console_start_= sync();=0A printk("Early fatal page fault at %04x:%p (cr2=3D%p, = ec=3D%04x)\n",=0A- regs->cs, _p(regs->eip), _p(cr2), = regs->error_code);=0A+ regs->cs, _p(regs->rip), _p(cr2), = regs->error_code);=0A fatal_trap(regs, 0);=0A }=0A }=0A@@ = -3699,7 +3699,7 @@ static void emulate_gate_op(struct cpu_u=0A = return;=0A }=0A push(regs->ss);=0A- = push(regs->esp);=0A+ push(regs->rsp);=0A if ( nparm = )=0A {=0A const unsigned int *ustkp;=0A@@ = -3735,7 +3735,7 @@ static void emulate_gate_op(struct cpu_u=0A = else=0A {=0A sel |=3D (regs->cs & 3);=0A- = esp =3D regs->esp;=0A+ esp =3D regs->rsp;=0A ss =3D = regs->ss;=0A if ( !read_descriptor(ss, v, &base, &limit, &ar, = 0) ||=0A ((ar >> 13) & 3) !=3D (sel & 3) )=0A@@ -3756,9 = +3756,9 @@ static void emulate_gate_op(struct cpu_u=0A }=0A = }=0A push(regs->cs);=0A- push(regs->eip + insn_len);=0A= + push(regs->rip + insn_len);=0A #undef push=0A- regs->esp = =3D esp;=0A+ regs->rsp =3D esp;=0A regs->ss =3D ss;=0A = }=0A else=0A@@ -3811,7 +3811,7 @@ void do_general_protection(struct = cpu_us=0A ti =3D &v->arch.pv_vcpu.trap_ctxt[vector];=0A if = ( permit_softint(TI_GET_DPL(ti), v, regs) )=0A {=0A- = regs->eip +=3D 2;=0A+ regs->rip +=3D 2;=0A = do_guest_trap(vector, regs);=0A return;=0A }=0A@@ = -3826,7 +3826,7 @@ void do_general_protection(struct cpu_us=0A if ( = (regs->error_code =3D=3D 0) &&=0A emulate_privileged_op(regs) = )=0A {=0A- trace_trap_one_addr(TRC_PV_EMULATE_PRIVOP, regs->eip)= ;=0A+ trace_trap_one_addr(TRC_PV_EMULATE_PRIVOP, regs->rip);=0A = return;=0A }=0A =0A@@ -3836,12 +3836,12 @@ void do_general_protecti= on(struct cpu_us=0A =0A gp_in_kernel:=0A =0A- if ( likely((fixup =3D = search_exception_table(regs->eip)) !=3D 0) )=0A+ if ( likely((fixup =3D = search_exception_table(regs->rip)) !=3D 0) )=0A {=0A dprintk(XE= NLOG_INFO, "GPF (%04x): %p -> %p\n",=0A- regs->error_code, = _p(regs->eip), _p(fixup));=0A- this_cpu(last_extable_addr) =3D = regs->eip;=0A- regs->eip =3D fixup;=0A+ regs->error_c= ode, _p(regs->rip), _p(fixup));=0A+ this_cpu(last_extable_addr) =3D = regs->rip;=0A+ regs->rip =3D fixup;=0A return;=0A }=0A = =0A@@ -4091,20 +4091,20 @@ void do_debug(struct cpu_user_regs *regs=0A =0A = if ( !guest_mode(regs) )=0A {=0A- if ( regs->eflags & = X86_EFLAGS_TF )=0A+ if ( regs->_eflags & X86_EFLAGS_TF )=0A = {=0A /* In SYSENTER entry path we can't zap TF until EFLAGS is = saved. */=0A if ( (regs->rip >=3D (unsigned long)sysenter_entry= ) &&=0A (regs->rip <=3D (unsigned long)sysenter_eflags_sav= ed) )=0A {=0A if ( regs->rip =3D=3D (unsigned = long)sysenter_eflags_saved )=0A- regs->eflags &=3D = ~X86_EFLAGS_TF;=0A+ regs->_eflags &=3D ~X86_EFLAGS_TF;= =0A goto out;=0A }=0A if ( = !debugger_trap_fatal(TRAP_debug, regs) )=0A {=0A = WARN();=0A- regs->eflags &=3D ~X86_EFLAGS_TF;=0A+ = regs->_eflags &=3D ~X86_EFLAGS_TF;=0A }=0A }=0A = else=0A@@ -4115,7 +4115,7 @@ void do_debug(struct cpu_user_regs = *regs=0A * watchpoint set on it. No need to bump EIP; the = only faulting=0A * trap is an instruction breakpoint, which = can't happen to us.=0A */=0A- WARN_ON(!search_excep= tion_table(regs->eip));=0A+ WARN_ON(!search_exception_table(regs= ->rip));=0A }=0A goto out;=0A }=0A --=__Part41784D23.2__= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --=__Part41784D23.2__=--