Module Name: src Committed By: bouyer Date: Sat Jul 4 09:03:55 UTC 2020
Modified Files: src/sys/arch/x86/x86: idt.c Log Message: Fix unset_idtgate() for XENPV, pointed out by yamaguchi@ To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x86/x86/idt.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/x86/x86/idt.c diff -u src/sys/arch/x86/x86/idt.c:1.11 src/sys/arch/x86/x86/idt.c:1.12 --- src/sys/arch/x86/x86/idt.c:1.11 Mon Jun 17 06:38:30 2019 +++ src/sys/arch/x86/x86/idt.c Sat Jul 4 09:03:54 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: idt.c,v 1.11 2019/06/17 06:38:30 msaitoh Exp $ */ +/* $NetBSD: idt.c,v 1.12 2020/07/04 09:03:54 bouyer Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2000, 2009 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: idt.c,v 1.11 2019/06/17 06:38:30 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: idt.c,v 1.12 2020/07/04 09:03:54 bouyer Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -132,7 +132,7 @@ void unset_idtgate(struct trap_info *xen_idd) { #if defined(__x86_64__) - vaddr_t xen_idt_vaddr = ((vaddr_t) xen_idd) & PAGE_MASK; + vaddr_t xen_idt_vaddr = ((vaddr_t) xen_idd) & ~PAGE_MASK; /* Make it writeable, so we can update the values. */ pmap_changeprot_local(xen_idt_vaddr, VM_PROT_READ | VM_PROT_WRITE);