[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/misc: use unambiguous register names



commit c3d366edffe40e3be322d1713989bd5743a18d0f
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Dec 21 17:01:58 2016 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Dec 21 17:01:58 2016 +0100

    x86/misc: use unambiguous register names
    
    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 <jbeulich@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/cpu/vpmu.c           |  4 ++--
 xen/arch/x86/domain.c             | 36 ++++++++++++++++++------------------
 xen/arch/x86/domain_build.c       | 16 ++++++++--------
 xen/arch/x86/extable.c            |  2 +-
 xen/arch/x86/hypercall.c          |  6 +++---
 xen/arch/x86/trace.c              |  4 ++--
 xen/arch/x86/x86_64/asm-offsets.c |  2 +-
 xen/arch/x86/x86_64/compat/mm.c   |  2 +-
 xen/include/asm-x86/regs.h        |  2 +-
 xen/include/public/xen.h          |  2 +-
 10 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu.c b/xen/arch/x86/cpu/vpmu.c
index 4c713be..35a9403 100644
--- a/xen/arch/x86/cpu/vpmu.c
+++ b/xen/arch/x86/cpu/vpmu.c
@@ -265,7 +265,7 @@ void vpmu_do_interrupt(struct cpu_user_regs *regs)
             cmp = (void *)&vpmu->xenpmu_data->pmu.r.regs;
             cmp->ip = cur_regs->rip;
             cmp->sp = cur_regs->rsp;
-            cmp->flags = cur_regs->eflags;
+            cmp->flags = cur_regs->rflags;
             cmp->ss = cur_regs->ss;
             cmp->cs = cur_regs->cs;
             if ( (cmp->cs & 3) > 1 )
@@ -288,7 +288,7 @@ void vpmu_do_interrupt(struct cpu_user_regs *regs)
 
             r->ip = cur_regs->rip;
             r->sp = cur_regs->rsp;
-            r->flags = cur_regs->eflags;
+            r->flags = cur_regs->rflags;
 
             if ( !has_hvm_container_vcpu(sampled) )
             {
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 2c7a528..11fa379 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -1044,11 +1044,11 @@ int arch_set_info_guest(
     init_int80_direct_trap(v);
 
     /* IOPL privileges are virtualised. */
-    v->arch.pv_vcpu.iopl = v->arch.user_regs.eflags & X86_EFLAGS_IOPL;
-    v->arch.user_regs.eflags &= ~X86_EFLAGS_IOPL;
+    v->arch.pv_vcpu.iopl = v->arch.user_regs._eflags & X86_EFLAGS_IOPL;
+    v->arch.user_regs._eflags &= ~X86_EFLAGS_IOPL;
 
     /* Ensure real hardware interrupts are enabled. */
-    v->arch.user_regs.eflags |= X86_EFLAGS_IF;
+    v->arch.user_regs._eflags |= X86_EFLAGS_IF;
 
     if ( !v->is_initialised )
     {
@@ -2235,7 +2235,7 @@ void hypercall_cancel_continuation(void)
     else
     {
         if ( is_pv_vcpu(current) )
-            regs->eip += 2; /* skip re-execute 'syscall' / 'int $xx' */
+            regs->rip += 2; /* skip re-execute 'syscall' / 'int $xx' */
         else
             current->arch.hvm_vcpu.hcall_preempted = 0;
     }
@@ -2264,11 +2264,11 @@ unsigned long hypercall_create_continuation(
         struct cpu_user_regs *regs = guest_cpu_user_regs();
         struct vcpu *curr = current;
 
-        regs->eax = op;
+        regs->rax = op;
 
         /* Ensure the hypercall trap instruction is re-executed. */
         if ( is_pv_vcpu(curr) )
-            regs->eip -= 2;  /* re-execute 'syscall' / 'int $xx' */
+            regs->rip -= 2;  /* re-execute 'syscall' / 'int $xx' */
         else
             curr->arch.hvm_vcpu.hcall_preempted = 1;
 
@@ -2297,12 +2297,12 @@ unsigned long hypercall_create_continuation(
                 arg = next_arg(p, args);
                 switch ( i )
                 {
-                case 0: regs->ebx = arg; break;
-                case 1: regs->ecx = arg; break;
-                case 2: regs->edx = arg; break;
-                case 3: regs->esi = arg; break;
-                case 4: regs->edi = arg; break;
-                case 5: regs->ebp = arg; break;
+                case 0: regs->rbx = arg; break;
+                case 1: regs->rcx = arg; break;
+                case 2: regs->rdx = arg; break;
+                case 3: regs->rsi = arg; break;
+                case 4: regs->rdi = arg; break;
+                case 5: regs->rbp = arg; break;
                 }
             }
         }
@@ -2372,12 +2372,12 @@ int hypercall_xlat_continuation(unsigned int *id, 
unsigned int nr,
 
             switch ( i )
             {
-            case 0: reg = &regs->ebx; break;
-            case 1: reg = &regs->ecx; break;
-            case 2: reg = &regs->edx; break;
-            case 3: reg = &regs->esi; break;
-            case 4: reg = &regs->edi; break;
-            case 5: reg = &regs->ebp; break;
+            case 0: reg = &regs->rbx; break;
+            case 1: reg = &regs->rcx; break;
+            case 2: reg = &regs->rdx; break;
+            case 3: reg = &regs->rsi; break;
+            case 4: reg = &regs->rdi; break;
+            case 5: reg = &regs->rbp; break;
             default: BUG(); reg = NULL; break;
             }
             if ( (mask & 1) )
diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c
index 1e557b9..243df96 100644
--- a/xen/arch/x86/domain_build.c
+++ b/xen/arch/x86/domain_build.c
@@ -1584,10 +1584,10 @@ int __init construct_dom0(
     /*
      * Initial register values:
      *  DS,ES,FS,GS = FLAT_KERNEL_DS
-     *       CS:EIP = FLAT_KERNEL_CS:start_pc
-     *       SS:ESP = FLAT_KERNEL_SS:start_stack
-     *          ESI = start_info
-     *  [EAX,EBX,ECX,EDX,EDI,EBP are zero]
+     *       CS:rIP = FLAT_KERNEL_CS:start_pc
+     *       SS:rSP = FLAT_KERNEL_SS:start_stack
+     *          rSI = start_info
+     *  [rAX,rBX,rCX,rDX,rDI,rBP,R8-R15 are zero]
      */
     regs = &v->arch.user_regs;
     regs->ds = regs->es = regs->fs = regs->gs =
@@ -1596,10 +1596,10 @@ int __init construct_dom0(
                 FLAT_KERNEL_SS : FLAT_COMPAT_KERNEL_SS);
     regs->cs = (!is_pv_32bit_domain(d) ?
                 FLAT_KERNEL_CS : FLAT_COMPAT_KERNEL_CS);
-    regs->eip = parms.virt_entry;
-    regs->esp = vstack_end;
-    regs->esi = vstartinfo_start;
-    regs->eflags = X86_EFLAGS_IF;
+    regs->rip = parms.virt_entry;
+    regs->rsp = vstack_end;
+    regs->rsi = vstartinfo_start;
+    regs->_eflags = X86_EFLAGS_IF;
 
 #ifdef CONFIG_SHADOW_PAGING
     if ( opt_dom0_shadow )
diff --git a/xen/arch/x86/extable.c b/xen/arch/x86/extable.c
index 701441a..8dd1018 100644
--- a/xen/arch/x86/extable.c
+++ b/xen/arch/x86/extable.c
@@ -98,7 +98,7 @@ search_exception_table(unsigned long addr)
 unsigned long
 search_pre_exception_table(struct cpu_user_regs *regs)
 {
-    unsigned long addr = (unsigned long)regs->eip;
+    unsigned long addr = regs->rip;
     unsigned long fixup = search_one_extable(
         __start___pre_ex_table, __stop___pre_ex_table-1, addr);
     if ( fixup )
diff --git a/xen/arch/x86/hypercall.c b/xen/arch/x86/hypercall.c
index d2b5331..70a30a5 100644
--- a/xen/arch/x86/hypercall.c
+++ b/xen/arch/x86/hypercall.c
@@ -146,7 +146,7 @@ void pv_hypercall(struct cpu_user_regs *regs)
 
     ASSERT(guest_kernel_mode(curr, regs));
 
-    eax = is_pv_32bit_vcpu(curr) ? regs->_eax : regs->eax;
+    eax = is_pv_32bit_vcpu(curr) ? regs->_eax : regs->rax;
 
     BUILD_BUG_ON(ARRAY_SIZE(pv_hypercall_table) >
                  ARRAY_SIZE(hypercall_args_table));
@@ -154,7 +154,7 @@ void pv_hypercall(struct cpu_user_regs *regs)
     if ( (eax >= ARRAY_SIZE(pv_hypercall_table)) ||
          !pv_hypercall_table[eax].native )
     {
-        regs->eax = -ENOSYS;
+        regs->rax = -ENOSYS;
         return;
     }
 
@@ -186,7 +186,7 @@ void pv_hypercall(struct cpu_user_regs *regs)
             __trace_hypercall(TRC_PV_HYPERCALL_V2, eax, args);
         }
 
-        regs->eax = pv_hypercall_table[eax].native(rdi, rsi, rdx, r10, r8, r9);
+        regs->rax = pv_hypercall_table[eax].native(rdi, rsi, rdx, r10, r8, r9);
 
 #ifndef NDEBUG
         if ( regs->rip == old_rip )
diff --git a/xen/arch/x86/trace.c b/xen/arch/x86/trace.c
index f11b309..58624ac 100644
--- a/xen/arch/x86/trace.c
+++ b/xen/arch/x86/trace.c
@@ -48,7 +48,7 @@ void __trace_pv_trap(int trapnr, unsigned long eip,
 
 void __trace_pv_page_fault(unsigned long addr, unsigned error_code)
 {
-    unsigned long eip = guest_cpu_user_regs()->eip;
+    unsigned long eip = guest_cpu_user_regs()->rip;
 
     if ( is_pv_32bit_vcpu(current) )
     {
@@ -119,7 +119,7 @@ void __trace_trap_two_addr(unsigned event, unsigned long 
va1,
 
 void __trace_ptwr_emulation(unsigned long addr, l1_pgentry_t npte)
 {
-    unsigned long eip = guest_cpu_user_regs()->eip;
+    unsigned long eip = guest_cpu_user_regs()->rip;
 
     /* We have a couple of different modes to worry about:
      * - 32-on-32: 32-bit pte, 32-bit virtual addresses
diff --git a/xen/arch/x86/x86_64/asm-offsets.c 
b/xen/arch/x86/x86_64/asm-offsets.c
index 64905c6..0e1f09d 100644
--- a/xen/arch/x86/x86_64/asm-offsets.c
+++ b/xen/arch/x86/x86_64/asm-offsets.c
@@ -44,7 +44,7 @@ void __dummy__(void)
     OFFSET(UREGS_saved_upcall_mask, struct cpu_user_regs, saved_upcall_mask);
     OFFSET(UREGS_rip, struct cpu_user_regs, rip);
     OFFSET(UREGS_cs, struct cpu_user_regs, cs);
-    OFFSET(UREGS_eflags, struct cpu_user_regs, eflags);
+    OFFSET(UREGS_eflags, struct cpu_user_regs, rflags);
     OFFSET(UREGS_rsp, struct cpu_user_regs, rsp);
     OFFSET(UREGS_ss, struct cpu_user_regs, ss);
     OFFSET(UREGS_ds, struct cpu_user_regs, ds);
diff --git a/xen/arch/x86/x86_64/compat/mm.c b/xen/arch/x86/x86_64/compat/mm.c
index 58be8ad..47b5239 100644
--- a/xen/arch/x86/x86_64/compat/mm.c
+++ b/xen/arch/x86/x86_64/compat/mm.c
@@ -327,7 +327,7 @@ int compat_mmuext_op(XEN_GUEST_HANDLE_PARAM(void) arg,
                 struct cpu_user_regs *regs = guest_cpu_user_regs();
                 struct mc_state *mcs = &current->mc_state;
                 unsigned int arg1 = !(mcs->flags & MCSF_in_multicall)
-                                    ? regs->ecx
+                                    ? regs->_ecx
                                     : mcs->call.args[1];
                 unsigned int left = arg1 & ~MMU_UPDATE_PREEMPTED;
 
diff --git a/xen/include/asm-x86/regs.h b/xen/include/asm-x86/regs.h
index 22efc42..725a664 100644
--- a/xen/include/asm-x86/regs.h
+++ b/xen/include/asm-x86/regs.h
@@ -15,6 +15,6 @@
     (diff == 0);                                                              \
 })
 
-#define return_reg(v) ((v)->arch.user_regs.eax)
+#define return_reg(v) ((v)->arch.user_regs.rax)
 
 #endif /* __X86_REGS_H__ */
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index 336aa3f..6593026 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -764,7 +764,7 @@ typedef struct shared_info shared_info_t;
  *         (may be omitted)
  *      c. list of allocated page frames [mfn_list, nr_pages]
  *         (unless relocated due to XEN_ELFNOTE_INIT_P2M)
- *      d. start_info_t structure        [register ESI (x86)]
+ *      d. start_info_t structure        [register rSI (x86)]
  *         in case of dom0 this page contains the console info, too
  *      e. unless dom0: xenstore ring page
  *      f. unless dom0: console ring page
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.