From owner-p4-projects@FreeBSD.ORG Tue Jul 12 00:27:46 2005 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 93CD216A430; Tue, 12 Jul 2005 00:27:45 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1318716A432 for ; Tue, 12 Jul 2005 00:27:45 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D7D3A43D46 for ; Tue, 12 Jul 2005 00:27:44 +0000 (GMT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id j6C0RiVb098764 for ; Tue, 12 Jul 2005 00:27:44 GMT (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id j6C0RirF098761 for perforce@freebsd.org; Tue, 12 Jul 2005 00:27:44 GMT (envelope-from peter@freebsd.org) Date: Tue, 12 Jul 2005 00:27:44 GMT Message-Id: <200507120027.j6C0RirF098761@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm To: Perforce Change Reviews Cc: Subject: PERFORCE change 80032 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2005 00:27:46 -0000 http://perforce.freebsd.org/chv.cgi?CH=80032 Change 80032 by peter@peter_daintree on 2005/07/12 00:27:39 Allocate a stack for handling a double fault and set it on the AP's Affected files ... .. //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#102 edit Differences ... ==== //depot/projects/hammer/sys/amd64/amd64/mp_machdep.c#102 (text+ko) ==== @@ -95,6 +95,9 @@ /* Free these after use */ void *bootstacks[MAXCPU]; +/* Temporary holder for double fault stack */ +char *doublefault_stack; + /* Hotwire a 0->4MB V==P mapping */ extern pt_entry_t *KPTphys; @@ -432,7 +435,7 @@ common_tss[cpu] = common_tss[0]; common_tss[cpu].tss_rsp0 = 0; /* not used until after switch */ common_tss[cpu].tss_iobase = sizeof(struct amd64tss); - /* XXX set tss_ist1 so we have a stack for a double fault */ + common_tss[cpu].tss_ist1 = (long)&doublefault_stack[PAGE_SIZE]; gdt_segs[GPROC0_SEL].ssd_base = (long) &common_tss[cpu]; ssdtosyssd(&gdt_segs[GPROC0_SEL], @@ -680,7 +683,8 @@ cpu_apic_ids[cpu] = apic_id; /* allocate and set up an idle stack data page */ - bootstacks[cpu] = (char *)kmem_alloc(kernel_map, KSTACK_PAGES * PAGE_SIZE); + bootstacks[cpu] = kmem_alloc(kernel_map, KSTACK_PAGES * PAGE_SIZE); + doublefault_stack = kmem_alloc(kernel_map, PAGE_SIZE); bootSTK = (char *)bootstacks[cpu] + KSTACK_PAGES * PAGE_SIZE - 8; bootAP = cpu;