public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* ioperm() / iopl() irritation
@ 2002-02-28 20:34 Martin Wilck
  2002-02-28 23:53 ` H. Peter Anvin
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Wilck @ 2002-02-28 20:34 UTC (permalink / raw)
  To: Linux Kernel mailing list


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.

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?
(If the iopl() statement is commented out, the code segfaults of course).

Martin

-- 
Martin Wilck                Phone: +49 5251 8 15113
Fujitsu Siemens Computers   Fax:   +49 5251 8 20409
Heinz-Nixdorf-Ring 1	    mailto:Martin.Wilck@Fujitsu-Siemens.com
D-33106 Paderborn           http://www.fujitsu-siemens.com/primergy







^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: ioperm() / iopl() irritation
@ 2002-03-01 10:45 Martin Wilck
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Wilck @ 2002-03-01 10:45 UTC (permalink / raw)
  To: Linux Kernel mailing list

Peter H. Anvin wrote:

> Because you have misunderstood how IOPL works.

Found that meanwhile, too. However I have two different text books
(one of them O'Reilly's "Understanding the Linux Kernel") that describe
the mechanism very clearly as I had (wrongly) understood it before.

Thanks for clearing this up, anyway.

Martin

-- 
Martin Wilck                Phone: +49 5251 8 15113
Fujitsu Siemens Computers   Fax:   +49 5251 8 20409
Heinz-Nixdorf-Ring 1	    mailto:Martin.Wilck@Fujitsu-Siemens.com
D-33106 Paderborn           http://www.fujitsu-siemens.com/primergy






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-03-01 10:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-28 20:34 ioperm() / iopl() irritation Martin Wilck
2002-02-28 23:53 ` H. Peter Anvin
  -- strict thread matches above, loose matches on Subject: below --
2002-03-01 10:45 Martin Wilck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox