From f407f5fb880bf0ffc0edbc139e768e3f0e22ee03 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 5 Apr 2018 11:03:05 +0000 Subject: [PATCH] Make the INTO instruction operational in 32bit mode. Having the IDT entry specify ring 0 DPL caused delivery of #GP instead of #OF. The instruction is not valid in 64bit mode, which probably explains why the IDT entry for #OF was initially set this way. It is interesting to note that the BOUND instruction works with the IDT #BR entry DPL 0, most likely CPU considers #BR from BOUND as generated by a machine, not user. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- sys/amd64/amd64/machdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 8a4720a6991..a24546df231 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1636,7 +1636,7 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) setidt(IDT_BP, pti ? &IDTVEC(bpt_pti) : &IDTVEC(bpt), SDT_SYSIGT, SEL_UPL, 0); setidt(IDT_OF, pti ? &IDTVEC(ofl_pti) : &IDTVEC(ofl), SDT_SYSIGT, - SEL_KPL, 0); + SEL_UPL, 0); setidt(IDT_BR, pti ? &IDTVEC(bnd_pti) : &IDTVEC(bnd), SDT_SYSIGT, SEL_KPL, 0); setidt(IDT_UD, pti ? &IDTVEC(ill_pti) : &IDTVEC(ill), SDT_SYSIGT, -- 2.45.0