FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

x86/multikernel: isolate LAPIC timer policy · multikernel/linux@b715339 · GitHub

forked from torvalds/linux

Commit b715339

Browse files
committed
x86/multikernel: isolate LAPIC timer policy
Keep spawned kernels from rejecting their calibrated LAPIC timer. The host-owned platform timer cannot advance local jiffies. Keep the policy in arch/x86/multikernel and one predicate in APIC code. Signed-off-by: Nikolay Nikolaev <nicknickolaev@gmail.com>
1 parent f45edca commit b715339

4 files changed

Lines changed: 31 additions & 2 deletions

File tree

‎arch/x86/include/asm/multikernel.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,16 @@ struct mk_pci_host_bridge;
7171

7272
#ifdef CONFIG_MULTIKERNEL
7373
void __init x86_multikernel_pci_platform_init(void);
74+
bool x86_multikernel_skip_apic_timer_verify(void);
7475
int mk_arch_snapshot_pci_host_bridges(const struct mk_instance *instance,
7576
struct mk_pci_host_bridge *bridges,
7677
size_t capacity);
7778
#else
7879
static inline void x86_multikernel_pci_platform_init(void) { }
80+
static inline bool x86_multikernel_skip_apic_timer_verify(void)
81+
{
82+
return false;
83+
}
7984
#endif
8085

8186
#endif /* __ASSEMBLY__ */

‎arch/x86/kernel/apic/apic.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
#include <asm/intel-family.h>
6868
#include <asm/irq_regs.h>
6969
#include <asm/cpu.h>
70+
#include <asm/multikernel.h>
7071

7172
#include "local.h"
7273

@@ -923,7 +924,8 @@ static int __init calibrate_APIC_clock(void)
923924
* timer based calibration, if a global clockevent device is
924925
* available.
925926
*/
926-
if (!pm_referenced && global_clock_event) {
927+
if (!pm_referenced && global_clock_event &&
928+
!x86_multikernel_skip_apic_timer_verify()) {
927929
apic_pr_verbose("... verify APIC timer\n");
928930

929931
/*

‎arch/x86/multikernel/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# Makefile for multikernel spawn support
44
#
55

6-
obj-y += spawn.o pci.o direct_boot.o head_64.o
6+
obj-y += spawn.o pci.o timer.o direct_boot.o head_64.o

‎arch/x86/multikernel/timer.c‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// SPDX-License-Identifier: GPL-2.0-only
2+
/* x86 timer policy for multikernel spawn kernels. */
3+
4+
#include <linux/printk.h>
5+
6+
#include <asm/bootparam.h>
7+
#include <asm/multikernel.h>
8+
#include <asm/setup.h>
9+
10+
bool x86_multikernel_skip_apic_timer_verify(void)
11+
{
12+
if (boot_params.hdr.hardware_subarch != X86_SUBARCH_MULTIKERNEL)
13+
return false;
14+
15+
/*
16+
* A spawn kernel does not own the platform timer interrupt used by the
17+
* legacy verification. Its LAPIC was calibrated against the TSC, while
18+
* jiffies driven by the primary kernel's timer cannot advance here.
19+
*/
20+
pr_info("APIC timer: skipping legacy timer verification for multikernel\n");
21+
return true;
22+
}

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL