forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/arch/x86/kernel/reboot.c
....@@ -10,14 +10,14 @@
1010 #include <linux/sched.h>
1111 #include <linux/tboot.h>
1212 #include <linux/delay.h>
13
-#include <linux/frame.h>
13
+#include <linux/objtool.h>
14
+#include <linux/pgtable.h>
1415 #include <acpi/reboot.h>
1516 #include <asm/io.h>
1617 #include <asm/apic.h>
1718 #include <asm/io_apic.h>
1819 #include <asm/desc.h>
1920 #include <asm/hpet.h>
20
-#include <asm/pgtable.h>
2121 #include <asm/proto.h>
2222 #include <asm/reboot_fixups.h>
2323 #include <asm/reboot.h>
....@@ -113,17 +113,9 @@
113113 spin_unlock(&rtc_lock);
114114
115115 /*
116
- * Switch back to the initial page table.
116
+ * Switch to the trampoline page table.
117117 */
118
-#ifdef CONFIG_X86_32
119
- load_cr3(initial_page_table);
120
-#else
121
- write_cr3(real_mode_header->trampoline_pgd);
122
-
123
- /* Exiting long mode will fail if CR4.PCIDE is set. */
124
- if (static_cpu_has(X86_FEATURE_PCID))
125
- cr4_clear_bits(X86_CR4_PCIDE);
126
-#endif
118
+ load_trampoline_pgtable();
127119
128120 /* Jump to the identity-mapped low memory code */
129121 #ifdef CONFIG_X86_32
....@@ -563,7 +555,6 @@
563555
564556 /* Halt and exit VMX root operation on the other CPUs. */
565557 nmi_shootdown_cpus(vmxoff_nmi);
566
-
567558 }
568559 }
569560
....@@ -655,7 +646,7 @@
655646
656647 case BOOT_CF9_FORCE:
657648 port_cf9_safe = true;
658
- /* Fall through */
649
+ fallthrough;
659650
660651 case BOOT_CF9_SAFE:
661652 if (port_cf9_safe) {
....@@ -837,11 +828,6 @@
837828 return NMI_HANDLED;
838829 }
839830
840
-static void smp_send_nmi_allbutself(void)
841
-{
842
- apic->send_IPI_allbutself(NMI_VECTOR);
843
-}
844
-
845831 /*
846832 * Halt all other CPUs, calling the specified function on each of them
847833 *
....@@ -870,7 +856,7 @@
870856 */
871857 wmb();
872858
873
- smp_send_nmi_allbutself();
859
+ apic_send_IPI_allbutself(NMI_VECTOR);
874860
875861 /* Kick CPUs looping in NMI context. */
876862 WRITE_ONCE(crash_ipi_issued, 1);