Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Nov 2018 01:09:01 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Jan Beich <jbeich@FreeBSD.org>
Cc:        Brooks Davis <brooks@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r338990 - in head/sys: compat/freebsd32 dev/pci
Message-ID:  <20181116230901.GR2378@kib.kiev.ua>
In-Reply-To: <7ehc-y6sm-wny@FreeBSD.org>
References:  <201809272108.w8RL8Xqn052122@repo.freebsd.org> <7ehc-y6sm-wny@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Nov 16, 2018 at 11:52:09PM +0100, Jan Beich wrote:
> Brooks Davis <brooks@FreeBSD.org> writes:
> 
> > Author: brooks
> > Date: Thu Sep 27 21:08:32 2018
> > New Revision: 338990
> > URL: https://svnweb.freebsd.org/changeset/base/338990
> >
> > Log:
> >   Centralize compat support for PCIOCGETCONF.
> >   
> >   The pre-7.x compat for both native and 32-bit code was already in
> >   pci_user.c. Use this infrastructure to add implement 32-bit support.
> >   This is more correct as ioctl(2) commands only have meaning in the
> >   context of a file descriptor.
> >   
> >   Reviewed by:	kib
> >   Approved by:	re (gjb)
> >   Obtained from:	CheriBSD
> >   Sponsored by:	DARPA, AFRL
> >   Differential revision:	https://reviews.freebsd.org/D17324
> 
> After this commit getdevice() from pciconf(8) and pci_find_conf() in
> tools/tools/dmardump/dmardump.c always fail in EPERM in -m32 mode.
> Found via graphics/libdrm where PCIOCGETCONF is used to get a list of
> DRM devices for use by OpenGL/Vulkan/VAAPI userland drivers.
> 
> Can you fix the regression before 12.0R or back the commit out?
> 
> https://lists.freebsd.org/pipermail/freebsd-current/2018-November/072144.html

Try this.

diff --git a/sys/dev/pci/pci_user.c b/sys/dev/pci/pci_user.c
index 380beff0d31..b6a53dd0982 100644
--- a/sys/dev/pci/pci_user.c
+++ b/sys/dev/pci/pci_user.c
@@ -945,6 +945,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *t
 	if (!(flag & FWRITE)) {
 		switch (cmd) {
 		case PCIOCGETCONF:
+#ifdef COMPAT_FREEBSD32
+	case PCIOCGETCONF32:
+#endif
 #ifdef PRE7_COMPAT
 		case PCIOCGETCONF_OLD:
 #ifdef COMPAT_FREEBSD32
@@ -962,6 +965,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *t
 
 	switch (cmd) {
 	case PCIOCGETCONF:
+#ifdef COMPAT_FREEBSD32
+	case PCIOCGETCONF32:
+#endif
 #ifdef PRE7_COMPAT
 	case PCIOCGETCONF_OLD:
 #ifdef COMPAT_FREEBSD32



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20181116230901.GR2378>