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:       port-amd64
>Synopsis:       x86 vector.o is too large
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-amd64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 04 10:30:00 +0000 2008
>Last-Modified:  Wed May 29 00:46:25 +0000 2019
>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



Responsible-Changed-From-To: kern-bug-people->port-amd64-maintainer
Responsible-Changed-When: Wed, 29 May 2019 00:46:25 +0000
Move to more likely category. This requires MD knowledge to understand.


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.