Thread View: comp.sys.ibm.pc.rt
1 messages
1 total messages
Started by Mark S. Lewis
Fri, 09 Mar 1990 20:05
Fix for APC floating point problem (part 1/2) IBM/4.3
Author: Mark S. Lewis
Date: Fri, 09 Mar 1990 20:05
Date: Fri, 09 Mar 1990 20:05
181 lines
6088 bytes
6088 bytes
Subject: Fix for APC floating point problem (part 1/2) IBM/4.3
Index: /sys/ca/{trap.c, ioim.h}
Description:
There is an unusual set of circumstances that could cause
certain models of the IBM RT System (6150, 6151) and the IBM
6152 Academic System to give inaccurate floating point arithmetic
results. Although the probability of its occurrence is
extremely remote, we are informing our customers and
providing a fix.
These fixes are designed to detect the circumstances where
a floating point error could potentially occur and to
prevent the floating point error from occurring.
The complete fix is comprised of 3 components: a patch
to vmunix, a patch to the floating point library, and a
new version of the Fortran compiler hf77.
V1.27_kit.1 - Patch to the kernel (this file)
V1.27_kit.2 - Patch to the floating point library
hf77_12.1_tar.Z - Fortran hf77 with fix
(628233 bytes, 20410 checksum)
The Fortran compiler can be copied (uucp) from the IBM support
host ibmsupt from the directory /usr/spool/uucppublic/ibm43-fixes.
(See V1.28 for details.)
Fix:
Following is a patch to the kernel. Apply this patch to the
Dec 88 release of IBM/4.3. Make the kernel and install it.
See "Building IBM/4.3 Systems with Config" in volume II
of the manual.
cd /sys/ca
patch -p1 < V1.27_kit.1
*** trap.c Thu Jan 4 17:50:06 1990
--- trap.c.fix Mon Jan 8 16:40:57 1990
***************
*** 1,15 ****
/*
! * 5799-WZQ (C) COPYRIGHT IBM CORPORATION 1986,1987,1988
* LICENSED MATERIALS - PROPERTY OF IBM
* REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
*/
! /* $Header:trap.c 11.5$ */
! /* $ACIS:trap.c 11.5$ */
/* $Source: /ibm/acis/usr/sys/ca/RCS/trap.c,v $ */
#if !defined(lint) && !defined(NO_RCS_HDRS)
! static char *rcsid = "$Header:trap.c 11.5$";
#endif
#if defined(DEBUG) && !defined(SYSCALLTRACE)
#define SYSCALLTRACE
#endif
--- 1,16 ----
/*
! * 5799-CGZ (C) COPYRIGHT IBM CORPORATION 1986,1987,1988
* LICENSED MATERIALS - PROPERTY OF IBM
* REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
*/
! /* $Header: trap.c,v 12.2 89/06/07 13:48:42 cslater Exp $ */
! /* $ACIS:trap.c 9.0$ */
/* $Source: /ibm/acis/usr/sys/ca/RCS/trap.c,v $ */
#if !defined(lint) && !defined(NO_RCS_HDRS)
! static char *rcsid = "$Header: trap.c,v 12.2 89/06/07 13:48:42 cslater
Exp $";
#endif
+
#if defined(DEBUG) && !defined(SYSCALLTRACE)
#define SYSCALLTRACE
#endif
***************
*** 136,141 ****
--- 137,147 ----
goto grave;
}
if (locr0[ECR_COUNT] > 1)
+ if (check_apc_bug(locr0)) {
+ i = SIGBUS;
+ break;
+ }
+ if (locr0[ECR_COUNT] > 1)
info = apc_mux(locr0,info); /* handle multiple exceptions */
info = (info&(NBPG-1)) | (locr0[EX1_ADDR] & (-NBPG));
/* fall thru for now */
***************
*** 142,147 ****
--- 148,158 ----
#endif ROMPC
case DPAGE_FAULT + USER: /* data page fault */
case IPAGE_FAULT + USER: /* inst page fault */
+ if (locr0[ECR_COUNT] > 1)
+ if (check_apc_bug(locr0)) {
+ i = SIGBUS;
+ break;
+ }
if (info & MMU_EX_KEYS) {
#ifdef SIM_CHG_BIT
if (GETSEG(info) == 0xf) {
***************
*** 1101,1103 ****
--- 1112,1137 ----
}
#endif ROMPC
+
+ static
+ check_apc_bug(locr0)
+ register int *locr0;
+ {
+ int addr2 = locr0[EX2_ADDR];
+ int ctl2 = locr0[EX2_CTL];
+ int addr1 = locr0[EX1_ADDR];
+ int ctl1 = locr0[EX1_CTL];
+
+ if (GETSEG(addr1) == 0xf && GETSEG(addr2) == 0xf &&
+ IS_FLOAT(addr1) && IS_FLOAT(addr2))
+ if (addr1 == addr2 && ctl1 == ctl2 &&
+ locr0[EX1_DATA] == locr0[EX2_DATA])
+ {
+ DEBUGF(1, printf("possible CPU fault:\n"));
+ DEBUGF(1, printf("addr1=addr2=%x\n",addr1));
+ DEBUGF(1, printf("ctl1=ctl2=%x\n",ctl1));
+ DEBUGF(1, printf("EX1_DATA=EX2_DATA=%x\n",locr0[EX1_DATA]));
+ return 1;
+ }
+ return 0;
+ }
*** ioim.h Mon Jan 8 10:29:04 1990
--- ioim.h.fix Mon Jan 8 10:31:47 1990
***************
*** 1,14 ****
/*
! * 5799-WZQ (C) COPYRIGHT IBM CORPORATION 1987
* LICENSED MATERIALS - PROPERTY OF IBM
* REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
*/
! /* $Header:ioim.h 12.0$ */
! /* $ACIS:ioim.h 12.0$ */
/* $Source: /ibm/acis/usr/sys/ca/RCS/ioim.h,v $ */
#if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS)
! static char *rcsidioim = "$Header:ioim.h 12.0$";
#endif
#ifdef ROMPC
--- 1,13 ----
/*
! * P_R_P_Q_# (C) COPYRIGHT IBM CORPORATION 1987
* LICENSED MATERIALS - PROPERTY OF IBM
* REFER TO COPYRIGHT INSTRUCTIONS FORM NUMBER G120-2083
*/
! /* $Header: ioim.h,v 12.1 89/05/12 11:44:14 triha Exp $ */
/* $Source: /ibm/acis/usr/sys/ca/RCS/ioim.h,v $ */
#if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS)
! static char *rcsidioim = "$Header: ioim.h,v 12.1 89/05/12 11:44:14
triha Exp $";
#endif
#ifdef ROMPC
***************
*** 157,162 ****
--- 156,163 ----
/* GETSUBSEG() is defined in mmu.h */
#define IS_IOCC(reg) (GETSUBSEG(reg) == 0 || GETSUBSEG(reg) == 4)
#define IS_68881(reg) (GETSUBSEG(reg) == 0x0c || GETSUBSEG(reg) == 0x0d)
+ #define IS_FLOAT(reg) (GETSUBSEG(reg) >= 0x0c)
+ #define IS_FPA(reg) (GETSUBSEG(reg) == 0x0e || GETSUBSEG(reg) == 0x0f)
#define IS_CANCELLED(reg) ((reg)&EX_CANCELLED)
/**/
/*
=====----- Mark S. Lewis, IBM AWD Palo Alto -----======
inet: mlewis%ibmsupt@uunet.uu.net (415) 855-4486
uucp: uunet!ibmsupt!mlewis IBM Tie Line: 465-4486
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads