gdt_prepframes() is called with a number of pages, don't convert to a number trunk
authorbouyer <bouyer@NetBSD.org>
Thu, 06 Jul 2017 20:26:05 +0000
branchtrunk
changeset 252037 42c18ed69e11
parent 252036 71f357f8275d
child 252038 c8da5b21db8b
gdt_prepframes() is called with a number of pages, don't convert to a number of pages again. This didn't fail because we're called with only one page, and the conversion from '1' to pages resulted in 1 again.
sys/arch/xen/x86/cpu.c
--- a/sys/arch/xen/x86/cpu.c	Thu Jul 06 20:23:57 2017 +0000
+++ b/sys/arch/xen/x86/cpu.c	Thu Jul 06 20:26:05 2017 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.110 2017/03/23 18:08:06 maxv Exp $	*/
+/*	$NetBSD: cpu.c,v 1.111 2017/07/06 20:26:05 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.110 2017/03/23 18:08:06 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.111 2017/07/06 20:26:05 bouyer Exp $");
 
 #include "opt_ddb.h"
 #include "opt_multiprocessor.h"
@@ -762,7 +762,7 @@
 gdt_prepframes(paddr_t *frames, vaddr_t base, uint32_t entries)
 {
 	int i;
-	for (i = 0; i < roundup(entries, PAGE_SIZE) >> PAGE_SHIFT; i++) {
+	for (i = 0; i < entries; i++) {
 		frames[i] = ((paddr_t)xpmap_ptetomach(
 		    (pt_entry_t *)(base + (i << PAGE_SHIFT)))) >> PAGE_SHIFT;