NetBSD Problem Report #38580

From martin@duskware.de  Sun May  4 10:29:07 2008
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id DAD1463BA4A
	for <gnats-bugs@gnats.netbsd.org>; Sun,  4 May 2008 10:29:06 +0000 (UTC)
Message-Id: <20080504013914.00F2563B8BC@narn.NetBSD.org>
Date: Sun,  4 May 2008 01:39:13 +0000 (UTC)
From: ad@netbsd.org
Reply-To: ad@netbsd.org
To: netbsd-bugs-owner@NetBSD.org
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
>Organization:
The NetBSD Project
>Environment:
n/a
>Description:
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.

>How-To-Repeat:
Code inspection.
>Fix:
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
appropriate.

>Release-Note:

>Audit-Trail:

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


>Unformatted:

NetBSD Home
NetBSD PR Database Search

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