2.1.87 Oopsen

Tim Wright (timw@aracnet.com)
Tue, 17 Feb 1998 10:32:12 -0800


I went hunting for the widely reported oops in 2.1.87 and found the following.
The problem is the PROT_NONE changes, or rather the changes to the SWP_TYPE
and SWP_ENTRY macros.
SHM_SWP_TYPE is defined to be 0x40, so left shifting by two and then masking
to the bottom 8 bits loses badly :-(

>
> -#define SWP_TYPE(entry) (((entry) >> 1) & 0x7f)
> +#define SWP_TYPE(entry) (((entry) >> 2) & 0x3f)
> #define SWP_OFFSET(entry) ((entry) >> 8)
> -#define SWP_ENTRY(type,offset) (((type) << 1) | ((offset) << 8))
> +#define SWP_ENTRY(type,offset) (((type) << 2) | ((offset) << 8))

Since we now need 2 bits for the PAGE_PRESENT, I suspect changing the value of
SHM_SWP_TYPE in include/linux/swap.h to 0x20 should work (since MAX_SWAPFILES
is 8, and this seems to be the other use for the type part, I don't see a
clash). Alternatively, since the shared memory id and offset are currently
encoded in 22 bits for a shared memory page, the split could be changed to
23:9 from 24:8, but I don't know all the repurcussions.

I'll leave it up to Linus to determine the correct way to do this, but this
should provide relief in the interim.

t

Oh, I have an AWE SB32, and sound is working fine in 2.1.87, so sound does
not appear to be broken everywhere.

-- 
Tim Wright                        | Aracnet -- Portland's loudest electrons
timw@aracnet.com OR               | Ring +1 503 626.6873 V.34 (28800) 24hrs
timw@sequent.com                  | Browse http://www.aracnet.com for info!
"Nobody ever said I was charming, they said "Rimmer, you're a git!"" RD VI

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu