From c42877e34fbb8508684d8417d95a7e92a51c2caf Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 29 Nov 2023 14:26:31 +0000 Subject: [PATCH] Revert "arm64/arm: xen: enlighten: Fix KPTI checks" This reverts commit 2836c72e8d60ce50bb7b7bc8f4c6f599882c3d04 which is commit 20f3b8eafe0ba5d3c69d5011a9b07739e9645132 upstream. It breaks the Android ABI and we do not care about Xen on Android, so it is safe to revert. Bug: 161946584 Change-Id: I4bf8a87650256a5f4b2faee626557604631ee286 Signed-off-by: Greg Kroah-Hartman --- arch/arm/xen/enlighten.c | 25 +++++++++---------------- include/linux/cpuhotplug.h | 1 - 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index b647306eb160..93c8ccbf2982 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -164,6 +164,9 @@ static int xen_starting_cpu(unsigned int cpu) BUG_ON(err); per_cpu(xen_vcpu, cpu) = vcpup; + if (!xen_kernel_unmapped_at_usr()) + xen_setup_runstate_info(cpu); + after_register_vcpu_info: enable_percpu_irq(xen_events_irq, 0); return 0; @@ -520,6 +523,9 @@ static int __init xen_guest_init(void) return -EINVAL; } + if (!xen_kernel_unmapped_at_usr()) + xen_time_setup_guest(); + if (xen_initial_domain()) pvclock_gtod_register_notifier(&xen_pvclock_gtod_notifier); @@ -529,13 +535,7 @@ static int __init xen_guest_init(void) } early_initcall(xen_guest_init); -static int xen_starting_runstate_cpu(unsigned int cpu) -{ - xen_setup_runstate_info(cpu); - return 0; -} - -static int __init xen_late_init(void) +static int __init xen_pm_init(void) { if (!xen_domain()) return -ENODEV; @@ -548,16 +548,9 @@ static int __init xen_late_init(void) do_settimeofday64(&ts); } - if (xen_kernel_unmapped_at_usr()) - return 0; - - xen_time_setup_guest(); - - return cpuhp_setup_state(CPUHP_AP_ARM_XEN_RUNSTATE_STARTING, - "arm/xen_runstate:starting", - xen_starting_runstate_cpu, NULL); + return 0; } -late_initcall(xen_late_init); +late_initcall(xen_pm_init); /* empty stubs */ diff --git a/include/linux/cpuhotplug.h b/include/linux/cpuhotplug.h index e523d1241c8e..310ecf18a253 100644 --- a/include/linux/cpuhotplug.h +++ b/include/linux/cpuhotplug.h @@ -191,7 +191,6 @@ enum cpuhp_state { /* Must be the last timer callback */ CPUHP_AP_DUMMY_TIMER_STARTING, CPUHP_AP_ARM_XEN_STARTING, - CPUHP_AP_ARM_XEN_RUNSTATE_STARTING, CPUHP_AP_ARM_CORESIGHT_STARTING, CPUHP_AP_ARM_CORESIGHT_CTI_STARTING, CPUHP_AP_ARM64_ISNDEP_STARTING,