aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-06-27drm/i915: Wait for vblank after enabling the primary plane on BDWVille Syrjälä2-0/+17
BDW signals the flip done interrupt immediately after the DSPSURF write when the plane is disabled. This is true even if we've already armed DSPCNTR to enable the plane at the next vblank. This causes major problems for our page flip code which relies on the flip done interrupts happening at vblank time. So what happens is that we enable the plane, and immediately allow userspace to submit a page flip. If the plane is still in the process of being enabled when the page flip is issued, the flip done gets signalled immediately. Our DSPSURFLIVE check catches this to prevent premature flip completion, but it also means that we don't get a flip done interrupt when the plane actually gets enabled, and so the page flip is never completed. Work around this by re-introducing blocking vblank waits on BDW whenever we enable the primary plane. I removed some of the vblank waits here: commit 6304cd91e7f05f8802ea6f91287cac09741d9c46 Author: Ville Syrjälä <[email protected]> Date: Fri Apr 25 13:30:12 2014 +0300 drm/i915: Drop the excessive vblank waits from modeset codepaths To avoid these blocking vblank waits we should start using the vblank interrupt instead of the flip done interrupt to complete page flips. But that's material for another patch. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79354 Tested-by: Guo Jinxian <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Rodrigo Vivi <[email protected]> Signed-off-by: Jani Nikula <[email protected]>
2014-06-27Merge tag 'kvms390-20140626' of ↵Paolo Bonzini2-14/+13
git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into kvm-master Fix sie.h header related problems introduced during the 3.16 development cycle.
2014-06-27ALSA: hda - Add a fixup for Thinkpad T540pTakashi Iwai1-0/+1
The similar fixup as T440 is needed for supporting the dock on T540. Reported-by: Jim Minter <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-27ALSA: hda - Add another headset pin quirk for some Dell machinesDavid Henningsson1-0/+12
Another quirk to make the headset mic work on some new Dell machines. Cc: Hui Wang <[email protected]> BugLink: https://bugs.launchpad.net/bugs/1297581 Signed-off-by: David Henningsson <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-27efi-pstore: Fix an overflow on 32-bit buildsAndrzej Zaborowski1-1/+1
In generic_id the long int timestamp is multiplied by 100000 and needs an explicit cast to u64. Without that the id in the resulting pstore filename is wrong and userspace may have problems parsing it, but more importantly files in pstore can never be deleted and may fill the EFI flash (brick device?). This happens because when generic pstore code wants to delete a file, it passes the id to the EFI backend which reinterpretes it and a wrong variable name is attempted to be deleted. There's no error message but after remounting pstore, deleted files would reappear. Signed-off-by: Andrew Zaborowski <[email protected]> Acked-by: David Rientjes <[email protected]> Cc: <[email protected]> Signed-off-by: Matt Fleming <[email protected]>
2014-06-26ARM: bcm: Fix bcm and multi_v7 defconfigsOlof Johansson2-2/+3
BCM (Kona/capri platform) has regressed in two ways on this release. First, bcm_defconfig no longer selected the appropriate MMC driver options due to changes in dependencies. Secondly, the new MFD and regulator drivers were not enabled on multi_v7_defconfig, so that caused the system to fail probing MMC there. Fix by enabling the new options as needed. Cc: Matt Porter <[email protected]> Cc: Christian Daudt <[email protected]> Signed-off-by: Olof Johansson <[email protected]>
2014-06-27Merge tag 'drm-intel-fixes-2014-06-26' of ↵Dave Airlie8-38/+46
git://anongit.freedesktop.org/drm-intel into drm-fixes Fixes for 3.16-rc2; regressions, races, and warns; Broadwell PCI IDs. * tag 'drm-intel-fixes-2014-06-26' of git://anongit.freedesktop.org/drm-intel: drm/i915: vlv_prepare_pll is only needed in case of non DSI interfaces drm/i915: Hold the table lock whilst walking the file's idr and counting the objects in debugfs drm/i915: BDW: Adding Reserved PCI IDs. drm/i915: Only mark the ctx as initialised after a SET_CONTEXT operation drm/i915: default to having backlight if VBT not available drm/i915: cache hw power well enabled state
2014-06-26tcm_loop: Fix memory leak in tcm_loop_submission_work error pathNicholas Bellinger1-0/+1
This patch fixes a tcm_loop_cmd descriptor memory leak in the tcm_loop_submission_work() error path, and would result in warnings about leaked tcm_loop_cmd_cache objects at module unload time. Go ahead and invoke kmem_cache_free() to release tl_cmd back to tcm_loop_cmd_cache before calling sc->scsi_done(). Reported-by: Sebastian Herbszt <[email protected]> Tested-by: Sebastian Herbszt <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-06-26iscsi-target: Explicily clear login response PDU in exception pathNicholas Bellinger1-0/+2
This patch adds a explicit memset to the login response PDU exception path in iscsit_tx_login_rsp(). This addresses a regression bug introduced in commit baa4d64b where the initiator would end up not receiving the login response and associated status class + detail, before closing the login connection. Reported-by: Christophe Vu-Brugier <[email protected]> Tested-by: Christophe Vu-Brugier <[email protected]> Cc: [email protected] # 3.10+ Signed-off-by: Nicholas Bellinger <[email protected]>
2014-06-26target: Fix left-over se_lun->lun_sep pointer OOPsNicholas Bellinger1-0/+1
This patch fixes a left-over se_lun->lun_sep pointer OOPs when one of the /sys/kernel/config/target/$FABRIC/$WWPN/$TPGT/lun/$LUN/alua* attributes is accessed after the $DEVICE symlink has been removed. To address this bug, go ahead and clear se_lun->lun_sep memory in core_dev_unexport(), so that the existing checks for show/store ALUA attributes in target_core_fabric_configfs.c work as expected. Reported-by: Sebastian Herbszt <[email protected]> Tested-by: Sebastian Herbszt <[email protected]> Cc: [email protected] Signed-off-by: Nicholas Bellinger <[email protected]>
2014-06-26iscsi-target; Enforce 1024 byte maximum for CHAP_C key valueNicholas Bellinger1-0/+4
This patch adds a check in chap_server_compute_md5() to enforce a 1024 byte maximum for the CHAP_C key value following the requirement in RFC-3720 Section 11.1.4: "..., C and R are large-binary-values and their binary length (not the length of the character string that represents them in encoded form) MUST not exceed 1024 bytes." Reported-by: rahul.rane <[email protected]> Tested-by: rahul.rane <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-06-26iscsi-target: Convert chap_server_compute_md5 to use kstrtoulNicholas Bellinger1-3/+7
This patch converts chap_server_compute_md5() from simple_strtoul() to kstrtoul usage(). This addresses the case where a empty 'CHAP_I=' key value received during mutual authentication would be converted to a '0' by simple_strtoul(), instead of failing the login attempt. Reported-by: Tejas Vaykole <[email protected]> Tested-by: Tejas Vaykole <[email protected]> Signed-off-by: Nicholas Bellinger <[email protected]>
2014-06-26staging: tidspbridge: fix an erroneous removal of parenthesesSuman Anna1-2/+4
Commit 4a9fdbb (staging: core: tiomap3430.c Fix line over 80 characters.) erroneously removed the parentheses around the function pointer leading to the following build error (when enabling the build of TI DSP/Bridge driver): drivers/staging/tidspbridge/core/tiomap3430.c: In function 'bridge_brd_monitor': drivers/staging/tidspbridge/core/tiomap3430.c:283:10: error: invalid type argument of unary '*' (have 'u32') make[3]: *** [drivers/staging/tidspbridge/core/tiomap3430.o] Error 1 Fix this build error properly. Fixes: 4a9fdbb (staging: core: tiomap3430.c Fix line over 80 characters.) Cc: Aybuke Ozdemir <[email protected]> Cc: Peter P Waskiewicz Jr <[email protected]> Cc: Omar Ramirez Luna <[email protected]> Signed-off-by: Suman Anna <[email protected]> Cc: stable <[email protected]> # 3.15 Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-06-26Merge branch 'for-linus' of git://git.kernel.dk/linux-blockLinus Torvalds11-27/+48
Pull block fixes from Jens Axboe: "A small collection of fixes/changes for the current series. This contains: - Removal of dead code from Gu Zheng. - Revert of two bad fixes that went in earlier in this round, marking things as __init that were not purely used from init. - A fix for blk_mq_start_hw_queue() using the __blk_mq_run_hw_queue(), which could place us wrongly. Make it use the non __ variant, which handles cases where we are called from the wrong CPU set. From me. - A fix for drbd, which allocates discard requests without room for the SCSI payload. From Lars Ellenberg. - A fix for user-after-free in the blkcg code from Tejun. - Addition of limiting gaps in SG lists, if the hardware needs it. This is the last pre-req patch for blk-mq to enable the full NVMe conversion. Could wait until 3.17, but it's simple enough so would be nice to have everything we need for the NVMe port in the 3.17 release. From me" * 'for-linus' of git://git.kernel.dk/linux-block: drbd: fix NULL pointer deref in blk_add_request_payload blk-mq: blk_mq_start_hw_queue() should use blk_mq_run_hw_queue() block: add support for limiting gaps in SG lists bio: remove unused macro bip_vec_idx() Revert "block: add __init to elv_register" Revert "block: add __init to blkcg_policy_register" blkcg: fix use-after-free in __blkg_release_rcu() by making blkcg_gq refcnt an atomic_t floppy: format block0 read error message properly
2014-06-26Fix 32-bit regression in block device read(2)Al Viro1-1/+13
blkdev_read_iter() wants to cap the iov_iter by the amount of data remaining to the end of device. That's what iov_iter_truncate() is for (trim iter->count if it's above the given limit). So far, so good, but the argument of iov_iter_truncate() is size_t, so on 32bit boxen (in case of a large device) we end up with that upper limit truncated down to 32 bits *before* comparing it with iter->count. Easily fixed by making iov_iter_truncate() take 64bit argument - it does the right thing after such change (we only reach the assignment in there when the current value of iter->count is greater than the limit, i.e. for anything that would get truncated we don't reach the assignment at all) and that argument is not the new value of iter->count - it's an upper limit for such. The overhead of passing u64 is not an issue - the thing is inlined, so callers passing size_t won't pay any penalty. Reported-and-tested-by: Theodore Tso <[email protected]> Signed-off-by: Al Viro <[email protected]> Tested-by: Alan Cox <[email protected]> Tested-by: Bruno Wolff III <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2014-06-26ext4: Fix hole punching for files with indirect blocksJan Kara1-2/+10
Hole punching code for files with indirect blocks wrongly computed number of blocks which need to be cleared when traversing the indirect block tree. That could result in punching more blocks than actually requested and thus effectively cause a data loss. For example: fallocate -n -p 10240000 4096 will punch the range 10240000 - 12632064 instead of the range 1024000 - 10244096. Fix the calculation. CC: [email protected] Fixes: 8bad6fc813a3a5300f51369c39d315679fd88c72 Signed-off-by: Jan Kara <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]>
2014-06-26ext4: Fix block zeroing when punching holes in indirect block filesJan Kara1-2/+2
free_holes_block() passed local variable as a block pointer to ext4_clear_blocks(). Thus ext4_clear_blocks() zeroed out this local variable instead of proper place in inode / indirect block. We later zero out proper place in inode / indirect block but don't dirty the inode / buffer again which can lead to subtle issues (some changes e.g. to inode can be lost). Signed-off-by: Jan Kara <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]>
2014-06-26of: Check for phys_addr_t overflows in early_init_dt_add_memory_archLaura Abbott1-0/+15
The common early_init_dt_add_memory_arch takes the base and size of a memory region as u64 types. The function never checks if the base and size can actually fit in a phys_addr_t which may be smaller than 64-bits. This may result in incorrect memory being passed to memblock_add if the memory falls outside the range of phys_addr_t. Add range checks for the base and size if phys_addr_t is smaller than u64. Reported-by: Geert Uytterhoeven <[email protected]> Tested-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Laura Abbott <[email protected]> Acked-by: Nicolas Pitre <[email protected]> Signed-off-by: Grant Likely <[email protected]>
2014-06-26ext4: decrement free clusters/inodes counters when block group declared badNamjae Jeon3-0/+47
We should decrement free clusters counter when block bitmap is marked as corrupt and free inodes counter when the allocation bitmap is marked as corrupt to avoid misunderstanding due to incorrect available size in statfs result. User can get immediately ENOSPC error from write begin without reaching for the writepages. Cc: Darrick J. Wong<[email protected]> Reported-by: Amit Sahrawat <[email protected]> Signed-off-by: Namjae Jeon <[email protected]> Signed-off-by: Ashish Sangwan <[email protected]>
2014-06-26ALSA: hda - restore BCLK M/N values when resuming HSW/BDW display controllerMengdong Lin1-7/+58
For Intel Haswell/Broadwell display HD-A controller, the 24MHz HD-A link BCLK is converted from Core Display Clock (CDCLK): BCLK = CDCLK * M / N And there are two registers EM4 and EM5 to program M, N value respectively. The EM4/EM5 values will be lost and when the display power well is disabled. BIOS programs CDCLK selected by OEM and EM4/EM5, but BIOS has no idea about display power well on/off at runtime. So the M/N can be wrong if non-default CDCLK is used when the audio controller resumes, which results in an invalid BCLK and abnormal audio playback rate. So this patch saves and restores valid M/N values on controller suspend/resume. And 'struct hda_intel' is defined to contain standard HD-A 'struct azx' and Intel specific fields, as Takashi suggested. Signed-off-by: Mengdong Lin <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2014-06-26MIPS: Lasat: Fix build error if CRC32 is not enabled.Ralf Baechle1-0/+1
Kconfig doesn't select CRC32 so it's possible to build a Lasat kernel without CONFIG_CRC32 resulting in a build error: LD vmlinux arch/mips/built-in.o: In function `lasat_init_board_info': (.text+0x22c): undefined reference to `crc32_le' arch/mips/built-in.o: In function `lasat_write_eeprom_info': (.text+0x7fc): undefined reference to `crc32_le' make: *** [vmlinux] Error 1 Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26mfd: ab8500: Fix dt irq mappingGrygorii Strashko1-1/+1
The AD8500 defines itself as interrupt-controller in DT, but it doesn't assign DT node to IRQ domain when creates it. As result, of_irq_xx() helpers don't work because they can't find necessary IRQ domain. Hence, fix it by assigning AD8500 core device DT node to IRQ domain when it's created. This patch fixes STE u8500 Snowball boot failure reported by Kevin Hilman https://lkml.org/lkml/2014/5/27/624 Reported-and-tested-by: Kevin Hilman <[email protected]> Signed-off-by: Grygorii Strashko <[email protected]> Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2014-06-26mfd: davinci: Voicecodec needs regmap_mmioArnd Bergmann1-0/+1
Without REGMAP_MMIO, building that driver results in a link error: drivers/built-in.o: In function `davinci_vc_probe': :(.init.text+0x3c1c): undefined reference to `devm_regmap_init_mmio_clk' This adds a Kconfig 'select' statement as the usual way to ensure that REGMAP_MMIO is enabled. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2014-06-26mfd: STw481x: Allow modular buildArnd Bergmann1-1/+1
This driver depends on I2C, which may be a loadable module. While you'd probably want both to be built-in in practice, allowing a modular build avoids possible randconfig link errors. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2014-06-26mfd: UCB1x00: Enable modular buildArnd Bergmann1-1/+1
The UCB1200 / UCB1300 driver uses the MCP_SA11X0 driver, which can be a loadable module, but this results in a link error when UCB1200 itself is built-in: drivers/built-in.o: In function `ucb1x00_io_set_dir': :(.text+0x4a364): undefined reference to `mcp_reg_write' drivers/built-in.o: In function `ucb1x00_io_write': :(.text+0x4a3dc): undefined reference to `mcp_reg_write' drivers/built-in.o: In function `ucb1x00_io_read': :(.text+0x4a400): undefined reference to `mcp_reg_read' drivers/built-in.o: In function `ucb1x00_adc_enable': :(.text+0x4a460): undefined reference to `mcp_enable' ... This can easily be resolved by making CONFIG_MCP_UCB1200 itself a tristate option, since that causes Kconfig to track the dependency correctly. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Lee Jones <[email protected]>
2014-06-26video: omapdss: Fix potential null pointer dereferenceSachin Kamat1-3/+5
kmalloc can return null. Add a check to avoid potential null pointer dereference error when the pointer is accessed later. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2014-06-26video: vt8500lcdfb: Remove kfree call since devm_kzalloc() is usedEmil Goode1-2/+0
We use devm_kzalloc() to allocate memory for the struct vt8500lcd_info pointer fbi, so there is no need to free it in vt8500lcd_remove(). Signed-off-by: Emil Goode <[email protected]> Signed-off-by: Tomi Valkeinen <[email protected]>
2014-06-26drm/i2c: tda998x: add some basic mode validationRussell King1-0/+6
The TDA998x can't handle modes with clocks above 150MHz, or resolutions larger than 8192x2048. Signed-off-by: Russell King <[email protected]>
2014-06-26drm/i2c: tda998x: faster polling for edidRussell King1-2/+2
One of Jean-Francois patches changed the EDID polling to once every 10ms for 10 interations, whereas the original code did 1ms for 100 interations. This appears to cause boot-time detection to take noticably longer. Revert this change. Acked-by: Jean-Francois Moine <[email protected]> Signed-off-by: Russell King <[email protected]>
2014-06-26drm/i2c: tda998x: move drm_i2c_encoder_destroy callGuido Martínez1-1/+1
Currently tda998x_encoder_destroy() calls cec_write() and reg_clear(), as part of the release procedure. Such calls need to access the I2C bus and therefore, we need to call them before drm_i2c_encoder_destroy() which unregisters the I2C device. This commit moves the latter so it's done afterwards. Signed-off-by: Guido Martínez <[email protected]> Signed-off-by: Ezequiel García <[email protected]> Cc: <[email protected]> #v3.9+ Signed-off-by: Russell King <[email protected]>
2014-06-26TC: Handle device_register() errors.Levente Kurusa1-2/+8
Make the TURBOchannel driver bail out if the call to device_register() failed. Signed-off-by: Levente Kurusa <[email protected]> Acked-by: Maciej W. Rozycki <[email protected]> Cc: LKML <[email protected]> Cc: Linux MIPS <[email protected]> Patchwork: https://patchwork.linux-mips.org/patch/6673/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26MIPS: MSC: Prevent out-of-bounds writes to MIPS SC ioremap'd regionMarkos Chandras1-1/+1
Previously, the lower limit for the MIPS SC initialization loop was set incorrectly allowing one extra loop leading to writes beyond the MSC ioremap'd space. More precisely, the value of the 'imp' in the last loop increased beyond the msc_irqmap_t boundaries and as a result of which, the 'n' variable was loaded with an incorrect value. This value was used later on to calculate the offset in the MSC01_IC_SUP which led to random crashes like the following one: CPU 0 Unable to handle kernel paging request at virtual address e75c0200, epc == 8058dba4, ra == 8058db90 [...] Call Trace: [<8058dba4>] init_msc_irqs+0x104/0x154 [<8058b5bc>] arch_init_irq+0xd8/0x154 [<805897b0>] start_kernel+0x220/0x36c Kernel panic - not syncing: Attempted to kill the idle task! This patch fixes the problem Signed-off-by: Markos Chandras <[email protected]> Reviewed-by: James Hogan <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/7118/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26MIPS: bpf: Fix stack space allocation for BPF memwords on MIPS64Markos Chandras1-1/+4
When allocating stack space for BPF memwords we need to use the appropriate 32 or 64-bit instruction to avoid losing the top 32 bits of the stack pointer. Signed-off-by: Markos Chandras <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/7135/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26MIPS: BPF: Use 32 or 64-bit load instruction to load an address to registerMarkos Chandras1-1/+13
When loading a pointer to register we need to use the appropriate 32 or 64bit instruction to preserve the pointers' top 32bits. Signed-off-by: Markos Chandras <[email protected]> Cc: David S. Miller <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/7180/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26MIPS: bpf: Fix PKT_TYPE case for big-endian coresMarkos Chandras1-2/+10
The skb->pkt_type field is defined as follows: u8 pkt_type:3, fclone:2, ipvs_property:1, peeked:1, nf_trace:1 resulting to the following layout in big-endian systems [pkt_type][fclone][ipvs_propery][peeked][nf_trace] ^ ^ | | LSB MSB As a result, the existing code did not work because it was trying to match pkt_type == 7 whereas in reality it is 7<<5 on big-endian systems. This has been fixed in the interpreter in 0dcceabb0c1bf2d4c12a748df9933fad303072a7 "net: filter: fix SKF_AD_PKTTYPE extension on big-endian" The fix is to look for 7<<5 on big-endian systems for the pkt_type field, and shift by 5 so the packet type will be at the lower 3 bits of the A register. Signed-off-by: Markos Chandras <[email protected]> Cc: David S. Miller <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/7132/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26MIPS: BPF: Prevent kernel fall over for >=32bit shiftsMarkos Chandras1-4/+12
Remove BUG_ON() if the shift immediate is >=32 to avoid kernel crashes due to malicious user input. If the shift immediate is >= 32, we simply load the destination register with 0 since only 32-bit instructions are used by JIT so this will do the correct thing even on MIPS64. Signed-off-by: Markos Chandras <[email protected]> Cc: David S. Miller <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/7179/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26MIPS: bpf: Drop update_on_xread and always initialize the X registerMarkos Chandras1-21/+1
Previously, update_on_xread() only set the reset flag if SEEN_X hasn't been set already. However, SEEN_X is used to indicate that X is used as destination or source register so there are some cases where X is only used as source register and we really need to make sure that it has been initialized in time. As a result of which, drop this function and always set X to zero if it's used in any of the opcodes. Signed-off-by: Markos Chandras <[email protected]> Cc: David S. Miller <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/7133/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26MIPS: bpf: Fix is_range() semanticsMarkos Chandras1-7/+5
is_range() was meant to check whether the number is within the s16 range or not. However the return values and consumers expected the exact opposite. We fix that by inverting the logic in the function to return 'true' for < s16 and 'false' for > s16. Signed-off-by: Markos Chandras <[email protected]> Reported-by: Alexei Starovoitov <[email protected]> Cc: David S. Miller <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/7131/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26MIPS: bpf: Use pr_debug instead of pr_warn for unhandled opcodesMarkos Chandras1-2/+2
We should prevent spamming the logs during normal execution of bpf-jit. Signed-off-by: Markos Chandras <[email protected]> Suggested-by: Alexei Starovoitov <[email protected]> Cc: David S. Miller <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/7129/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26MIPS: bpf: Fix return values for VLAN_TAG_PRESENT caseMarkos Chandras1-2/+5
If VLAN_TAG_PRESENT is not zero, then return 1 as expected by classic BPF. Otherwise return 0. Signed-off-by: Markos Chandras <[email protected]> Cc: David S. Miller <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/7128/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26MIPS: bpf: Use correct mask for VLAN_TAG caseMarkos Chandras1-1/+1
Using VLAN_VID_MASK is not correct to get the vlan tag. Use ~VLAN_PRESENT_MASK instead and make sure it's u16 so the top 16-bits will be removed. This will ensure that the emit_andi() code will not treat this as a big 32-bit unsigned value. Signed-off-by: Markos Chandras <[email protected]> Cc: David S. Miller <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/7127/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26MIPS: bpf: Fix branch conditional for BPF_J{GT/GE} casesMarkos Chandras1-1/+1
The sltiu and sltu instructions will set the scratch register to 1 if A <= X|K so fix the emitted branch conditional to check for scratch != zero rather than scratch >= zero which would complicate the resuling branch logic given that MIPS does not have a BGT or BGET instructions to compare general purpose registers directly. Signed-off-by: Markos Chandras <[email protected]> Cc: David S. Miller <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/7126/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26MIPS: bpf: Add SEEN_SKB to flags when looking for the PKT_TYPEMarkos Chandras1-0/+2
The SKF_AD_PKTTYPE uses the skb pointer so make sure it's in the flags so it will be initialized in time. Signed-off-by: Markos Chandras <[email protected]> Cc: David S. Miller <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/7125/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26MIPS: bpf: Use 'andi' instead of 'and' for the VLAN casesMarkos Chandras1-2/+2
The VLAN_VID_MASK and VLAN_TAG_PRESENT are immediates, so using 'and' which expects 3 registers will produce wrong results. Fix this by using the 'andi' instruction. Signed-off-by: Markos Chandras <[email protected]> Cc: David S. Miller <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/7124/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26MIPS: bpf: Return error code if the offset is a negative numberMarkos Chandras1-0/+23
Previously, the negative offset was not checked leading to failures due to trying to load data beyond the skb struct boundaries. Until we have proper asm helpers in place, it's best if we return ENOSUPP if K is negative when trying to JIT the filter or 0 during runtime if we do an indirect load where the value of X is unknown during build time. Signed-off-by: Markos Chandras <[email protected]> Cc: David S. Miller <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/7123/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26MIPS: bpf: Use the LO register to get division's quotientMarkos Chandras1-1/+1
Reading from the HI register to get the division result is wrong. The quotient is placed in the LO register. Signed-off-by: Markos Chandras <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Daniel Borkmann <[email protected]> Cc: Alexei Starovoitov <[email protected]> Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/7122/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26MIPS: mm: uasm: Fix lh micro-assembler instructionMarkos Chandras1-1/+1
Commit d6b3314b49e12e8c349deb4ca28e7028db00728f "MIPS: uasm: Add lh uam instruction" added the 'lh' micro-assembler instruction but it used the 'lw' opcode for it. Fix it by using the correct 'lh' opcode. Signed-off-by: Markos Chandras <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/7121/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26MIPS: uasm: Add SLT uasm instructionMarkos Chandras5-1/+6
It will be used later on by bpf-jit Signed-off-by: Markos Chandras <[email protected]> Cc: [email protected] Cc: Markos Chandras <[email protected]> Patchwork: https://patchwork.linux-mips.org/patch/7120/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26MIPS: uasm: Add s3s1s2 instruction builderMarkos Chandras2-0/+10
It will be used later on by the SLT instruction. Signed-off-by: Markos Chandras <[email protected]> Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/7119/ Signed-off-by: Ralf Baechle <[email protected]>
2014-06-26recordmcount/MIPS: Fix possible incorrect mcount_loc table entries in modulesAlex Smith1-2/+2
On MIPS calls to _mcount in modules generate 2 instructions to load the _mcount address (and therefore 2 relocations). The mcount_loc table should only reference the first of these, so the second is filtered out by checking the relocation offset and ignoring ones that immediately follow the previous one seen. However if a module has an _mcount call at offset 0, the second relocation would not be filtered out due to old_r_offset == 0 being taken to mean that the current relocation is the first one seen, and both would end up in the mcount_loc table. This results in ftrace_make_nop() patching both (adjacent) instructions to branches over the _mcount call sequence like so: 0xffffffffc08a8000: 04 00 00 10 b 0xffffffffc08a8014 0xffffffffc08a8004: 04 00 00 10 b 0xffffffffc08a8018 0xffffffffc08a8008: 2d 08 e0 03 move at,ra ... The second branch is in the delay slot of the first, which is defined to be unpredictable - on the platform on which this bug was encountered, it triggers a reserved instruction exception. Fix by initializing old_r_offset to ~0 and using that instead of 0 to determine whether the current relocation is the first seen. Signed-off-by: Alex Smith <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Patchwork: https://patchwork.linux-mips.org/patch/7098/ Signed-off-by: Ralf Baechle <[email protected]>