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

[Xen-changelog] [xen master] x86: drop is_pv_32on64_vcpu()



commit 77411f1079d29c4195a13fa89b8506bf92462d10
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Jun 24 10:37:06 2015 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Jun 24 10:37:06 2015 +0200

    x86: drop is_pv_32on64_vcpu()
    
    ... as being identical to is_pv_32bit_vcpu() after the x86-32 removal.
    
    In a few cases this includes an additional is_pv_32bit_vcpu() ->
    is_pv_32bit_domain() conversion.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/cpu/mcheck/mce.c |    8 ++++----
 xen/arch/x86/domain.c         |    4 ++--
 xen/arch/x86/mm.c             |    2 +-
 xen/arch/x86/trace.c          |   12 ++++++------
 xen/arch/x86/traps.c          |   20 ++++++++++----------
 xen/include/asm-x86/domain.h  |    1 -
 xen/include/asm-x86/ldt.h     |    2 +-
 xen/include/xen/tmem_xen.h    |    2 +-
 8 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/xen/arch/x86/cpu/mcheck/mce.c b/xen/arch/x86/cpu/mcheck/mce.c
index 3a3b4dc..7c2cacc 100644
--- a/xen/arch/x86/cpu/mcheck/mce.c
+++ b/xen/arch/x86/cpu/mcheck/mce.c
@@ -1339,7 +1339,7 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
             mctelem_cookie_t cookie = ID2COOKIE(mc_fetch.nat->fetch_id);
             mctelem_ack(which, cookie);
         } else {
-            if (!is_pv_32on64_vcpu(v)
+            if (!is_pv_32bit_vcpu(v)
                 ? guest_handle_is_null(mc_fetch.nat->data)
                 : compat_handle_is_null(mc_fetch.cmp->data))
                 return x86_mcerr("do_mca fetch: guest buffer "
@@ -1347,7 +1347,7 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
 
             if ((mctc = mctelem_consume_oldest_begin(which))) {
                 struct mc_info *mcip = mctelem_dataptr(mctc);
-                if (!is_pv_32on64_vcpu(v)
+                if (!is_pv_32bit_vcpu(v)
                     ? copy_to_guest(mc_fetch.nat->data, mcip, 1)
                     : copy_to_compat(mc_fetch.cmp->data,
                                      mcip, 1)) {
@@ -1378,7 +1378,7 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
         mc_physcpuinfo.nat = &op->u.mc_physcpuinfo;
         nlcpu = num_online_cpus();
 
-        if (!is_pv_32on64_vcpu(v)
+        if (!is_pv_32bit_vcpu(v)
             ? !guest_handle_is_null(mc_physcpuinfo.nat->info)
             : !compat_handle_is_null(mc_physcpuinfo.cmp->info)) {
             if (mc_physcpuinfo.nat->ncpus <= 0)
@@ -1389,7 +1389,7 @@ long do_mca(XEN_GUEST_HANDLE_PARAM(xen_mc_t) u_xen_mc)
             if (log_cpus == NULL)
                 return x86_mcerr("do_mca cpuinfo", -ENOMEM);
             on_each_cpu(do_mc_get_cpu_info, log_cpus, 1);
-            if (!is_pv_32on64_vcpu(v)
+            if (!is_pv_32bit_vcpu(v)
                 ? copy_to_guest(mc_physcpuinfo.nat->info,
                                 log_cpus, nlcpu)
                 : copy_to_compat(mc_physcpuinfo.cmp->info,
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 29f3c1a..a8fe046 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -509,7 +509,7 @@ int vcpu_initialise(struct vcpu *v)
 
 void vcpu_destroy(struct vcpu *v)
 {
-    if ( is_pv_32on64_vcpu(v) )
+    if ( is_pv_32bit_vcpu(v) )
     {
         free_compat_arg_xlat(v);
         release_compat_l4(v);
@@ -1722,7 +1722,7 @@ unsigned long hypercall_create_continuation(
             curr->arch.hvm_vcpu.hcall_preempted = 1;
 
         if ( is_pv_vcpu(curr) ?
-             !is_pv_32on64_vcpu(curr) :
+             !is_pv_32bit_vcpu(curr) :
              curr->arch.hvm_vcpu.hcall_64bit )
         {
             for ( i = 0; *p != '\0'; i++ )
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index 9e08c9b..fd151c6 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -2652,7 +2652,7 @@ int vcpu_destroy_pagetables(struct vcpu *v)
     if ( rc )
         return rc;
 
-    if ( is_pv_32on64_vcpu(v) )
+    if ( is_pv_32bit_vcpu(v) )
     {
         l4tab = map_domain_page(mfn);
         mfn = l4e_get_pfn(*l4tab);
diff --git a/xen/arch/x86/trace.c b/xen/arch/x86/trace.c
index 64e9ad0..bd8596c 100644
--- a/xen/arch/x86/trace.c
+++ b/xen/arch/x86/trace.c
@@ -11,7 +11,7 @@ void __trace_hypercall_entry(void)
     struct cpu_user_regs *regs = guest_cpu_user_regs();
     unsigned long args[6];
 
-    if ( is_pv_32on64_vcpu(current) )
+    if ( is_pv_32bit_vcpu(current) )
     {
         args[0] = regs->ebx;
         args[1] = regs->ecx;
@@ -36,7 +36,7 @@ void __trace_hypercall_entry(void)
 void __trace_pv_trap(int trapnr, unsigned long eip,
                      int use_error_code, unsigned error_code)
 {
-    if ( is_pv_32on64_vcpu(current) )
+    if ( is_pv_32bit_vcpu(current) )
     {
         struct __packed {
             unsigned eip:32,
@@ -77,7 +77,7 @@ void __trace_pv_page_fault(unsigned long addr, unsigned 
error_code)
 {
     unsigned long eip = guest_cpu_user_regs()->eip;
 
-    if ( is_pv_32on64_vcpu(current) )
+    if ( is_pv_32bit_vcpu(current) )
     {
         struct __packed {
             u32 eip, addr, error_code;
@@ -108,7 +108,7 @@ void __trace_pv_page_fault(unsigned long addr, unsigned 
error_code)
 
 void __trace_trap_one_addr(unsigned event, unsigned long va)
 {
-    if ( is_pv_32on64_vcpu(current) )
+    if ( is_pv_32bit_vcpu(current) )
     {
         u32 d = va;
         __trace_var(event, 1, sizeof(d), &d);
@@ -123,7 +123,7 @@ void __trace_trap_one_addr(unsigned event, unsigned long va)
 void __trace_trap_two_addr(unsigned event, unsigned long va1,
                            unsigned long va2)
 {
-    if ( is_pv_32on64_vcpu(current) )
+    if ( is_pv_32bit_vcpu(current) )
     {
         struct __packed {
             u32 va1, va2;
@@ -156,7 +156,7 @@ void __trace_ptwr_emulation(unsigned long addr, 
l1_pgentry_t npte)
      * cases, "unsigned long" is the size of a guest virtual address.
      */
 
-    if ( is_pv_32on64_vcpu(current) )
+    if ( is_pv_32bit_vcpu(current) )
     {
         struct __packed {
             l1_pgentry_t pte;
diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c
index c634008..ac62f20 100644
--- a/xen/arch/x86/traps.c
+++ b/xen/arch/x86/traps.c
@@ -124,7 +124,7 @@ static void show_guest_stack(struct vcpu *v, const struct 
cpu_user_regs *regs)
     if ( is_hvm_vcpu(v) )
         return;
 
-    if ( is_pv_32on64_vcpu(v) )
+    if ( is_pv_32bit_vcpu(v) )
     {
         compat_show_guest_stack(v, regs, debug_stack_lines);
         return;
@@ -2382,7 +2382,7 @@ static int emulate_privileged_op(struct cpu_user_regs 
*regs)
         {
             unsigned long mfn;
             
-            if ( !is_pv_32on64_vcpu(v) )
+            if ( !is_pv_32bit_domain(currd) )
             {
                 mfn = pagetable_get_pfn(v->arch.guest_table);
                 *reg = xen_pfn_to_cr3(mfn_to_gmfn(currd, mfn));
@@ -2452,7 +2452,7 @@ static int emulate_privileged_op(struct cpu_user_regs 
*regs)
             unsigned long gfn;
             struct page_info *page;
 
-            gfn = !is_pv_32on64_vcpu(v)
+            gfn = !is_pv_32bit_domain(currd)
                 ? xen_cr3_to_pfn(*reg) : compat_cr3_to_pfn(*reg);
             page = get_page_from_gfn(currd, gfn, NULL, P2M_ALLOC);
             if ( page )
@@ -2504,19 +2504,19 @@ static int emulate_privileged_op(struct cpu_user_regs 
*regs)
         switch ( regs->_ecx )
         {
         case MSR_FS_BASE:
-            if ( is_pv_32on64_vcpu(v) )
+            if ( is_pv_32bit_domain(currd) )
                 goto fail;
             wrfsbase(msr_content);
             v->arch.pv_vcpu.fs_base = msr_content;
             break;
         case MSR_GS_BASE:
-            if ( is_pv_32on64_vcpu(v) )
+            if ( is_pv_32bit_domain(currd) )
                 goto fail;
             wrgsbase(msr_content);
             v->arch.pv_vcpu.gs_base_kernel = msr_content;
             break;
         case MSR_SHADOW_GS_BASE:
-            if ( is_pv_32on64_vcpu(v) )
+            if ( is_pv_32bit_domain(currd) )
                 goto fail;
             if ( wrmsr_safe(MSR_SHADOW_GS_BASE, msr_content) )
                 goto fail;
@@ -2675,18 +2675,18 @@ static int emulate_privileged_op(struct cpu_user_regs 
*regs)
         switch ( regs->_ecx )
         {
         case MSR_FS_BASE:
-            if ( is_pv_32on64_vcpu(v) )
+            if ( is_pv_32bit_domain(currd) )
                 goto fail;
             val = cpu_has_fsgsbase ? __rdfsbase() : v->arch.pv_vcpu.fs_base;
             goto rdmsr_writeback;
         case MSR_GS_BASE:
-            if ( is_pv_32on64_vcpu(v) )
+            if ( is_pv_32bit_domain(currd) )
                 goto fail;
             val = cpu_has_fsgsbase ? __rdgsbase()
                                    : v->arch.pv_vcpu.gs_base_kernel;
             goto rdmsr_writeback;
         case MSR_SHADOW_GS_BASE:
-            if ( is_pv_32on64_vcpu(v) )
+            if ( is_pv_32bit_domain(currd) )
                 goto fail;
             val = v->arch.pv_vcpu.gs_base_user;
             goto rdmsr_writeback;
@@ -3201,7 +3201,7 @@ void do_general_protection(struct cpu_user_regs *regs)
             return;
         }
     }
-    else if ( is_pv_32on64_vcpu(v) && regs->error_code )
+    else if ( is_pv_32bit_vcpu(v) && regs->error_code )
     {
         emulate_gate_op(regs);
         return;
diff --git a/xen/include/asm-x86/domain.h b/xen/include/asm-x86/domain.h
index 5eb6832..96bde65 100644
--- a/xen/include/asm-x86/domain.h
+++ b/xen/include/asm-x86/domain.h
@@ -15,7 +15,6 @@
 #define is_pv_32bit_domain(d)  ((d)->arch.is_32bit_pv)
 #define is_pv_32bit_vcpu(v)    (is_pv_32bit_domain((v)->domain))
 #define is_pv_32on64_domain(d) (is_pv_32bit_domain(d))
-#define is_pv_32on64_vcpu(v)   (is_pv_32on64_domain((v)->domain))
 
 #define is_hvm_pv_evtchn_domain(d) (has_hvm_container_domain(d) && \
         d->arch.hvm_domain.irq.callback_via_type == HVMIRQ_callback_vector)
diff --git a/xen/include/asm-x86/ldt.h b/xen/include/asm-x86/ldt.h
index aa77368..289ae19 100644
--- a/xen/include/asm-x86/ldt.h
+++ b/xen/include/asm-x86/ldt.h
@@ -15,7 +15,7 @@ static inline void load_LDT(struct vcpu *v)
     }
     else
     {
-        desc = (!is_pv_32on64_vcpu(v)
+        desc = (!is_pv_32bit_vcpu(v)
                 ? this_cpu(gdt_table) : this_cpu(compat_gdt_table))
                + LDT_ENTRY - FIRST_RESERVED_GDT_ENTRY;
         _set_tssldt_desc(desc, LDT_VIRT_START(v), ents*8-1, SYS_DESC_ldt);
diff --git a/xen/include/xen/tmem_xen.h b/xen/include/xen/tmem_xen.h
index 885ee21..c0d6831 100644
--- a/xen/include/xen/tmem_xen.h
+++ b/xen/include/xen/tmem_xen.h
@@ -285,7 +285,7 @@ static inline int tmem_get_tmemop_from_client(tmem_op_t 
*op, tmem_cli_op_t uops)
 #ifdef CONFIG_COMPAT
     if ( has_hvm_container_vcpu(current) ?
          hvm_guest_x86_mode(current) != 8 :
-         is_pv_32on64_vcpu(current) )
+         is_pv_32bit_vcpu(current) )
     {
         int rc;
         enum XLAT_tmem_op_u u;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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