- 29 Apr, 2011 26 commits
-
-
Jon Medhurst authored
The instruction decoding in space_cccc_000x needs to reject probing of instructions with undefined patterns as they may in future become defined and then emulated faultily - as has already happened with the SMC instruction. This fix is achieved by testing for the instruction patterns we want to probe and making the the default fall-through paths reject probes. This also allows us to remove some explicit tests for instructions that we wish to reject, as that is now the default action. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
The tests to explicitly reject probing CPS, RFE and SRS instructions are redundant as the default case is now to reject undecoded patterns. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
The PLD instructions wasn't being decoded correctly and the emulation code wasn't adjusting PC correctly. As the PLD instruction is only a performance hint we emulate it as a simple nop, and we can broaden the instruction decoding to take into account newer PLI and PLDW instructions. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
The emulation of SETEND was broken as it changed the endianess for the running kprobes handling code. Rather than adding a new simulation routine to fix this we'll just reject probing of SETEND as these should be very rare in the kernel. Note, the function emulate_none is now unused but it is left in the source code as future patches will use it. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
Following the change to remove support for coprocessor instructions we are left with three stub functions which can be consolidated. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
The kernel doesn't currently support VFP or Neon code, and probing of code with CP15 operations is fraught with bad consequences. Therefore we don't need the ability to probe coprocessor instructions and the code to support this can be removed. The removed code also had at least two bugs: - MRC into R15 should set CPSR not trash PC - LDC and STC which use PC as base register needed the address offset by 8 Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
The USAD8 instruction wasn't being explicitly decoded leading to the incorrect emulation routine being called. It can be correctly decoded in the same way as the signed multiply instructions so we move the decoding there. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
The signed multiply instructions were being decoded incorrectly. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
These sign extension instructions are encoded as extend-and-add instructions where the register to add is specified as r15. The decoding routines weren't checking for this and were using the incorrect emulation code, giving incorrect results. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
The instructions space for media instructions contains some undefined patterns. We need to reject probing of these because they may in future become defined and the kprobes code may then emulate them faultily. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
The v6T2 RBIT instruction was accidentally being emulated correctly, this patch adds correct decoding for the instruction. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
These instructions are specified as UNPREDICTABLE. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
The decoding of these instructions got the register indexed and immediate indexed forms the wrong way around, causing incorrect emulation. Instructions like "LDRD Rx, [Rx]" were corrupting Rx because the base register writeback was being performed unconditionally, overwriting the value just loaded from memory. The fix is to only writeback the base register when that form of the instruction is used. Note, now that we reject probing writeback with PC the emulation code doesn't need the check rn!=15. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
Using PC as an base register with writeback is UNPREDICTABLE, as is non word-sized loads or stores of PC. (We only really care about preventing loads to PC but it keeps the code simpler if we also exclude stores.) Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
The decoding of these instructions got the register indexed and immediate indexed forms the wrong way around, causing incorrect emulation. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
The emulation code for STREX and LDREX instructions is faulty, however, rather than attempting to fix this we reject probes of these instructions. We do this because they can never succeed in gaining exclusive access as the exception framework clears the exclusivity monitor when a probes breakpoint is hit. (This is a general problem when probing all instructions executing between a LDREX and its corresponding STREX and can lead to infinite retry loops.) Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
The instructions space for 'Multiply and multiply-accumulate' instructions contains some undefined patterns. We need to reject probing of these because they may in future become defined and the kprobes code may then emulate them faultily. This has already happened with the new MLS instruction which this patch also adds correct decoding for as well as tightening up other decoding tests. (Before this patch the wrong emulation routine was being called for MLS though it still produced correct results.) Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
The MRS instruction should set mode and interrupt bits in the read value so it is simpler to use a new simulation routine (simulate_mrs) rather than some modified emulation. prep_emulate_rd12 is now unused and removed. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
We need to reject probing of instructions which read SPSR because we can't handle this as the value in SPSR is lost when the exception handler for the probe breakpoint first runs. This patch also fixes the bitmask for MRS instructions decoding to include checking bits 5-7. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
Emulation of instructions like "ADD rd, rn, #<const>" would result in a corrupted value for rd. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
Probing these instructions was corrupting R0 because the emulation code didn't account for the fact that they don't write a result to a register. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
Now we have the framework code handling conditionally executed instructions we can remove redundant checks in individual simulation routines. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Jon Medhurst authored
When a kprobe is placed onto conditionally executed ARM instructions, many of the emulation routines used to single step them produce corrupt register results. Rather than fix all of these cases we modify the framework which calls them to test the relevant condition flags and, if the test fails, skip calling the emulation code. Signed-off-by:
Jon Medhurst <tixy@yxit.co.uk> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
Viktor Rosendahl authored
Currently emulate_ldrd and emulate_strd don't even have the adjustment of the PC value, so in case of Rn == PC, it will not update the PC incorrectly but instead load/store from the wrong address. Let's add both the adjustment of the PC value and the check for PC == PC. Signed-off-by:
Viktor Rosendahl <viktor.rosendahl@nokia.com> Signed-off-by:
Nicolas Pitre <nicolas.pitre@linaro.org>
-
- 06 Apr, 2011 1 commit
-
-
Linus Torvalds authored
-
- 05 Apr, 2011 13 commits
-
-
git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-blockLinus Torvalds authored
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block: ide: always ensure that blk_delay_queue() is called if we have pending IO block: fix request sorting at unplug dm: improve block integrity support fs: export empty_aops ide: ide_requeue_and_plug() reinstate "always plug" behaviour blk-throttle: don't call xchg on bool ufs: remove unessecary blk_flush_plug block: make the flush insertion use the tail of the dispatch list block: get rid of elv_insert() interface block: dump request state on seeing a corrupted request completion
-
Eric Paris authored
On an error path in inotify_init1 a normal user can trigger a double free of struct user. This is a regression introduced by a2ae4cc9 ("inotify: stop kernel memory leak on file creation failure"). We fix this by making sure that if a group exists the user reference is dropped when the group is cleaned up. We should not explictly drop the reference on error and also drop the reference when the group is cleaned up. The new lifetime rules are that an inotify group lives from inotify_new_group to the last fsnotify_put_group. Since the struct user and inotify_devs are directly tied to this lifetime they are only changed/updated in those two locations. We get rid of all special casing of struct user or user->inotify_devs. Signed-off-by:
Eric Paris <eparis@redhat.com> Cc: stable@kernel.org (2.6.37 and up) Signed-off-by:
Linus Torvalds <torvalds@linux-foundation.org>
-
Jens Axboe authored
Just because we are not requeuing a request does not mean that some aren't pending. So always issue a blk_delay_queue() if either we are requeueing OR there's pending IO. This fixes a boot problem for some IDE boxes. Signed-off-by:
Jens Axboe <jaxboe@fusionio.com>
-
Konstantin Khlebnikov authored
Comparison function for list_sort() must be anticommutative, otherwise it is not sorting in ordinary meaning. But fortunately list_sort() always check ((*cmp)(priv, a, b) <= 0) it not distinguish negative and zero, so comparison function can implement only less-or-equal instead of full three-way comparison. Signed-off-by:
Konstantin Khlebnikov <khlebnikov@openvz.org> Signed-off-by:
Jens Axboe <jaxboe@fusionio.com>
-
Mike Snitzer authored
The current block integrity (DIF/DIX) support in DM is verifying that all devices' integrity profiles match during DM device resume (which is past the point of no return). To some degree that is unavoidable (stacked DM devices force this late checking). But for most DM devices (which aren't stacking on other DM devices) the ideal time to verify all integrity profiles match is during table load. Introduce the notion of an "initialized" integrity profile: a profile that was blk_integrity_register()'d with a non-NULL 'blk_integrity' template. Add blk_integrity_is_initialized() to allow checking if a profile was initialized. Update DM integrity support to: - check all devices with _initialized_ integrity profiles match during table load; uninitialized profiles (e.g. for underlying DM device(s) of a stacked DM device) are ignored. - disallow a table load that would result in an integrity profile that conflicts with a DM device's existing (in-use) integrity profile - avoid clearing an existing integrity profile - validate all integrity profiles match during resume; but if they don't all we can do is report the mismatch (during resume we're past the point of no return) Signed-off-by:
Mike Snitzer <snitzer@redhat.com> Cc: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by:
Jens Axboe <jaxboe@fusionio.com>
-
Jens Axboe authored
With the ->sync_page() hook gone, we have a few users that add their own static address_space_operations without any functions defined. fs/inode.c already has an empty_aops that it uses for init purposes. Lets export that and use it in the places where an otherwise empty aops was defined. Signed-off-by:
Jens Axboe <jaxboe@fusionio.com>
-
Jens Axboe authored
We see stalls if we don't always ensure that the queue gets run again. Even if rq == NULL, we could have other pending requests in the queue. Signed-off-by:
Jens Axboe <jaxboe@fusionio.com>
-
Andreas Schwab authored
xchg does not work portably with smaller than 32bit types. Signed-off-by:
Andreas Schwab <schwab@linux-m68k.org> Signed-off-by:
Jens Axboe <jaxboe@fusionio.com>
-
Christoph Hellwig authored
We already flush the per-process plugging list when context switching, so a blk_flush_plug call just before a yield() is not needed. Signed-off-by:
Christoph Hellwig <hch@lst.de> Signed-off-by:
Jens Axboe <jaxboe@fusionio.com>
-
Jens Axboe authored
It's not a preempt type request, in fact we have to insert it behind requests that do specify INSERT_FRONT. Signed-off-by:
Jens Axboe <jaxboe@fusionio.com>
-
Jens Axboe authored
Merge it with __elv_add_request(), it's pretty pointless to have a function with only two callers. The main interface is elv_add_request()/__elv_add_request(). Signed-off-by:
Jens Axboe <jaxboe@fusionio.com>
-
Jens Axboe authored
Currently we just dump a non-informative 'request botched' message. Lets actually try and print something sane to help debug issues around this. Signed-off-by:
Jens Axboe <jaxboe@fusionio.com>
-
git://git.kernel.org/pub/scm/linux/kernel/git/keithp/linux-2.6Linus Torvalds authored
* 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/keithp/linux-2.6: drm/i915/lvds: Remove 0xa0 DDC probe for LVDS drm/i915/crt: Remove 0xa0 probe for VGA
-