Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 28 Feb 2002 18:57:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 28 Feb 2002 18:55:35 -0500 Received: from neon-gw-l3.transmeta.com ([63.209.4.196]:54533 "EHLO neon-gw.transmeta.com") by vger.kernel.org with ESMTP id ; Thu, 28 Feb 2002 18:53:45 -0500 To: linux-kernel@vger.kernel.org From: "H. Peter Anvin" Subject: Re: ioperm() / iopl() irritation Date: 28 Feb 2002 15:53:27 -0800 Organization: Transmeta Corporation, Santa Clara CA Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Disclaimer: Not speaking for Transmeta in any way, shape, or form. Copyright: Copyright 2002 H. Peter Anvin - All Rights Reserved Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Followup to: By author: Martin Wilck In newsgroup: linux.dev.kernel > > A short question that may be dumb: > > In the docs on i386 IO protection that I know, it is said that > the processor ANDs the two protection mechanisms offered by the > IOPL flag and the io permission bitmap. That is, if IO permissions > are granted through iopl(), but ports are masked in the IO permission > bitmap, a segmentation fault should arise. > Wrong. > Such a situation should be generated by code like this: > > iopl(3); > ioperm (0,0x1f,1); /* 0x20-0x3ff remain masked */ > c = inb (0x20); > > However on my machine this codse is successful! How is that possible? Because you have misunderstood how IOPL works. -hpa -- at work, in private! "Unix gives you enough rope to shoot yourself in the foot." http://www.zytor.com/~hpa/puzzle.txt - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/