Re: [PATCH 1/2] x86/xen: remove 32-bit Xen PV guest support

2019-07-15 Thread Juergen Gross

On 15.07.19 17:44, Boris Ostrovsky wrote:



diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile
index 084de77a109e..d42737f31304 100644
--- a/arch/x86/xen/Makefile
+++ b/arch/x86/xen/Makefile
@@ -1,5 +1,5 @@
  # SPDX-License-Identifier: GPL-2.0
-OBJECT_FILES_NON_STANDARD_xen-asm_$(BITS).o := y
+OBJECT_FILES_NON_STANDARD_xen-asm_64.o := y
  
  ifdef CONFIG_FUNCTION_TRACER

  # Do not profile debug and lowlevel utilities
@@ -34,7 +34,7 @@ obj-$(CONFIG_XEN_PV)  += mmu_pv.o
  obj-$(CONFIG_XEN_PV)  += irq.o
  obj-$(CONFIG_XEN_PV)  += multicalls.o
  obj-$(CONFIG_XEN_PV)  += xen-asm.o
-obj-$(CONFIG_XEN_PV)   += xen-asm_$(BITS).o
+obj-$(CONFIG_XEN_PV)   += xen-asm_64.o


We should be able to merge xen-asm_64.S into xen-asm.S, shouldn't we?


Yes, probably a good idea to add that.


@@ -1312,15 +1290,7 @@ asmlinkage __visible void __init xen_start_kernel(void)
  
  	/* keep using Xen gdt for now; no urgent need to change it */
  
-#ifdef CONFIG_X86_32

-   pv_info.kernel_rpl = 1;
-   if (xen_feature(XENFEAT_supervisor_mode_kernel))
-   pv_info.kernel_rpl = 0;
-#else
pv_info.kernel_rpl = 0;


Is kernel_rpl needed anymore?


Yes, this can be dropped, together with get_kernel_rpl().


Juergen


Re: [PATCH 1/2] x86/xen: remove 32-bit Xen PV guest support

2019-07-15 Thread Boris Ostrovsky


> diff --git a/arch/x86/xen/Makefile b/arch/x86/xen/Makefile
> index 084de77a109e..d42737f31304 100644
> --- a/arch/x86/xen/Makefile
> +++ b/arch/x86/xen/Makefile
> @@ -1,5 +1,5 @@
>  # SPDX-License-Identifier: GPL-2.0
> -OBJECT_FILES_NON_STANDARD_xen-asm_$(BITS).o := y
> +OBJECT_FILES_NON_STANDARD_xen-asm_64.o := y
>  
>  ifdef CONFIG_FUNCTION_TRACER
>  # Do not profile debug and lowlevel utilities
> @@ -34,7 +34,7 @@ obj-$(CONFIG_XEN_PV)+= mmu_pv.o
>  obj-$(CONFIG_XEN_PV) += irq.o
>  obj-$(CONFIG_XEN_PV) += multicalls.o
>  obj-$(CONFIG_XEN_PV) += xen-asm.o
> -obj-$(CONFIG_XEN_PV) += xen-asm_$(BITS).o
> +obj-$(CONFIG_XEN_PV) += xen-asm_64.o

We should be able to merge xen-asm_64.S into xen-asm.S, shouldn't we?


> @@ -1312,15 +1290,7 @@ asmlinkage __visible void __init xen_start_kernel(void)
>  
>   /* keep using Xen gdt for now; no urgent need to change it */
>  
> -#ifdef CONFIG_X86_32
> - pv_info.kernel_rpl = 1;
> - if (xen_feature(XENFEAT_supervisor_mode_kernel))
> - pv_info.kernel_rpl = 0;
> -#else
>   pv_info.kernel_rpl = 0;

Is kernel_rpl needed anymore?


-boris




[PATCH 1/2] x86/xen: remove 32-bit Xen PV guest support

2019-07-15 Thread Juergen Gross
Xen is requiring 64-bit machines today. There is no need to carry the
burden of 32-bit PV guest support in the kernel any longer, as new
guests can be either HVM or PVH, or they can use a 64 bit kernel.

Remove the 32-bit Xen PV support from the kernel.

Signed-off-by: Juergen Gross 
---
 arch/x86/entry/entry_32.S  |  93 
 arch/x86/include/asm/proto.h   |   2 +-
 arch/x86/include/asm/segment.h |   2 +-
 arch/x86/include/asm/traps.h   |   2 +-
 arch/x86/xen/Kconfig   |   3 +-
 arch/x86/xen/Makefile  |   4 +-
 arch/x86/xen/apic.c|  17 ---
 arch/x86/xen/enlighten_pv.c|  45 +-
 arch/x86/xen/mmu_pv.c  | 326 -
 arch/x86/xen/p2m.c |   4 -
 arch/x86/xen/setup.c   |  44 +-
 arch/x86/xen/smp_pv.c  |  19 +--
 arch/x86/xen/xen-asm.S |  14 --
 arch/x86/xen/xen-asm_32.S  | 207 --
 arch/x86/xen/xen-head.S|   6 -
 arch/x86/xen/xen-ops.h |   5 -
 drivers/xen/Kconfig|   4 +-
 17 files changed, 42 insertions(+), 755 deletions(-)
 delete mode 100644 arch/x86/xen/xen-asm_32.S

diff --git a/arch/x86/entry/entry_32.S b/arch/x86/entry/entry_32.S
index 7b23431be5cb..d4464af28212 100644
--- a/arch/x86/entry/entry_32.S
+++ b/arch/x86/entry/entry_32.S
@@ -787,16 +787,6 @@ GLOBAL(__begin_SYSENTER_singlestep_region)
  * will ignore all of the single-step traps generated in this range.
  */
 
-#ifdef CONFIG_XEN_PV
-/*
- * Xen doesn't set %esp to be precisely what the normal SYSENTER
- * entry point expects, so fix it up before using the normal path.
- */
-ENTRY(xen_sysenter_target)
-   addl$5*4, %esp  /* remove xen-provided frame */
-   jmp .Lsysenter_past_esp
-#endif
-
 /*
  * 32-bit SYSENTER entry.
  *
@@ -1249,89 +1239,6 @@ ENTRY(spurious_interrupt_bug)
jmp common_exception
 END(spurious_interrupt_bug)
 
-#ifdef CONFIG_XEN_PV
-ENTRY(xen_hypervisor_callback)
-   pushl   $-1 /* orig_ax = -1 => not a system 
call */
-   SAVE_ALL
-   ENCODE_FRAME_POINTER
-   TRACE_IRQS_OFF
-
-   /*
-* Check to see if we got the event in the critical
-* region in xen_iret_direct, after we've reenabled
-* events and checked for pending events.  This simulates
-* iret instruction's behaviour where it delivers a
-* pending interrupt when enabling interrupts:
-*/
-   movlPT_EIP(%esp), %eax
-   cmpl$xen_iret_start_crit, %eax
-   jb  1f
-   cmpl$xen_iret_end_crit, %eax
-   jae 1f
-
-   jmp xen_iret_crit_fixup
-
-ENTRY(xen_do_upcall)
-1: mov %esp, %eax
-   callxen_evtchn_do_upcall
-#ifndef CONFIG_PREEMPT
-   callxen_maybe_preempt_hcall
-#endif
-   jmp ret_from_intr
-ENDPROC(xen_hypervisor_callback)
-
-/*
- * Hypervisor uses this for application faults while it executes.
- * We get here for two reasons:
- *  1. Fault while reloading DS, ES, FS or GS
- *  2. Fault while executing IRET
- * Category 1 we fix up by reattempting the load, and zeroing the segment
- * register if the load fails.
- * Category 2 we fix up by jumping to do_iret_error. We cannot use the
- * normal Linux return path in this case because if we use the IRET hypercall
- * to pop the stack frame we end up in an infinite loop of failsafe callbacks.
- * We distinguish between categories by maintaining a status value in EAX.
- */
-ENTRY(xen_failsafe_callback)
-   pushl   %eax
-   movl$1, %eax
-1: mov 4(%esp), %ds
-2: mov 8(%esp), %es
-3: mov 12(%esp), %fs
-4: mov 16(%esp), %gs
-   /* EAX == 0 => Category 1 (Bad segment)
-  EAX != 0 => Category 2 (Bad IRET) */
-   testl   %eax, %eax
-   popl%eax
-   lea 16(%esp), %esp
-   jz  5f
-   jmp iret_exc
-5: pushl   $-1 /* orig_ax = -1 => not a system 
call */
-   SAVE_ALL
-   ENCODE_FRAME_POINTER
-   jmp ret_from_exception
-
-.section .fixup, "ax"
-6: xorl%eax, %eax
-   movl%eax, 4(%esp)
-   jmp 1b
-7: xorl%eax, %eax
-   movl%eax, 8(%esp)
-   jmp 2b
-8: xorl%eax, %eax
-   movl%eax, 12(%esp)
-   jmp 3b
-9: xorl%eax, %eax
-   movl%eax, 16(%esp)
-   jmp 4b
-.previous
-   _ASM_EXTABLE(1b, 6b)
-   _ASM_EXTABLE(2b, 7b)
-   _ASM_EXTABLE(3b, 8b)
-   _ASM_EXTABLE(4b, 9b)
-ENDPROC(xen_failsafe_callback)
-#endif /* CONFIG_XEN_PV */
-
 #ifdef CONFIG_XEN_PVHVM
 BUILD_INTERRUPT3(xen_hvm_callback_vector, HYPERVISOR_CALLBACK_VECTOR,
 xen_evtchn_do_upcall)
diff --git a/arch/x86/include/asm/proto.h b/arch/x86/include/asm/proto.h
index 6e81788a30c1..e5a13a138b01 100644
--- a/arch/x86/include/asm/proto.h
+++ b/arch/x86/include/asm/proto.h
@@ -25,7 +25,7 @@ void entry_SYSENTER_compat(void);
 void