Linux userland API discussions
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx@kernel.org>
To: "Daniël Hörchner" <dbjh@gmx.net>,
	linux-man@vger.kernel.org, "Ingo Schwarze" <schwarze@openbsd.org>,
	"Thomas Gleixner" <tglx@kernel.org>
Cc: victorm007@yahoo.com, t.piekarski@deloquencia.de,
	 linux-api@vger.kernel.org
Subject: Re: Suggestions for an improvement to the man page "iopl - change I/O privilege level".
Date: Sun, 11 Oct 2026 19:26:45 +0200	[thread overview]
Message-ID: <asvFcQvNlx6Oq9Gc@debian> (raw)
In-Reply-To: <asvEtnxChV2-dELG@debian>

[-- Attachment #1: Type: text/plain, Size: 2717 bytes --]

[TO += Ingo and tlgx]

Hi Daniël, Thomas, Ingo,

> > Date: 2026-08-11 17:19:31+0000
> > From: Daniël Hörchner <dbjh@gmx.net>
> >
> 
> > Hello,
> > 
> > 
> > I have some feedback and suggestions to improve the man page of
> > "iopl - change I/O privilege level".
> >  
> > The purpose of iopl() is not clearly explained. iopl() is a
> > straightforward way to allow direct access to all I/O ports from
> > user mode, when it is passed the argument 3. In practice, it is
> > always passed the argument 3.
> >  
> > The description ends with the following paragraph:
> > "This call is deprecated, is significantly slower than ioperm(2),
> > and is only provided for older X servers which require access to
> > all 65536 I/O ports.  It is mostly for the i386 architecture.  On
> > many other architectures it does not exist or will always return
> > an error."
> >  
> > The (dubious) claim that iopl() is slower than ioperm() is
> > completeley irrelevant, as the most common use case involves
> > calling iopl() or ioperm() once during program initialization.
> >  
> > Compared to iopl(), ioperm() is more restrictive. In the past
> > NetBSD, FreeBSD, OpenBSD and DragonFly BSD provided analogous
> > implementations in the form of i386_set_ioperm(). OpenBSD/x86_64
> > provided amd64_set_ioperm(). They served the same purpose as
> > ioperm() on Linux/x86{_64}, i.e. controlling access to specific
> > I/O ports.
> > However, as far as I can tell, all mentioned BSDs have dropped
> > that functionality, but NetBSD and OpenBSD retained their version
> > of iopl(): i386_iopl(), x86_64_iopl() (NetBSD/x86_64) and
> > amd64_iopl() (OpenBSD/x86_64). FreeBSD and DragonFly BSD set the
> > IOPL of the relevant process to 3 in the kernel, when the process
> > successfully opens /dev/io.
> > In other words, the BSD projects all preferred to drop their
> > versions of ioperm() in favor of continuing to provide user
> > programs a way to change the IOPL. It is interesting and perhaps
> > noteworthy that the Linux project appears to head in the opposite
> > direction.

Ingo, Thomas, do you have any comments from the OpenBSD and Linux sides?

> > As I stated above the purpose of iopl() goes beyond providing
> > access only to older X servers. It is a mechanism to allow user
> > programs to directly communicate with hardware through I/O ports.
> > Whether this functionality is sufficient for modern hardware is
> > outside the scope of describing iopl().

Thanks for the report.  Do you have any specific wording you'd like to
change?

> > Kind regards,
> > Daniël Hörchner


Have a lovely night!
Alex

-- 
<https://www.alejandro-colomar.es>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

       reply	other threads:[~2026-10-11 17:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <trinity-4d271f4c-4816-435f-b8c9-53eef0ff29c7-1786468770978@trinity-msg-rest-gmx-gmx-live-d7f776569-bpnnk>
     [not found] ` <asvEtnxChV2-dELG@debian>
2026-10-11 17:26   ` Alejandro Colomar [this message]
2026-10-11 18:57     ` Suggestions for an improvement to the man page "iopl - change I/O privilege level" Ingo Schwarze
2026-10-11 19:10       ` Alejandro Colomar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=asvFcQvNlx6Oq9Gc@debian \
    --to=alx@kernel.org \
    --cc=dbjh@gmx.net \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=schwarze@openbsd.org \
    --cc=t.piekarski@deloquencia.de \
    --cc=tglx@kernel.org \
    --cc=victorm007@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox