aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2026-05-29 07:32:41 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2026-06-01 16:35:33 +0000
commit606d3cb1be5fd594c1f51addd063e7c13e16bdbc (patch)
treec79ad72d3035e2fffe4a3ec10c95395cc16e3163
parent72e34b3e3907d5fd63abf7b2246cae80641769b3 (diff)
amd64: do not switch back and restore UEFI IDT in wrmsr_early_safe_end()
The memory where the pre-OS IDT was located might be already consumed by kernel. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D57321
-rw-r--r--sys/amd64/amd64/machdep.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c
index 79bef08f8a64..ab9edfe2c68f 100644
--- a/sys/amd64/amd64/machdep.c
+++ b/sys/amd64/amd64/machdep.c
@@ -1827,7 +1827,6 @@ clear_pcb_flags(struct pcb *pcb, const u_int flags)
}
extern const char wrmsr_early_safe_gp_handler[];
-static struct region_descriptor wrmsr_early_safe_orig_efi_idt;
void
wrmsr_early_safe_start(void)
@@ -1836,7 +1835,6 @@ wrmsr_early_safe_start(void)
struct gate_descriptor *gpf_descr;
int i;
- sidt(&wrmsr_early_safe_orig_efi_idt);
efi_idt.rd_limit = 32 * sizeof(idt0[0]);
efi_idt.rd_base = (uintptr_t)idt0;
lidt(&efi_idt);
@@ -1857,12 +1855,6 @@ wrmsr_early_safe_start(void)
void
wrmsr_early_safe_end(void)
{
- int i;
-
- lidt(&wrmsr_early_safe_orig_efi_idt);
-
- for (i = 0; i < 32; i++)
- memset_early(&idt0[i], 0, sizeof(idt0[0]));
}
int