diff options
author | 2013-02-09 22:43:57 +0100 | |
---|---|---|
committer | 2013-02-09 22:43:57 +0100 | |
commit | 2dd4b685f051bc49ee6d6d8929d2334ce5e6fa04 (patch) | |
tree | 29fa7c7a1ff995aee9e0d48d320142cd0283c260 | |
parent | [www-client/firefox-bin] version bump to 18.0.2 (diff) | |
download | wbrana-2dd4b685f051bc49ee6d6d8929d2334ce5e6fa04.tar.gz wbrana-2dd4b685f051bc49ee6d6d8929d2334ce5e6fa04.tar.bz2 wbrana-2dd4b685f051bc49ee6d6d8929d2334ce5e6fa04.zip |
[x11-base/xorg-server] allow to run with disabled privileged I/O
-rw-r--r-- | x11-base/xorg-server/Manifest | 3 | ||||
-rw-r--r-- | x11-base/xorg-server/files/xorg-server-disable-iopl.patch | 255 | ||||
-rw-r--r-- | x11-base/xorg-server/xorg-server-1.13.2-r132.ebuild (renamed from x11-base/xorg-server/xorg-server-1.13.2-r131.ebuild) | 1 |
3 files changed, 258 insertions, 1 deletions
diff --git a/x11-base/xorg-server/Manifest b/x11-base/xorg-server/Manifest index b185efe..d838ff9 100644 --- a/x11-base/xorg-server/Manifest +++ b/x11-base/xorg-server/Manifest @@ -7,7 +7,8 @@ AUX xdm.initd-8 5702 SHA256 f5f97f5ac47738f352d172185b9256c78562a91510fd3d69dbc8 AUX xdm.initd-9 5700 SHA256 96b1fe826db2b46b08e055d57bffd9405616b7980d9e40e95f19e52bc49eef3f SHA512 a4f652aff6a03d902da7ce1c706396911e853e78031d3246b764cb67930f20935d5aa912834add9f839742e824c380d2793b6b62592a10ad1bde646623b419d3 WHIRLPOOL ebddb96a2552a76f1d2f13b25dd773c822e8a0a5135f950163426477c689d0c35a74946a3323103d604783244e3a2f0bee5f5009b50828c90227370b13c433a9 AUX xorg-server-1.12-disable-acpi.patch 275 SHA256 1d3878d44e2b8690bb7d1595960d06acee7f86a6a4724236a09a74900404e953 SHA512 ca52ce0931819acf46a066116b8485c3a398a56d79826a5cdb2b3b8c7809e5163e17a5954de370805dc51a3be3c75a0333d5c17c30bf99139105d705de2fff95 WHIRLPOOL 048be09bad947a5ef02d5935534c47d08439f0ceccddcdb017908bf73aa0484a69b0e42e8e6630393323305b31a8008ef8a0f4655556082245bc5fcde254aa5b AUX xorg-server-1.13-ia64-asm.patch 1166 SHA256 525fc255734f062758877ad45a29862dfeb1fb8e7b3a476d9410a6f0d73420a2 SHA512 51b8695af30988f99a480d2ecadc6dbe7cb46d4d9461fa006d9001200dfc1bed7390025fd1ebbadc936aee90444bb5cfd892d41c5260d5c33347ee2bdc88e78e WHIRLPOOL 46d8b55b67c82118e2a36a01c739217c6e6dd02228b0a0e730b44372b77b476f4a76fcfa8a584550cdfc87db22c26839890b7719318678aaedba7db761a39c6c +AUX xorg-server-disable-iopl.patch 8196 SHA256 762474b8cf71481a36ed654fcd846f3e8cbe08dd44f515a6148784e1e352436e SHA512 6090ff381ef12e5a90e2ee68ca55b0c1e8f7637076fe709dd38dbdb16c3cd26c1de2c2613155ca1292eb25862dd05562177671fa8a0b7e9daf21e51acee7b806 WHIRLPOOL 6acdbffb15d23869a68f49cc61e6fccf26771f336c5f788748d6d008c077695686ea677302bab8d58169bc7eedff1a14ab60c45d2ec6fb4420631c3bf58a0c5c AUX xorg-server-non-root.patch 745 SHA256 80625533d841d021b79e4b4dfcb0555f9e1caeaffa0056193195c7717c835504 SHA512 e53f4ae7d343c9b4bd7fe820a9a256b3df3539d4f312be7a9c047b631f15c56ec1c99d6ef472239826329bb99e4845b51f535f9eca910e9fb372a3c23d32ffb9 WHIRLPOOL b90b5b239917fa01458eef90fd62ec159d3e6ae199fc42c39a705f97d9a2c5f950435f5e28f5a370431b60d5d6765704e115e418368ce7e3eff1403bc7044024 AUX xorg-sets.conf 199 SHA256 1201d0337ac69d9715f4454a86dfb8a7bd1ae6f4c2578042fc08f283a997597c SHA512 910fe28f20909243044f079ff35136942b8790f4f28ac42ffc64a76b7f03cd22057087fa5e4e01192080b52c0d89000ea96d5a807c6f11f680d3f43312c5be41 WHIRLPOOL 4acac88e1688ea71df59a86a8a188b5369ad05f61e1369cd620eecd754511578e961a537ff6d0b22156f671d3485289cbc941dfe83bea24a27329b7bebb46c7d DIST xorg-server-1.13.2.tar.bz2 5477756 SHA256 3850adb89e9170ad85aea39d240279494c07779e50cd3cd60126028681209408 SHA512 bbd76f800eaf0247486c19992716d231e69d57c3a36235d684e6503ff5316bbbd2dda6b44f7697920145566f0e1a3636725170e8ded853061cc89409f3b1011a WHIRLPOOL 1f2d57ca904ff1ff7bb551e26d74d7d5a6495e6127f7cc0d95038f83ed513551e20b5e4cdba1b57335f9ecc20fd58d946700f5881037ec9bdcd51fac4ffc0935 -EBUILD xorg-server-1.13.2-r131.ebuild 7179 SHA256 bd9a93038d11151a72458d9f587582a700b78d00b477ab93ab57e86255b132c8 SHA512 421534210cda3ddbdf2848a6df56f717b53559ff96981fb5bf42b8f11633338a79b3753d2ebaceacaa5e2a922c28d08e16a9aa03740e68083351daf3b2903ca7 WHIRLPOOL 719683b67fb62687518a7a2e5cd16bb92c39905accbdd263e07dff56b632298ac907c8759ce3ef4eeba64dc9fdf905501fb2fb349ce5668d935771e14a5e6e12 +EBUILD xorg-server-1.13.2-r132.ebuild 7225 SHA256 7cee054259d27d06a7e742ddaa33aabf87a1eefb9b16a4c3e2a2111665fe2ff5 SHA512 dcd97548d399ba70977f860e9e45ce57ebd149001d493660eb2f6fb028a7a3548c74d8285730ceddf10079da07e83a7386624500f5f62ddecf996d1e9d43a85e WHIRLPOOL af9c0789481062919249d3e854aa1cc960b2af8722ad798208e687f15bdc4e63d686b71c7035a1317fa40adf85f0e9c0635f5848dfa248d7f28b1366873a81ea diff --git a/x11-base/xorg-server/files/xorg-server-disable-iopl.patch b/x11-base/xorg-server/files/xorg-server-disable-iopl.patch new file mode 100644 index 0000000..25f7e4a --- /dev/null +++ b/x11-base/xorg-server/files/xorg-server-disable-iopl.patch @@ -0,0 +1,255 @@ +diff -r -u a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h +--- a/hw/xfree86/common/xf86.h 2012-10-25 00:41:02.000000000 -0400 ++++ b/hw/xfree86/common/xf86.h 2013-02-06 09:54:06.560035830 -0500 +@@ -55,6 +55,7 @@ + extern _X_EXPORT int xf86DoConfigure; + extern _X_EXPORT int xf86DoShowOptions; + extern _X_EXPORT Bool xf86DoConfigurePass1; ++extern _X_EXPORT Bool xorgHWAccess; + + extern _X_EXPORT DevPrivateKeyRec xf86ScreenKeyRec; + +diff -r -u a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c +--- a/hw/xfree86/common/xf86Bus.c 2012-11-02 00:17:59.000000000 -0400 ++++ b/hw/xfree86/common/xf86Bus.c 2013-02-06 09:54:06.560035830 -0500 +@@ -127,17 +127,6 @@ + * instance of the hardware found. + */ + for (i = 0; i < xf86NumDrivers; i++) { +- xorgHWFlags flags; +- +- if (!xorgHWAccess) { +- if (!xf86DriverList[i]->driverFunc +- || !xf86DriverList[i]->driverFunc(NULL, +- GET_REQUIRED_HW_INTERFACES, +- &flags) +- || NEED_IO_ENABLED(flags)) +- continue; +- } +- + xf86CallDriverProbe(xf86DriverList[i], FALSE); + } + +diff -r -u a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c +--- a/hw/xfree86/common/xf86Configure.c 2012-10-13 19:38:50.000000000 -0400 ++++ b/hw/xfree86/common/xf86Configure.c 2013-02-06 09:54:06.560035830 -0500 +@@ -545,41 +545,16 @@ + + free(vlist); + +- for (i = 0; i < xf86NumDrivers; i++) { +- xorgHWFlags flags; +- +- if (!xf86DriverList[i]->driverFunc +- || !xf86DriverList[i]->driverFunc(NULL, +- GET_REQUIRED_HW_INTERFACES, +- &flags) +- || NEED_IO_ENABLED(flags)) { +- xorgHWAccess = TRUE; +- break; +- } +- } +- /* Enable full I/O access */ +- if (xorgHWAccess) { +- if (!xf86EnableIO()) +- /* oops, we have failed */ +- xorgHWAccess = FALSE; +- } ++ xorgHWAccess = xf86EnableIO(); + + /* Create XF86Config file structure */ + xf86config = calloc(1, sizeof(XF86ConfigRec)); + + /* Call all of the probe functions, reporting the results. */ + for (CurrentDriver = 0; CurrentDriver < xf86NumDrivers; CurrentDriver++) { +- xorgHWFlags flags; + Bool found_screen; + DriverRec *const drv = xf86DriverList[CurrentDriver]; + +- if (!xorgHWAccess) { +- if (!drv->driverFunc +- || !drv->driverFunc(NULL, GET_REQUIRED_HW_INTERFACES, &flags) +- || NEED_IO_ENABLED(flags)) +- continue; +- } +- + found_screen = xf86CallDriverProbe(drv, TRUE); + if (found_screen && drv->Identify) { + (*drv->Identify) (0); +diff -r -u a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c +--- a/hw/xfree86/common/xf86Init.c 2012-10-13 19:38:50.000000000 -0400 ++++ b/hw/xfree86/common/xf86Init.c 2013-02-06 09:54:06.560035830 -0500 +@@ -530,23 +530,22 @@ + */ + + for (i = 0; i < xf86NumDrivers; i++) { ++ xorgHWFlags flags = HW_IO; ++ + if (xf86DriverList[i]->Identify != NULL) + xf86DriverList[i]->Identify(0); + +- if (!xorgHWAccess || !xorgHWOpenConsole) { +- xorgHWFlags flags; ++ if (xf86DriverList[i]->driverFunc) ++ xf86DriverList[i]->driverFunc(NULL, ++ GET_REQUIRED_HW_INTERFACES, ++ &flags); ++ ++ /* this is "do we want it" at this point */ ++ if (NEED_IO_ENABLED(flags)) ++ xorgHWAccess = TRUE; + +- if (!xf86DriverList[i]->driverFunc +- || !xf86DriverList[i]->driverFunc(NULL, +- GET_REQUIRED_HW_INTERFACES, +- &flags)) +- flags = HW_IO; +- +- if (NEED_IO_ENABLED(flags)) +- xorgHWAccess = TRUE; +- if (!(flags & HW_SKIP_CONSOLE)) +- xorgHWOpenConsole = TRUE; +- } ++ if (!(flags & HW_SKIP_CONSOLE)) ++ xorgHWOpenConsole = TRUE; + } + + if (xorgHWOpenConsole) +diff -r -u a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h +--- a/hw/xfree86/common/xf86Priv.h 2012-10-13 19:38:50.000000000 -0400 ++++ b/hw/xfree86/common/xf86Priv.h 2013-02-06 09:54:06.560035830 -0500 +@@ -91,7 +91,6 @@ + extern _X_EXPORT const char *xf86VisualNames[]; + extern _X_EXPORT int xf86Verbose; /* verbosity level */ + extern _X_EXPORT int xf86LogVerbose; /* log file verbosity level */ +-extern _X_EXPORT Bool xorgHWAccess; + + extern _X_EXPORT RootWinPropPtr *xf86RegisteredPropertiesTable; + +diff -r -u a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c +--- a/hw/xfree86/os-support/linux/lnx_video.c 2012-10-13 19:38:51.000000000 -0400 ++++ b/hw/xfree86/os-support/linux/lnx_video.c 2013-02-06 09:47:22.710032993 -0500 +@@ -479,45 +479,39 @@ + #define __NR_pciconfig_iobase 200 + #endif + +-#endif +- +-Bool +-xf86EnableIO(void) ++static Bool ++hwEnableIO(void) + { +-#if defined(__powerpc__) + int fd; +- unsigned int ioBase_phys; +-#endif +- +- if (ExtendedEnabled) +- return TRUE; +- +-#if defined(__powerpc__) +- ioBase_phys = syscall(__NR_pciconfig_iobase, 2, 0, 0); ++ unsigned int ioBase_phys = syscall(__NR_pciconfig_iobase, 2, 0, 0); + + fd = open("/dev/mem", O_RDWR); + if (ioBase == NULL) { + ioBase = (volatile unsigned char *) mmap(0, 0x20000, + PROT_READ | PROT_WRITE, + MAP_SHARED, fd, ioBase_phys); +-/* Should this be fatal or just a warning? */ +-#if 0 +- if (ioBase == MAP_FAILED) { +- xf86Msg(X_WARNING, +- "xf86EnableIOPorts: Failed to map iobase (%s)\n", +- strerror(errno)); +- return FALSE; +- } +-#endif + } + close(fd); +-#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__arm__) && !defined(__m32r__) && !defined(__nds32__) ++ ++ return ioBase != MAP_FAILED; ++} ++ ++static void ++hwDisableIO(void) ++{ ++ munmap(ioBase, 0x20000); ++ ioBase = NULL; ++} ++ ++#elif defined(__i386__) || defined(__x86_64__) || defined(__ia64__) || \ ++ defined(__alpha__) ++ ++static Bool ++hwEnableIO(void) ++{ + if (ioperm(0, 1024, 1) || iopl(3)) { +- if (errno == ENODEV) +- ErrorF("xf86EnableIOPorts: no I/O ports found\n"); +- else +- FatalError("xf86EnableIOPorts: failed to set IOPL" +- " for I/O (%s)\n", strerror(errno)); ++ ErrorF("xf86EnableIOPorts: failed to set IOPL for I/O (%s)\n", ++ strerror(errno)); + return FALSE; + } + #if !defined(__alpha__) +@@ -526,27 +520,44 @@ + ioperm(0x40, 4, 0); /* trap access to the timer chip */ + ioperm(0x60, 4, 0); /* trap access to the keyboard controller */ + #endif +-#endif +- ExtendedEnabled = TRUE; + + return TRUE; + } + ++static void ++hwDisableIO(void) ++{ ++ iopl(0); ++ ioperm(0, 1024, 0); ++} ++ ++#else /* non-IO architectures */ ++ ++#define hwEnableIO() TRUE ++#define hwDisableIO() do {} while (0) ++ ++#endif ++ ++Bool ++xf86EnableIO(void) ++{ ++ if (ExtendedEnabled) ++ return TRUE; ++ ++ ExtendedEnabled = hwEnableIO(); ++ ++ return ExtendedEnabled; ++} ++ + void + xf86DisableIO(void) + { + if (!ExtendedEnabled) + return; +-#if defined(__powerpc__) +- munmap(ioBase, 0x20000); +- ioBase = NULL; +-#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__) && !defined(__m32r__) && !defined(__nds32__) +- iopl(0); +- ioperm(0, 1024, 0); +-#endif +- ExtendedEnabled = FALSE; + +- return; ++ hwDisableIO(); ++ ++ ExtendedEnabled = FALSE; + } + + #if defined (__alpha__) diff --git a/x11-base/xorg-server/xorg-server-1.13.2-r131.ebuild b/x11-base/xorg-server/xorg-server-1.13.2-r132.ebuild index 678c4af..4d1b68a 100644 --- a/x11-base/xorg-server/xorg-server-1.13.2-r131.ebuild +++ b/x11-base/xorg-server/xorg-server-1.13.2-r132.ebuild @@ -112,6 +112,7 @@ PATCHES=( "${UPSTREAMED_PATCHES[@]}" "${FILESDIR}"/${PN}-1.12-disable-acpi.patch "${FILESDIR}"/${PN}-1.13-ia64-asm.patch + "${FILESDIR}"/xorg-server-disable-iopl.patch "${FILESDIR}"/xorg-server-non-root.patch ) |