NetBSD Problem Report #38580

From  Sun May  4 10:29:07 2008
Return-Path: <>
Received: from ( [])
	by (Postfix) with ESMTP id DAD1463BA4A
	for <>; Sun,  4 May 2008 10:29:06 +0000 (UTC)
Message-Id: <>
Date: Sun,  4 May 2008 01:39:13 +0000 (UTC)
Subject: x86 vector.o is too large
X-Send-Pr-Version: www-1.0

>Number:         38580
>Category:       kern
>Synopsis:       x86 vector.o is too large
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 04 10:30:00 +0000 2008
>Originator:     Andrew Doran
>Release:        4.99.62
The NetBSD Project
x86 interrupt and trap handling stubs have a couple of problems that
lead to a large vector.o after assembly (120k on amd64, 64k on i386).

o Long code sequences in INTRFASTEXIT/INTRFASTENTRY use instructions that
  assemble up particularly badly and produce large code. In particular, 
  "movl register, 123(%esp)" hits a weak spot in Intel's instruction
  coding and makes for a large opcode.

o Large code sequences are replicated many times over with only minor
  changes to the generated code in each.

Code inspection.
1. Introduce a trap table layered after the IDT and provide 256 stubs.
Always set tf_trapno to an accurate value.

#define ZTRAP(n) \
    push $0 \  /* tf_err = dummy error code */
    push $(n) \ /* tf_trapno */
    jmp  *%cs:traptable+(n*4)

#define TRAP(n) \
    push $(n) \ /* tf_trapno */
    jmp  *%cs:traptable+(n*4)

2. Make trap() smarter so we don't lie and set T_ASTFLT everywhere.

3. Remove difference between Xrecurse and Xresume by adjusting code
in Xspllower/Xdoreti.

4. Introduce generic interrupt stubs: ioapic level, ioapic edge, i8254.

5. On amd64 use push/pop, on i386 pusha/popa to fill frames if

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.