Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/bouyer-xenpvh]: src/sys/arch/xen/x86 kpreempt_disable() only for x86_64 ...



details:   https://anonhg.NetBSD.org/src/rev/bfdbb4ac7a70
branches:  bouyer-xenpvh
changeset: 982924:bfdbb4ac7a70
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Sun Apr 12 17:16:58 2020 +0000

description:
kpreempt_disable() only for x86_64 (which calls pmap_changeprot_local)).
On i386 curcpu() is not valid yet and we don't need preemption disabled.

diffstat:

 sys/arch/xen/x86/xenfunc.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (38 lines):

diff -r 54e72e384f83 -r bfdbb4ac7a70 sys/arch/xen/x86/xenfunc.c
--- a/sys/arch/xen/x86/xenfunc.c        Sun Apr 12 16:35:49 2020 +0000
+++ b/sys/arch/xen/x86/xenfunc.c        Sun Apr 12 17:16:58 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xenfunc.c,v 1.26.8.1 2020/04/11 18:26:07 bouyer Exp $  */
+/*     $NetBSD: xenfunc.c,v 1.26.8.2 2020/04/12 17:16:58 bouyer Exp $  */
 
 /*
  * Copyright (c) 2004 Christian Limpach.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xenfunc.c,v 1.26.8.1 2020/04/11 18:26:07 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xenfunc.c,v 1.26.8.2 2020/04/12 17:16:58 bouyer Exp $");
 
 #include <sys/param.h>
 
@@ -61,7 +61,9 @@
         * will be available at the boot stage when this is called.
         */
        static char xen_idt_page[PAGE_SIZE] __attribute__((__aligned__ (PAGE_SIZE)));
+#if defined(__x86_64__)
        kpreempt_disable();
+#endif
        memset(xen_idt_page, 0, PAGE_SIZE);
        
        struct trap_info *xen_idt = (void * )xen_idt_page;
@@ -96,8 +98,8 @@
 #if defined(__x86_64__)
        /* reset */
        pmap_changeprot_local((vaddr_t) xen_idt, VM_PROT_READ|VM_PROT_WRITE);
+       kpreempt_enable();
 #endif /* __x86_64 */
-       kpreempt_enable();
 }
 
 void



Home | Main Index | Thread Index | Old Index