From a51c00ce2017324b2ed522c55329aab196a7aafc Mon Sep 17 00:00:00 2001 From: kib Date: Sat, 7 Dec 2019 00:23:19 +0000 Subject: [PATCH] amd64: properly set the start of the io permission bitmap for BSP ... after the initial common TSS is copied into its final location during PCPU reallocation. Reported by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/pmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 841654562d76..2533c0b06d5b 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -1771,6 +1771,8 @@ pmap_bootstrap(vm_paddr_t *firstaddr) pcpu_init(&__pcpu[0], 0, sizeof(struct pcpu)); amd64_bsp_pcpu_init1(&__pcpu[0]); amd64_bsp_ist_init(&__pcpu[0]); + __pcpu[0].pc_common_tss.tss_iobase = sizeof(struct amd64tss) + + IOPERM_BITMAP_SIZE; memcpy(__pcpu[0].pc_gdt, temp_bsp_pcpu.pc_gdt, NGDT * sizeof(struct user_segment_descriptor)); gdt_segs[GPROC0_SEL].ssd_base = (uintptr_t)&__pcpu[0].pc_common_tss;