Re: [PATCH v4 1/6] x86/paravirt: remove 32-bit support from PARAVIRT_XXL

2020-08-16 Thread boris . ostrovsky


On 8/15/20 6:06 AM, Juergen Gross wrote:
> The last 32-bit user of stuff under CONFIG_PARAVIRT_XXL is gone.
>
> Remove 32-bit specific parts.
>
> Signed-off-by: Juergen Gross 


Reviewed-by: Boris Ostrovsky 


(There is another '#ifdef CONFIG_X86_64' in paravirt.h, at the bottom,
that can be removed as well)




[PATCH v4 1/6] x86/paravirt: remove 32-bit support from PARAVIRT_XXL

2020-08-15 Thread Juergen Gross
The last 32-bit user of stuff under CONFIG_PARAVIRT_XXL is gone.

Remove 32-bit specific parts.

Signed-off-by: Juergen Gross 
---
 arch/x86/entry/vdso/vdso32/vclock_gettime.c |   1 +
 arch/x86/include/asm/paravirt.h | 120 ++--
 arch/x86/include/asm/paravirt_types.h   |  21 
 arch/x86/include/asm/pgtable-3level_types.h |   5 -
 arch/x86/include/asm/segment.h  |   4 -
 arch/x86/kernel/cpu/common.c|   8 --
 arch/x86/kernel/kprobes/core.c  |   1 -
 arch/x86/kernel/kprobes/opt.c   |   1 -
 arch/x86/kernel/paravirt.c  |  18 ---
 arch/x86/kernel/paravirt_patch.c|  17 ---
 arch/x86/xen/enlighten_pv.c |   6 -
 11 files changed, 13 insertions(+), 189 deletions(-)

diff --git a/arch/x86/entry/vdso/vdso32/vclock_gettime.c 
b/arch/x86/entry/vdso/vdso32/vclock_gettime.c
index 84a4a73f77f7..283ed9d00426 100644
--- a/arch/x86/entry/vdso/vdso32/vclock_gettime.c
+++ b/arch/x86/entry/vdso/vdso32/vclock_gettime.c
@@ -14,6 +14,7 @@
 #undef CONFIG_ILLEGAL_POINTER_VALUE
 #undef CONFIG_SPARSEMEM_VMEMMAP
 #undef CONFIG_NR_CPUS
+#undef CONFIG_PARAVIRT_XXL
 
 #define CONFIG_X86_32 1
 #define CONFIG_PGTABLE_LEVELS 2
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
index 3d2afecde50c..25c7a73461f6 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -160,8 +160,6 @@ static inline void wbinvd(void)
PVOP_VCALL0(cpu.wbinvd);
 }
 
-#define get_kernel_rpl()  (pv_info.kernel_rpl)
-
 static inline u64 paravirt_read_msr(unsigned msr)
 {
return PVOP_CALL1(u64, cpu.read_msr, msr);
@@ -277,12 +275,10 @@ static inline void load_TLS(struct thread_struct *t, 
unsigned cpu)
PVOP_VCALL2(cpu.load_tls, t, cpu);
 }
 
-#ifdef CONFIG_X86_64
 static inline void load_gs_index(unsigned int gs)
 {
PVOP_VCALL1(cpu.load_gs_index, gs);
 }
-#endif
 
 static inline void write_ldt_entry(struct desc_struct *dt, int entry,
   const void *desc)
@@ -375,52 +371,22 @@ static inline void paravirt_release_p4d(unsigned long pfn)
 
 static inline pte_t __pte(pteval_t val)
 {
-   pteval_t ret;
-
-   if (sizeof(pteval_t) > sizeof(long))
-   ret = PVOP_CALLEE2(pteval_t, mmu.make_pte, val, (u64)val >> 32);
-   else
-   ret = PVOP_CALLEE1(pteval_t, mmu.make_pte, val);
-
-   return (pte_t) { .pte = ret };
+   return (pte_t) { PVOP_CALLEE1(pteval_t, mmu.make_pte, val) };
 }
 
 static inline pteval_t pte_val(pte_t pte)
 {
-   pteval_t ret;
-
-   if (sizeof(pteval_t) > sizeof(long))
-   ret = PVOP_CALLEE2(pteval_t, mmu.pte_val,
-  pte.pte, (u64)pte.pte >> 32);
-   else
-   ret = PVOP_CALLEE1(pteval_t, mmu.pte_val, pte.pte);
-
-   return ret;
+   return PVOP_CALLEE1(pteval_t, mmu.pte_val, pte.pte);
 }
 
 static inline pgd_t __pgd(pgdval_t val)
 {
-   pgdval_t ret;
-
-   if (sizeof(pgdval_t) > sizeof(long))
-   ret = PVOP_CALLEE2(pgdval_t, mmu.make_pgd, val, (u64)val >> 32);
-   else
-   ret = PVOP_CALLEE1(pgdval_t, mmu.make_pgd, val);
-
-   return (pgd_t) { ret };
+   return (pgd_t) { PVOP_CALLEE1(pgdval_t, mmu.make_pgd, val) };
 }
 
 static inline pgdval_t pgd_val(pgd_t pgd)
 {
-   pgdval_t ret;
-
-   if (sizeof(pgdval_t) > sizeof(long))
-   ret =  PVOP_CALLEE2(pgdval_t, mmu.pgd_val,
-   pgd.pgd, (u64)pgd.pgd >> 32);
-   else
-   ret =  PVOP_CALLEE1(pgdval_t, mmu.pgd_val, pgd.pgd);
-
-   return ret;
+   return PVOP_CALLEE1(pgdval_t, mmu.pgd_val, pgd.pgd);
 }
 
 #define  __HAVE_ARCH_PTEP_MODIFY_PROT_TRANSACTION
@@ -438,78 +404,40 @@ static inline void ptep_modify_prot_commit(struct 
vm_area_struct *vma, unsigned
   pte_t *ptep, pte_t old_pte, pte_t 
pte)
 {
 
-   if (sizeof(pteval_t) > sizeof(long))
-   /* 5 arg words */
-   pv_ops.mmu.ptep_modify_prot_commit(vma, addr, ptep, pte);
-   else
-   PVOP_VCALL4(mmu.ptep_modify_prot_commit,
-   vma, addr, ptep, pte.pte);
+   PVOP_VCALL4(mmu.ptep_modify_prot_commit, vma, addr, ptep, pte.pte);
 }
 
 static inline void set_pte(pte_t *ptep, pte_t pte)
 {
-   if (sizeof(pteval_t) > sizeof(long))
-   PVOP_VCALL3(mmu.set_pte, ptep, pte.pte, (u64)pte.pte >> 32);
-   else
-   PVOP_VCALL2(mmu.set_pte, ptep, pte.pte);
+   PVOP_VCALL2(mmu.set_pte, ptep, pte.pte);
 }
 
 static inline void set_pte_at(struct mm_struct *mm, unsigned long addr,
  pte_t *ptep, pte_t pte)
 {
-   if (sizeof(pteval_t) > sizeof(long))
-   /* 5 arg words */
-   pv_ops.mmu.set_pte_at(mm, addr, ptep, pte);
-   else
-   PVOP_VCALL4(mmu.set_pte_at, mm, addr, ptep, pte.pte);
+