From 5edcde3cd47b8c3e6dbf74e21c923015c202853d Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Mon, 31 Jul 2017 01:15:25 +0200 Subject: [PATCH] check supportet LVT level before disabling LVT_TSR & LVT_PMV --- arch/x86/kernel/apic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/apic.c b/arch/x86/kernel/apic.c index 317ad22f4..033ebda04 100644 --- a/arch/x86/kernel/apic.c +++ b/arch/x86/kernel/apic.c @@ -1063,8 +1063,10 @@ void shutdown_system(void) if (if_bootprocessor) LOG_INFO("Disable APIC\n"); - lapic_write(APIC_LVT_TSR, 0x10000); // disable thermal sensor interrupt - lapic_write(APIC_LVT_PMC, 0x10000); // disable performance counter interrupt + if (max_lvt >= 4) + lapic_write(APIC_LVT_TSR, 0x10000); // disable thermal sensor interrupt + if (max_lvt >= 5) + lapic_write(APIC_LVT_PMC, 0x10000); // disable performance counter interrupt lapic_write(APIC_SVR, 0x00); // disable the apic // disable x2APIC