Module Name:    src
Committed By:   cherry
Date:           Sat Aug  6 14:05:35 UTC 2011

Modified Files:
        src/sys/arch/i386/i386 [cherry-xenmp]: gdt.c

Log Message:
gdtgrow() must extend the gdt size on all cpus, not just the primary


To generate a diff of this commit:
cvs rdiff -u -r1.50.10.1 -r1.50.10.2 src/sys/arch/i386/i386/gdt.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/i386/i386/gdt.c
diff -u src/sys/arch/i386/i386/gdt.c:1.50.10.1 src/sys/arch/i386/i386/gdt.c:1.50.10.2
--- src/sys/arch/i386/i386/gdt.c:1.50.10.1	Sun Jul 31 20:49:10 2011
+++ src/sys/arch/i386/i386/gdt.c	Sat Aug  6 14:05:35 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: gdt.c,v 1.50.10.1 2011/07/31 20:49:10 cherry Exp $	*/
+/*	$NetBSD: gdt.c,v 1.50.10.2 2011/08/06 14:05:35 cherry Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.50.10.1 2011/07/31 20:49:10 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.50.10.2 2011/08/06 14:05:35 cherry Exp $");
 
 #include "opt_multiprocessor.h"
 #include "opt_xen.h"
@@ -266,15 +266,17 @@
 			gdt_size[which] = MINGDTSIZ;
 			new_len = gdt_size[which] * sizeof(gdt[0]);
 		}
-		for(va = (vaddr_t)(cpu_info_primary.ci_gdt) + old_len + max_len;
-		    va < (vaddr_t)(cpu_info_primary.ci_gdt) + new_len + max_len;
-		    va += PAGE_SIZE) {
-			while ((pg = uvm_pagealloc(NULL, 0, NULL, UVM_PGA_ZERO))
-			    == NULL) {
-				uvm_wait("gdt_grow");
+		for (CPU_INFO_FOREACH(cii, ci)) {
+			for(va = (vaddr_t)(ci->ci_gdt) + old_len + max_len;
+			    va < (vaddr_t)(ci->ci_gdt) + new_len + max_len;
+			    va += PAGE_SIZE) {
+				while ((pg = uvm_pagealloc(NULL, 0, NULL, UVM_PGA_ZERO))
+				       == NULL) {
+					uvm_wait("gdt_grow");
+				}
+				pmap_kenter_pa(va, VM_PAGE_TO_PHYS(pg),
+					       VM_PROT_READ | VM_PROT_WRITE, 0);
 			}
-			pmap_kenter_pa(va, VM_PAGE_TO_PHYS(pg),
-			    VM_PROT_READ | VM_PROT_WRITE, 0);
 		}
 		return;
 	}

Reply via email to