Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/i386/i386 Put a limit in the percpu segment, so we ...
details: https://anonhg.NetBSD.org/src/rev/ec8d4efeac21
branches: trunk
changeset: 349648:ec8d4efeac21
user: maxv <maxv%NetBSD.org@localhost>
date: Sat Dec 17 14:27:53 2016 +0000
description:
Put a limit in the percpu segment, so we can detect overflows on %fs.
diffstat:
sys/arch/i386/i386/gdt.c | 12 ++++++------
sys/arch/i386/i386/machdep.c | 8 ++++----
2 files changed, 10 insertions(+), 10 deletions(-)
diffs (69 lines):
diff -r 22bd1a25b42a -r ec8d4efeac21 sys/arch/i386/i386/gdt.c
--- a/sys/arch/i386/i386/gdt.c Sat Dec 17 13:49:05 2016 +0000
+++ b/sys/arch/i386/i386/gdt.c Sat Dec 17 14:27:53 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gdt.c,v 1.55 2016/08/20 19:46:54 christos Exp $ */
+/* $NetBSD: gdt.c,v 1.56 2016/12/17 14:27:53 maxv 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.55 2016/08/20 19:46:54 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gdt.c,v 1.56 2016/12/17 14:27:53 maxv Exp $");
#include "opt_multiprocessor.h"
#include "opt_xen.h"
@@ -144,8 +144,8 @@
pmap_update(pmap_kernel());
memcpy(gdt, old_gdt, NGDT * sizeof(gdt[0]));
ci->ci_gdt = gdt;
- setsegment(&ci->ci_gdt[GCPU_SEL].sd, ci, 0xfffff,
- SDT_MEMRWA, SEL_KPL, 1, 1);
+ setsegment(&ci->ci_gdt[GCPU_SEL].sd, ci,
+ sizeof(struct cpu_info) - 1, SDT_MEMRWA, SEL_KPL, 1, 0);
gdt_init_cpu(ci);
}
@@ -175,8 +175,8 @@
pmap_update(pmap_kernel());
memset(ci->ci_gdt, 0, min_len);
memcpy(ci->ci_gdt, gdt, gdt_count[0] * sizeof(gdt[0]));
- setsegment(&ci->ci_gdt[GCPU_SEL].sd, ci, 0xfffff,
- SDT_MEMRWA, SEL_KPL, 1, 1);
+ setsegment(&ci->ci_gdt[GCPU_SEL].sd, ci,
+ sizeof(struct cpu_info) - 1, SDT_MEMRWA, SEL_KPL, 1, 0);
}
diff -r 22bd1a25b42a -r ec8d4efeac21 sys/arch/i386/i386/machdep.c
--- a/sys/arch/i386/i386/machdep.c Sat Dec 17 13:49:05 2016 +0000
+++ b/sys/arch/i386/i386/machdep.c Sat Dec 17 14:27:53 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.768 2016/12/16 19:52:22 maxv Exp $ */
+/* $NetBSD: machdep.c,v 1.769 2016/12/17 14:27:53 maxv Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.768 2016/12/16 19:52:22 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.769 2016/12/17 14:27:53 maxv Exp $");
#include "opt_beep.h"
#include "opt_compat_ibcs2.h"
@@ -988,8 +988,8 @@
setsegment(&gdt[GBIOSDATA_SEL].sd, 0, 0xfffff, SDT_MEMRWA, SEL_KPL, 0,
0);
#endif
- setsegment(&gdt[GCPU_SEL].sd, &cpu_info_primary, 0xfffff,
- SDT_MEMRWA, SEL_KPL, 1, 1);
+ setsegment(&gdt[GCPU_SEL].sd, &cpu_info_primary,
+ sizeof(struct cpu_info) - 1, SDT_MEMRWA, SEL_KPL, 1, 0);
#ifndef XEN
setregion(®ion, gdt, NGDT * sizeof(gdt[0]) - 1);
Home |
Main Index |
Thread Index |
Old Index