aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2009-12-07[S390] fault handler access flags check.Martin Schwidefsky1-17/+13
Simplify the check of the vma->flags in do_exception for the different fault types. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] fault handler performance optimization.Martin Schwidefsky1-129/+129
Slim down the do_exception function to handle only the fast path of a fault and move the exceptional cases into a new function. That slightly increases the performance of the fault handling. Build fix for !CONFIG_COMPAT by Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] Improve notify_page_fault implementation.Martin Schwidefsky1-10/+4
notify_page_fault does a preempt_disable/preempt_enable for each fault generated by a kernel access to user space. If kprobes is not active that is unnecessary since the interrupts are not reenabled yet. To play safe repeat the kprobe_running check after preempt_disable(). Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] Improve address space mode selection.Martin Schwidefsky11-58/+38
Introduce user_mode to replace the two variables switch_amode and s390_noexec. There are three valid combinations of the old values: 1) switch_amode == 0 && s390_noexec == 0 2) switch_amode == 1 && s390_noexec == 0 3) switch_amode == 1 && s390_noexec == 1 They get replaced by 1) user_mode == HOME_SPACE_MODE 2) user_mode == PRIMARY_SPACE_MODE 3) user_mode == SECONDARY_SPACE_MODE The new kernel parameter user_mode=[primary,secondary,home] lets you choose the address space mode the user space processes should use. In addition the CONFIG_S390_SWITCH_AMODE config option is removed. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] Improve address space check.Martin Schwidefsky1-54/+45
A data access in access-register mode always is a user mode access, the code to inspect the access-registers can be removed. The second change is to use a different test to check for no-execute fault. The third change is to pass the translation exception identification as parameter, in theory the trans_exc_code in the lowcore could have been overwritten by the time the call to check_space from do_no_context is done. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: dont unregister a busy device in ccw_device_set_offlineSebastian Ott1-9/+20
If we detect a busy subchannel after the driver's set_offline callback returned in ccw_device_set_offline, the current behavior is to unregister the device, which may lead to undesired consequences. Change this to just quiesce the subchannel and go on with the offline processing. Note: This is no excuse for not fixing these drivers - after the set_offline callback they should have no running IO! Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: improve error recovery for internal I/OsPeter Oberparleiter4-6/+7
Improve error recovery for internal I/Os by repeating each I/O 256 times per path to cope with long-running non-permanent error conditions. Also retry each path twice to cope with link flapping, i.e. single paths becoming unavailable in the order in which they are tried. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: change locking in io_subchannel_removeSebastian Ott1-3/+2
IO subchannels are always unregistered in process context, so use spin_lock_irq in the corresponding remove callback. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: quiesce subchannel in io_subchannel_removeSebastian Ott1-1/+9
Ensure that there will be no more interrupts for an unregistered device by using the same quiesce and disable loop as in io_subchannel_shutdown. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: handle busy subchannel in ccw_device_move_to_schSebastian Ott1-2/+22
Try to disable the old subchannel before we ask the driver core to move the attached device to a new parent. This way we can use the QUIESCE state during shutdown which prevents a possible use after free situation in some error cases. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: handle failed disable_subchannel after device recognitionSebastian Ott1-1/+2
Handle a failing cio_disable_subchannel at the end of our device recognition as if the recognition itself failed. This way subsequent registration steps do not need to handle enabled subchannels. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: fix quiesce stateSebastian Ott2-29/+23
DEV_STATE_QUIESCE is used to stop all IO on a busy subchannel. This patch fixes the following problems related to the QUIESCE state: * Fix a potential race condition which could occur when the resulting state was DEV_STATE_OFFLINE. * Add missing locking around cio_disable_subchannel, ccw_device_cancel_halt_clear and the cdev's handler. * Loop until we know for sure that the subchannel is disabled. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: add per device initialization status flagSebastian Ott2-0/+7
The function ccw_device_unregister has to ensure to remove all references obtained by device_add and device_initialize. Unfortunately it gets called for devices which are 1) uninitialized, 2) initialized but unregistered, and 3) registered devices. To distinguish 1) and 2) this patch introduces a new flag "initialized", which is 1 as long as we hold the initial device reference. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: remove registered flag from ccw_device_privateSebastian Ott2-9/+3
We used to maintain a "registered" flag in our ccw_device_private structure. This patch removes the "registered" flag and converts all users of it to device_is_registered which has the exact same meaning. Note: The usage the atomic operation test_and_clear_bit is replaced by the non-atomic if (device_is_registered()) device_del(). This will not do harm, since we serialize calls to ccw_device_unregister with a single-threaded workqueue. Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: make steal lock procedure more robustPeter Oberparleiter4-89/+134
An Unconditional Reserve + Release operation (steal lock) for a boxed device may fail when encountering special error cases (e.g. unit checks or path errors). Fix this by using the more robust ccw_request infrastructure for performing the steal lock CCW program. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: use sense-pgid operation for path verificationPeter Oberparleiter4-94/+99
Set-pgid operations fail for some device types under z/VM for which the hypervisor has already set the pgid. Also reserved devices or changed pgids are not correctly recognized. Fix these problems by using a combination of sense-pgid and set-pgid and by also accepting pre-defined pgid settings. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: split PGID settings and statusPeter Oberparleiter8-24/+68
Split setting (driver wants feature enabled) and status (feature setup was successful) for PGID related ccw device features so that setup errors can be detected. Previously, incorrectly handled setup errors could in rare cases lead to erratic I/O behavior and permanently unusuable devices. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: remove intretry flagPeter Oberparleiter6-75/+18
After changing all internal I/O functions to use the newly introduced ccw request infrastructure, retries are handled automatically after a clear operation. Therefore remove the internal retry flag and associated code. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: allow setting not-operational devices offlinePeter Oberparleiter1-5/+4
Accept a request for setting a not-operational device offline. This way, users can remove devices from Linux which would otherwise remain unusable until reboot. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: use ccw request infrastructure for pgidPeter Oberparleiter5-604/+383
Use the newly introduced ccw request infrastructure to implement pgid related operations: sense pgid, set pgid and disband pg. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: use ccw request infrastructure for sense idPeter Oberparleiter3-288/+154
Use the newly introduced ccw request infrastructure to implement the sense id operation. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: consistent infrastructure for internal I/O requestsPeter Oberparleiter4-1/+386
Reduce code duplication by introducing a central infrastructure to perform an internal I/O operation on a CCW device. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: dont panic in non-fatal conditionsPeter Oberparleiter1-19/+6
Remove the call to BUG() for situations which are unexpected but do not cause actual problems. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: ensure proper locking during device recognitionPeter Oberparleiter1-0/+2
Device recognition needs to be started with the ccw device lock held to prevent race conditions between I/O starting and interrupt reception. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: handle error during path verification consistentlyPeter Oberparleiter2-11/+10
Handle verification errors consistently through the existing callback ccw_device_done to reduce cleanup code duplication. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: handle error during device recognition consistentlyPeter Oberparleiter3-64/+15
Remove the return code from ccw_device_recognition and handle recognition errors through the existing callback ccw_device_recog_done to reduce cleanup code duplication. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: inform user when online/offline processing failsPeter Oberparleiter1-0/+22
Print a warning message in case a ccw device enters boxed or not operational state during online/offline processing. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: introduce ccw device todosPeter Oberparleiter4-127/+119
Introduce a central mechanism for performing delayed ccw device work to ensure that different types of work do not overwrite each other. Prioritization ensures that the most important work is always performed while less important tasks are either obsoleted or repeated later. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: introduce subchannel todosPeter Oberparleiter4-19/+63
Ensure that current and future users of sch->work do not overwrite each other by introducing a single mechanism for delayed subchannel work. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: introduce parent-initiated device movePeter Oberparleiter3-338/+192
Change the initiative to update subchannel-ccw device associations to the subchannel: when there is an indication that the internal association no longer reflects the current hardware state, mark each affected subchannel as requiring attention. Once processing reaches a subchannel, determine the correct association for that subchannel at that time and perform the necessary device_move operations. This change fixes problems with the previous approach which would leave devices in an inconsistent state when a new hardware change occurred while a device_move was already scheduled. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: fix repeat setting of cdev parent associationPeter Oberparleiter1-4/+1
sch_create_and_recog_new_device() associates a parent subchannel with its ccw device child even though this is already done by the subsequently called io_subchannel_recog(). Also make sure io_subchannel_recog() sets the association under lock. Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] cio: fix double free in case of probe failurePeter Oberparleiter1-6/+5
io_subchannel_probe() frees memory for sch->private which is later freed again when io_subchannel_remove() is called. Fix this problem by removing the cleanup in io_subchannel_probe(). Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07[S390] s390: clear high-order bits of registers after sam64Hendrik Brueckner1-0/+3
When the kernel is IPLed without the CLEAR option and switches to 64-bit, the high-order half of the registers might contain random values. This can cause addressing exceptions and the kernel enters an interrupt loop. Initialize the high-order half of the general purpose registers with zeros after switching to 64-bit mode. Cc: <stable@kernel.org> Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2009-12-07block: include linux/err.h to use ERR_PTRStephen Rothwell1-0/+1
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-12-06Fix soc_common PCMCIA configurationRussell King1-1/+1
Jonathan Cameron reports that building PCMCIA as modules doesn't work: As module get a load of undefined symbols: ERROR: "soc_pcmcia_request_irqs" [drivers/pcmcia/pxa2xx_stargate2.ko] undefined! ERROR: "soc_pcmcia_free_irqs" [drivers/pcmcia/pxa2xx_stargate2.ko] undefined! ERROR: "soc_pcmcia_enable_irqs" [drivers/pcmcia/pxa2xx_stargate2.ko] undefined! ERROR: "soc_pcmcia_disable_irqs" [drivers/pcmcia/pxa2xx_stargate2.ko] undefined! ERROR: "soc_pcmcia_add_one" [drivers/pcmcia/pxa2xx_base.ko] undefined! ERROR: "soc_common_pcmcia_get_timing" [drivers/pcmcia/pxa2xx_base.ko] undefined! ERROR: "soc_pcmcia_remove_one" [drivers/pcmcia/pxa2xx_base.ko] undefined! make[1]: *** [__modpost] Error 1 make: *** [modules] Error 2 This is because soc_common tries to be built-in, but it should be a module. Allow soc_common to be a module. Reported-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06ARM: 5827/1: SA1100: h3100/h3600: emit messages on failed gpio_requestDmitry Artamonow3-6/+22
Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06ARM: 5826/1: SA1100: h3100/h3600: always build htc-egpio driverDmitry Artamonow1-0/+2
Many features of h3100/h3600 (LCD, PCMCIA, Flash write, etc.) depend on correct functioning of GPIO expander handled by htc-egpio driver, so force its building in Kconfig. Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06ARM: 5825/1: SA1100: h3600: update defconfigDmitry Artamonow1-364/+612
Update defconfig to current kernel, enable support for iPAQ H3100 and following drivers: gpio-keys, htc-egpio, ide_cs. Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06ARM: 5824/1: SA1100: reuse h3600 PCMCIA driver on h3100Dmitry Artamonow2-2/+2
Both iPAQs h3600 and h3100 share the same control GPIOs for PCMCIA, so driver can be reused. Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06ARM: 5823/1: SA1100: h3100/h3600: add support for gpio-keysDmitry Artamonow1-1/+38
Add support for "Power" and "Action" (joystick center) buttons - the only buttons on iPaq h3100/h3600 connected to GPIOs (other buttons are controlled by microcontroller) Also remove setting PWER for wakeup on Power button press - gpio-keys driver will handle it. Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06ARM: 5822/1: SA1100: h3100/h3600: clean up #includesDmitry Artamonow3-49/+2
After a code reorganization and following split, there's some #includes now unused. Clean them up and sort remaining alphabetticaly where possible. Compile tested. Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06ARM: 5821/1: SA1100: h3100/h3600: revise copyright boilerplatesDmitry Artamonow4-64/+27
Correct boilerplates after files split. Also shorten them a bit - use standart GPL wording (as per http://lkml.org/lkml/2007/5/1/220) and drop changelog, which only entry about h3800 support and abstracted EGPIOs is just confusing now, as both of these features are gone. Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06ARM: 5820/1: SA1100: h3100/h3600: split h3600.cDmitry Artamonow5-335/+427
Split common h3600.c into three separate files: h3100.c, h3600.c and h3xxx.c (the latter contains common code for h3100/h3600) Copyright boilerplates and #includes are copied intact and will be cleaned up later. Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06ARM: 5819/1: SA1100: h3100/h3600: merge h3600.h and h3600_gpio.h into h3xxx.hDmitry Artamonow4-43/+15
Combine both headers into one, rename to h3xxx.h and change all users accordingly. Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06ARM: 5818/1: SA1100: h3100/h3600: drop old GPIO definitionsDmitry Artamonow2-48/+7
As all existing code was converted to gpiolib, drop no more used pre-gpiolib (bit-shifted) GPIO definintions. Supply new gpiolib-friendly definitions for GPIOs which don't have them yet. Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06ARM: 5817/1: SA1100: h3100/h3600: configure all unused gpios as inputsDmitry Artamonow1-23/+3
After conversion to gpiolib there's still some GPIOs left, that get configured in *_mach_init() as outputs (using direct operations on GPCR/GPDR registers), but otherwise unused. These GPIOs are mainly sound related and should be configured by corresponding driver once it is written. Drop this initialisation and configure all GPIOs as input. Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06ARM: 5816/1: SA1100: h3600: remove IRQ_GPIO_* definitionsDmitry Artamonow2-14/+0
As all the remaining users of these definitions (in pcmcia/sa1100_h3600 driver) were converted to gpio_to_irq(), they can be safely removed. Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06ARM: 5815/1: SA1100: h3100/h3600: remove now unused assign_h3600_egpio handlersDmitry Artamonow3-184/+0
As all users of assign_h3600_egpio now converted to gpiolib, we can safely remove all assign_h3600_egpio handling code and definitions. Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06ARM: 5814/1: SA1100: h3100/h3600: convert all users of assign_h3600_egpio to gpiolibDmitry Artamonow2-18/+126
Use of gpio_request/gpio_free in some callbacks may look ugly, but corresponding drivers (sa1100_serial and sa1100_fb) don't provide (yet) init/exit hooks and registering these gpios in *_mach_init is also not possible, because htc-gpio driver starts a bit later... Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06ARM: 5813/1: SA1100: h3100/h3600: add htc-egpio driverDmitry Artamonow2-0/+69
It will be used for future conversion of assign_h3600_egpio calls to gpiolib. Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>