summaryrefslogtreecommitdiff
path: root/arch/mips/kernel/branch.c (follow)
Commit message (Collapse)AuthorAge
* Merge 4.4.223 into android-4.4-pGreg Kroah-Hartman2020-05-11
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes in 4.4.223 mwifiex: fix PCIe register information for 8997 chipset drm/qxl: qxl_release use after free drm/qxl: qxl_release leak in qxl_draw_dirty_fb() staging: rtl8192u: Fix crash due to pointers being "confusing" usb: gadget: f_acm: Fix configfs attr name usb: gadged: pch_udc: get rid of redundant assignments usb: gadget: pch_udc: reorder spin_[un]lock to avoid deadlock usb: gadget: udc: core: don't starve DMA resources MIPS: Fix macro typo MIPS: ptrace: Drop cp0_tcstatus from regoffset_table[] MIPS: BMIPS: Fix PRID_IMP_BMIPS5000 masking for BMIPS5200 MIPS: smp-cps: Stop printing EJTAG exceptions to UART MIPS: scall: Handle seccomp filters which redirect syscalls MIPS: BMIPS: BMIPS5000 has I cache filing from D cache MIPS: BMIPS: Clear MIPS_CACHE_ALIASES earlier MIPS: BMIPS: local_r4k___flush_cache_all needs to blast S-cache MIPS: BMIPS: Pretty print BMIPS5200 processor name MIPS: Fix HTW config on XPA kernel without LPA enabled MIPS: BMIPS: Adjust mips-hpt-frequency for BCM7435 MIPS: math-emu: Fix BC1{EQ,NE}Z emulation MIPS: Fix BC1{EQ,NE}Z return offset calculation MIPS: perf: Fix I6400 event numbers MIPS: KVM: Fix translation of MFC0 ErrCtl MIPS: SMP: Update cpu_foreign_map on CPU disable MIPS: c-r4k: Fix protected_writeback_scache_line for EVA MIPS: Octeon: Off by one in octeon_irq_gpio_map() bpf, mips: fix off-by-one in ctx offset allocation MIPS: RM7000: Double locking bug in rm7k_tc_disable() MIPS: Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO mips/panic: replace smp_send_stop() with kdump friendly version in panic path ARM: dts: armadillo800eva Correct extal1 frequency to 24 MHz ARM: imx: select SRC for i.MX7 ARM: dts: kirkwood: gpio pin fixes for linkstation ls-wxl/wsxl ARM: dts: kirkwood: gpio pin fixes for linkstation ls-wvl/vl ARM: dts: kirkwood: gpio-leds fixes for linkstation ls-wxl/wsxl ARM: dts: kirkwood: gpio-leds fixes for linkstation ls-wvl/vl ARM: dts: orion5x: gpio pin fixes for linkstation lswtgl ARM: dts: orion5x: fix the missing mtd flash on linkstation lswtgl ARM: dts: kirkwood: use unique machine name for ds112 ARM: dts: kirkwood: add kirkwood-ds112.dtb to Makefile ARM: OMAP2+: hwmod: fix _idle() hwmod state sanity check sequence perf/x86: Fix filter_events() bug with event mappings x86/LDT: Print the real LDT base address x86/apic/uv: Silence a shift wrapping warning ALSA: fm801: explicitly free IRQ line ALSA: fm801: propagate TUNER_ONLY bit when autodetected ALSA: fm801: detect FM-only card earlier netfilter: nfnetlink: use original skbuff when acking batches xfrm: fix crash in XFRM_MSG_GETSA netlink handler mwifiex: fix IBSS data path issue. mwifiex: add missing check for PCIe8997 chipset iwlwifi: set max firmware version of 7265 to 17 Bluetooth: btmrvl: fix hung task warning dump dccp: limit sk_filter trim to payload net/mlx4_core: Do not BUG_ON during reset when PCI is offline mlxsw: pci: Correctly determine if descriptor queue is full PCI: Supply CPU physical address (not bus address) to iomem_is_exclusive() net/mlx4_core: Implement pci_resume callback alpha/PCI: Call iomem_is_exclusive() for IORESOURCE_MEM, but not IORESOURCE_IO vfio/pci: Allow VPD short read brcmfmac: add eth_type_trans back for PCIe full dongle mlxsw: Treat local port 64 as valid IB/mlx4: Initialize hop_limit when creating address handle ovs/gre,geneve: fix error path when creating an iface GRE: Disable segmentation offloads w/ CSUM and we are encapsulated via FOU powerpc/pci/of: Parse unassigned resources firmware: actually return NULL on failed request_firmware_nowait() c8sectpfe: Rework firmware loading mechanism net/mlx5: Avoid passing dma address 0 to firmware IB/mlx5: Fix RC transport send queue overhead computation net/mlx5: Make command timeout way shorter IB/mlx5: Fix FW version diaplay in sysfs net/mlx5e: Fix MLX5E_100BASE_T define net/mlx5: Fix the size of modify QP mailbox net/mlx5: Fix masking of reserved bits in XRCD number net/mlx5e: Fix blue flame quota logic net/mlx5: use mlx5_buf_alloc_node instead of mlx5_buf_alloc in mlx5_wq_ll_create net/mlx5: Avoid calling sleeping function by the health poll thread net/mlx5: Fix wait_vital for VFs and remove fixed sleep net/mlx5: Fix potential deadlock in command mode change net/mlx5: Add timeout handle to commands with callback net/mlx5: Fix pci error recovery flow net/mlx5e: Copy all L2 headers into inline segment net_sched: keep backlog updated with qlen sch_drr: update backlog as well sch_hfsc: always keep backlog updated sch_prio: update backlog as well sch_qfq: keep backlog updated with qlen sch_sfb: keep backlog updated with qlen sch_tbf: update backlog as well btrfs: cleaner_kthread() doesn't need explicit freeze irda: Free skb on irda_accept error path. phy: fix device reference leaks bonding: prevent out of bound accesses mtd: nand: fix ONFI parameter page layout ath10k: free cached fw bin contents when get board id fails xprtrdma: checking for NULL instead of IS_ERR() xprtrdma: Fix additional uses of spin_lock_irqsave(rb_lock) xprtrdma: xprt_rdma_free() must not release backchannel reqs xprtrdma: rpcrdma_bc_receive_call() should init rq_private_buf.len RDMA/cxgb3: device driver frees DMA memory with different size mlxsw: spectrum: Don't forward packets when STP state is DISABLED mlxsw: spectrum: Disable learning according to STP state mlxsw: spectrum: Don't count internal TX header bytes to stats mlxsw: spectrum: Indicate support for autonegotiation mlxsw: spectrum: Fix misuse of hard_header_len net: tcp_memcontrol: properly detect ancestor socket pressure tcp: do not set rtt_min to 1 RDS:TCP: Synchronize rds_tcp_accept_one with rds_send_xmit when resetting t_sock net: ipv6: tcp reset, icmp need to consider L3 domain batman-adv: Fix lockdep annotation of batadv_tlv_container_remove batman-adv: replace WARN with rate limited output on non-existing VLAN tty: serial: msm: Support more bauds serial: samsung: Fix possible out of bounds access on non-DT platform Drivers: hv: utils: use memdup_user in hvt_op_write isa: Call isa_bus_init before dependent ISA bus drivers register Btrfs: clean up an error code in btrfs_init_space_info() Input: gpio-keys - fix check for disabling unsupported keys Input: edt-ft5x06 - fix setting gain, offset, and threshold via device tree net/xfrm_input: fix possible NULL deref of tunnel.ip6->parms.i_key xfrm_user: propagate sec ctx allocation errors xfrm: Fix memory leak of aead algorithm name mac80211: fix mgmt-tx abort cookie and leak mac80211: TDLS: always downgrade invalid chandefs mac80211: TDLS: change BW calculation for WIDER_BW peers mac80211: Fix BW upgrade for TDLS peers NFS: Fix an LOCK/OPEN race when unlinking an open file net: get rid of an signed integer overflow in ip_idents_reserve() mtd: nand: denali: add missing nand_release() call in denali_remove() ASoC: Intel: pass correct parameter in sst_alloc_stream_mrfld() ASoC: tegra_alc5632: check return value ASoC: fsl_ssi: mark SACNT register volatile Revert "ACPI / LPSS: allow to use specific PM domain during ->probe()" mmc: sdhci: restore behavior when setting VDD via external regulator mmc: sd: limit SD card power limit according to cards capabilities mmc: debugfs: correct wrong voltage value mmc: block: return error on failed mmc_blk_get() clk: rockchip: Revert "clk: rockchip: reset init state before mmc card initialization" mmc: dw_mmc: rockchip: Set the drive phase properly mmc: moxart: fix wait_for_completion_interruptible_timeout return variable type mmc: sdhci: Fix regression setting power on Trats2 board perf tools: Fix perf regs mask generation powerpc/tm: Fix stack pointer corruption in __tm_recheckpoint() powerpc/book3s: Fix MCE console messages for unrecoverable MCE. sctp: fix the transports round robin issue when init is retransmitted sunrpc: Update RPCBIND_MAXNETIDLEN NFC: nci: memory leak in nci_core_conn_create() net: phy: Avoid polling PHY with PHY_IGNORE_INTERRUPTS net: phy: Fix phy_mac_interrupt() net: phy: bcm7xxx: Fix shadow mode 2 disabling of_mdio: fix node leak in of_phy_register_fixed_link error path phy: micrel: Fix finding PHY properties in MAC node for KSZ9031. net: dsa: slave: fix of-node leak and phy priority drivers: net: cpsw: don't ignore phy-mode if phy-handle is used iommu/dma: Respect IOMMU aperture when allocating mdio-sun4i: oops in error handling in probe iio:ad7797: Use correct attribute_group selftests/ipc: Fix test failure seen after initial test run wimax/i2400m: Fix potential urb refcnt leak cifs: protect updating server->dstaddr with a spinlock scripts/config: allow colons in option strings for sed lib/mpi: Fix building for powerpc with clang net: bcmgenet: suppress warnings on failed Rx SKB allocations net: systemport: suppress warnings on failed Rx SKB allocations rc: allow rc modules to be loaded if rc-main is not a module lirc_imon: do not leave imon_probe() with mutex held am437x-vpfe: fix an uninitialized variable bug cx23885: uninitialized variable in cx23885_av_work_handler() ath9k_htc: check for underflow in ath9k_htc_rx_msg() VFIO: platform: reset: fix a warning message condition net: moxa: fix an error code mfd: lp8788-irq: Uninitialized variable in irq handler ethernet: micrel: fix some error codes power: ipaq-micro-battery: freeing the wrong variable i40e: fix an uninitialized variable bug qede: uninitialized variable in qede_start_xmit() qlcnic: potential NULL dereference in qlcnic_83xx_get_minidump_template() qlcnic: use the correct ring in qlcnic_83xx_process_rcv_ring_diag() target: Fix a memory leak in target_dev_lba_map_store() memory/tegra: Add number of TLB lines for Tegra124 pinctrl: bcm2835: Fix memory leak in error path be2net: Don't leak iomapped memory on removal. ipv4: Fix memory leak in exception case for splitting tries flow_dissector: Check for IP fragmentation even if not using IPv4 address ipv4: fix checksum annotation in udp4_csum_init ipv4: do not abuse GFP_ATOMIC in inet_netconf_notify_devconf() ipv4: accept u8 in IP_TOS ancillary data net: vrf: Fix dev refcnt leak due to IPv6 prefix route ipv6: fix checksum annotation in udp6_csum_init ipv6: do not abuse GFP_ATOMIC in inet6_netconf_notify_devconf() ipv6: add missing netconf notif when 'all' is updated net: ipv6: Fix processing of RAs in presence of VRF netfilter: nf_tables: fix a wrong check to skip the inactive rules netfilter: nft_dynset: fix panic if NFT_SET_HASH is not enabled netfilter: nf_tables: destroy the set if fail to add transaction netfilter: nft_dup: do not use sreg_dev if the user doesn't specify it udp: restore UDPlite many-cast delivery clk: st: avoid uninitialized variable use clk: gpio: handle error codes for of_clk_get_parent_count() clk: ti: omap3+: dpll: use non-locking version of clk_get_rate clk: multiplier: Prevent the multiplier from under / over flowing clk: imx: clk-pllv3: fix incorrect handle of enet powerdown bit clk: xgene: Don't call __pa on ioremaped address cls_bpf: reset class and reuse major in da arm64: bpf: jit JMP_JSET_{X,K} bpf, trace: check event type in bpf_perf_event_read bpf: fix map not being uncharged during map creation failure net/mlx4_core: Fix potential corruption in counters database net/mlx4_core: Fix access to uninitialized index net/mlx4_en: Fix the return value of a failure in VLAN VID add/kill net/mlx4_core: Check device state before unregistering it net/mlx4_core: Fix the resource-type enum in res tracker to conform to FW spec net/mlx4_en: Process all completions in RX rings after port goes up net/mlx4_core: Do not access comm channel if it has not yet been initialized net/mlx4_en: Fix potential deadlock in port statistics flow net/mlx4: Fix uninitialized fields in rule when adding promiscuous mode to device managed flow steering net/mlx4_core: Fix QUERY FUNC CAP flags mlxsw: switchx2: Fix misuse of hard_header_len mlxsw: switchx2: Fix ethernet port initialization sched/fair: Fix calc_cfs_shares() fixed point arithmetics width confusion net_sched: flower: Avoid dissection of unmasked keys pkt_sched: fq: use proper locking in fq_dump_stats() sched/preempt: Fix preempt_count manipulations power: bq27xxx: fix reading for bq27000 and bq27010 power: bq27xxx: fix register numbers of bq27500 power: test_power: correctly handle empty writes power: bq27xxx_battery: Fix bq27541 AveragePower register address power_supply: tps65217-charger: Fix NULL deref during property export net: vrf: Fix dst reference counting net: Don't delete routes in different VRFs vti6: fix input path ipv4: Fix table id reference in fib_sync_down_addr mlx4: do not call napi_schedule() without care xprtrdma: Fix backchannel allocation of extra rpcrdma_reps ALSA: fm801: Initialize chip after IRQ handler is registered bonding: fix length of actor system MIPS: perf: Remove incorrect odd/even counter handling for I6400 Revert "cpufreq: Drop rwsem lock around CPUFREQ_GOV_POLICY_EXIT" net: dsa: mv88e6xxx: unlock DSA and CPU ports gfs2: fix flock panic issue blk-mq: fix undefined behaviour in order_to_size() dm: fix second blk_delay_queue() parameter to be in msec units not jiffies dmaengine: edma: Add probe callback to edma_tptc_driver openvswitch: update checksum in {push,pop}_mpls cxgb4/cxgb4vf: Fixes regression in perf when tx vlan offload is disabled net: bcmgenet: fix skb_len in bcmgenet_xmit_single() net: bcmgenet: device stats are unsigned long ovs/gre: fix rtnl notifications on iface deletion gre: do not assign header_ops in collect metadata mode gre: build header correctly for collect metadata tunnels gre: reject GUE and FOU in collect metadata mode sfc: fix potential stack corruption from running past stat bitmask sfc: clear napi_hash state when copying channels net: bcmsysport: Device stats are unsigned long cxgbi: fix uninitialized flowi6 net: macb: add missing free_netdev() on error in macb_probe() macvtap: segmented packet is consumed tipc: fix the error handling in tipc_udp_enable() net: icmp6_send should use dst dev to determine L3 domain et131x: Fix logical vs bitwise check in et131x_tx_timeout() net: ethernet: stmmac: dwmac-sti: fix probe error path rtnl: reset calcit fptr in rtnl_unregister() net: ethernet: stmmac: dwmac-rk: fix probe error path fq_codel: return non zero qlen in class dumps net: ethernet: stmmac: dwmac-generic: fix probe error path ovs/geneve: fix rtnl notifications on iface deletion bnxt: add a missing rcu synchronization qdisc: fix a module refcount leak in qdisc_create_dflt() net: axienet: Fix return value check in axienet_probe() bnxt_en: Remove locking around txr->dev_state net: ethernet: davinci_emac: Fix devioctl while in fixed link net: ethernet: mvneta: Remove IFF_UNICAST_FLT which is not implemented net: ethernet: ti: cpsw: fix device and of_node leaks net: ethernet: ti: cpsw: fix secondary-emac probe error path net: hns: fix device reference leaks net: bridge: don't increment tx_dropped in br_do_proxy_arp net: dsa: mv88e6xxx: enable SA learning on DSA ports net: ehea: avoid null pointer dereference l2tp: fix use-after-free during module unload hwrng: exynos - Disable runtime PM on driver unbind net: icmp_route_lookup should use rt dev to determine L3 domain net: mvneta: fix trivial cut-off issue in mvneta_ethtool_update_stats net: macb: replace macb_writel() call by queue_writel() to update queue ISR ravb: Add missing free_irq() call to ravb_close() mvpp2: use correct size for memset net: vxlan: lwt: Fix vxlan local traffic. net: ethoc: Fix early error paths ovs/vxlan: fix rtnl notifications on iface deletion net: mv643xx_eth: fix packet corruption with TSO and tiny unaligned packets. regulator: core: Rely on regulator_dev_release to free constraints net: dsa: mv88e6xxx: fix port VLAN maps at803x: fix reset handling cxl: Fix DAR check & use REGION_ID instead of opencoding net: ethernet: davinci_emac: Fix platform_data overwrite ata: sata_dwc_460ex: remove incorrect locking pinctrl: tegra: Correctly check the supported configuration brcmfmac: add fallback for devices that do not report per-chain values brcmfmac: restore stopping netdev queue when bus clogs up bridge: Fix problems around fdb entries pointing to the bridge device bna: add missing per queue ethtool stat net: skbuff: Remove errornous length validation in skb_vlan_pop() net: ep93xx_eth: Do not crash unloading module macvlan: Fix potential use-after free for broadcasts sctp: Fix SHUTDOWN CTSN Ack in the peer restart case ALSA: hda: Match both PCI ID and SSID for driver blacklist mac80211: add ieee80211_is_any_nullfunc() Linux 4.4.223 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: Ie7caca39501fe5e82b947964cc474ed1c786d756
| * MIPS: Fix BC1{EQ,NE}Z return offset calculationPaul Burton2020-05-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit ac1496980f1d2752f26769f5db63afbc9ac2b603 upstream. The conditions for branching when emulating the BC1EQZ & BC1NEZ instructions were backwards, leading to each of those instructions being treated as the other. Fix this by reversing the conditions, and clear up the code a little for readability & checkpatch. Fixes: c8a34581ec09 ("MIPS: Emulate the BC1{EQ,NE}Z FPU instructions") Signed-off-by: Paul Burton <paul.burton@imgtec.com> Reviewed-by: James Hogan <james.hogan@imgtec.com> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/13151/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* | UPSTREAM: MIPS: kernel: Audit and remove any unnecessary uses of module.hPaul Gortmaker2018-02-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically a lot of these existed because we did not have a distinction between what was modular code and what was providing support to modules via EXPORT_SYMBOL and friends. That changed when we forked out support for the latter into the export.h file. This means we should be able to reduce the usage of module.h in code that is obj-y Makefile or bool Kconfig. The advantage in doing so is that module.h itself sources about 15 other headers; adding significantly to what we feed cpp, and it can obscure what headers we are effectively using. Since module.h was the source for init.h (for __init) and for export.h (for EXPORT_SYMBOL) we consider each obj-y/bool instance for the presence of either and replace as needed. In the case of the n32/o32 files, we have to get rid of a couple no-op MODULE_ tags to facilitate the module.h removal. They piggy back off the fs/ elf binary support, which is also a bool Kconfig. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/14032/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org> (cherry picked from commit d9d5417755eda87db8e370e4dd2175fbd8814acc) Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* | UPSTREAM: MIPS: Spelling fix lets -> let'sRalf Baechle2018-02-05
| | | | | | | | | | | | | | | | | | As noticed by Sergei in the discussion of Andrea Gelmini's patch series. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Reported-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> (cherry picked from commit 4939788eb8559754a120531c49ffa96bb30fee06) Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* | UPSTREAM: MIPS: inst.h: Rename cbcond{0,1}_op to pop{1,3}0_opPaul Burton2018-02-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The opcodes currently defined in inst.h as cbcond0_op & cbcond1_op are actually defined in the MIPS base instruction set manuals as pop10 & pop30 respectively. Rename them as such, for consistency with the documentation. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Signed-off-by: James Hogan <james.hogan@imgtec.com> Acked-by: Ralf Baechle <ralf@linux-mips.org> Cc: linux-mips@linux-mips.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> (cherry picked from commit 1b492600068d5fbd033196ce2bdb28735a23747e) Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* | UPSTREAM: MIPS: inst.h: Rename b{eq,ne}zcji[al]c_op to pop{6,7}6_opPaul Burton2018-02-05
|/ | | | | | | | | | | | | | | The opcodes currently defined in inst.h as beqzcjic_op & bnezcjialc_op are actually defined in the MIPS base instruction set manuals as pop66 & pop76 respectively. Rename them as such, for consistency with the documentation. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Signed-off-by: James Hogan <james.hogan@imgtec.com> Acked-by: Ralf Baechle <ralf@linux-mips.org> Cc: linux-mips@linux-mips.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> (cherry picked from commit 1c66b79bb3b11942a98085fd89295cf6cddae41a) Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
* MIPS: Fix a typo: s/preset/present/ in r2-to-r6 emulation error messageMaciej W. Rozycki2017-07-27
| | | | | | | | | | | | | | | commit 27fe2200dad2de8207a694024a7b9037dff1b280 upstream. This is a user-visible message, so we want it to be spelled correctly. Fixes: 5f9f41c474be ("MIPS: kernel: Prepare the JR instruction for emulation on MIPS R6") Signed-off-by: Maciej W. Rozycki <macro@imgtec.com> Cc: James Hogan <james.hogan@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/16400/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* MIPS: Send SIGILL for linked branches in `__compute_return_epc_for_insn'Maciej W. Rozycki2017-07-27
| | | | | | | | | | | | | | | | | | | | commit fef40be6da856afead4177aaa9d869a66fb3381f upstream. Fix commit 319824eabc3f ("MIPS: kernel: branch: Do not emulate the branch likelies on MIPS R6") and also send SIGILL rather than returning -SIGILL for BLTZAL, BLTZALL, BGEZAL and BGEZALL instruction encodings no longer supported in R6, except where emulated. Returning -SIGILL is never correct as the API defines this function's result upon error to be -EFAULT and a signal actually issued. Fixes: 319824eabc3f ("MIPS: kernel: branch: Do not emulate the branch likelies on MIPS R6") Signed-off-by: Maciej W. Rozycki <macro@imgtec.com> Cc: James Hogan <james.hogan@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/16398/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* MIPS: Rename `sigill_r6' to `sigill_r2r6' in `__compute_return_epc_for_insn'Maciej W. Rozycki2017-07-27
| | | | | | | | | | | | | | | | | | | commit 1f4edde422961397cf4470b347958c13c6a740bb upstream. Use the more accurate `sigill_r2r6' name for the label used in the case of sending SIGILL in the absence of the instruction emulator for an earlier ISA level instruction that has been removed as from the R6 ISA, so that the `sigill_r6' name is freed for the situation where an R6 instruction is not supposed to be interpreted, because the executing processor does not support the R6 ISA. Signed-off-by: Maciej W. Rozycki <macro@imgtec.com> Cc: James Hogan <james.hogan@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/16397/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* MIPS: Send SIGILL for BPOSGE32 in `__compute_return_epc_for_insn'Maciej W. Rozycki2017-07-27
| | | | | | | | | | | | | | | | | | | | | | commit 7b82c1058ac1f8f8b9f2b8786b1f710a57a870a8 upstream. Fix commit e50c0a8fa60d ("Support the MIPS32 / MIPS64 DSP ASE.") and send SIGILL rather than SIGBUS whenever an unimplemented BPOSGE32 DSP ASE instruction has been encountered in `__compute_return_epc_for_insn' as our Reserved Instruction exception handler would in response to an attempt to actually execute the instruction. Sending SIGBUS only makes sense for the unaligned PC case, since moved to `__compute_return_epc'. Adjust function documentation accordingly, correct formatting and use `pr_info' rather than `printk' as the other exit path already does. Fixes: e50c0a8fa60d ("Support the MIPS32 / MIPS64 DSP ASE.") Signed-off-by: Maciej W. Rozycki <macro@imgtec.com> Cc: James Hogan <james.hogan@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/16396/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* MIPS: Actually decode JALX in `__compute_return_epc_for_insn'Maciej W. Rozycki2017-07-27
| | | | | | | | | | | | | | | | | | commit a9db101b735a9d49295326ae41f610f6da62b08c upstream. Complement commit fb6883e5809c ("MIPS: microMIPS: Support handling of delay slots.") and actually decode the regular MIPS JALX major instruction opcode, the handling of which has been added with the said commit for EPC calculation in `__compute_return_epc_for_insn'. Fixes: fb6883e5809c ("MIPS: microMIPS: Support handling of delay slots.") Signed-off-by: Maciej W. Rozycki <macro@imgtec.com> Cc: James Hogan <james.hogan@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/16394/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* MIPS: Fix bnezc/jialc return address calculationPaul Burton2017-06-26
| | | | | | | | | | | | | | | | | | | | | | | commit 1a73d9310e093fc3adffba4d0a67b9fab2ee3f63 upstream. The code handling the pop76 opcode (ie. bnezc & jialc instructions) in __compute_return_epc_for_insn() needs to set the value of $31 in the jialc case, which is encoded with rs = 0. However its check to differentiate bnezc (rs != 0) from jialc (rs = 0) was unfortunately backwards, meaning that if we emulate a bnezc instruction we clobber $31 & if we emulate a jialc instruction it actually behaves like a jic instruction. Fix this by inverting the check of rs to match the way the instructions are actually encoded. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Fixes: 28d6f93d201d ("MIPS: Emulate the new MIPS R6 BNEZC and JIALC instructions") Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/16178/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* MIPS: Fix branch emulation for BLTC and BGEC instructionsMarkos Chandras2015-07-09
| | | | | | | | | | | | | | | | | | | | Commits f1b44067c19258b7614e3cd09dfe8d8e12ff5895 ("MIPS: Emulate the new MIPS R6 B{L,G}T{Z,}{AL,}C instructions") and commit a8ff66f52d3f17b5ae793955270675c197f73d6c ("MIPS: Emulate the new MIPS R6 B{L,G}E{Z,}{AL,}C instructions") added support for emulating various branch compact instructions. However, it missed the case for those which use the old BLEZL and BGTZL opcodes leading to random crashes when the R6 emulator is disabled. We fix this by ensuring that the 'rt' field is not zero which is always true for these branch compact instructions. Fixes: f1b44067c192 ("MIPS: Emulate the new MIPS R6 B{L,G}T{Z,}{AL,}C instructions") Fixes: a8ff66f52d3f ("MIPS: Emulate the new MIPS R6 B{L,G}E{Z,}{AL,}C instructions") Cc: <stable@vger.kernel.org> # 4.0+ Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Cc: linux-mips@linux-mips.org Cc: Markos Chandras <markos.chandras@imgtec.com> Patchwork: https://patchwork.linux-mips.org/patch/10582/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* MIPS: LLVMLinux: Fix a 'cast to type not present in union' error.Toma Tabacu2015-04-01
| | | | | | | | | | | | | | | | | | | | | | | | Remove a cast to the 'mips16e_instruction' union inside an if condition and instead do an assignment to a local 'union mips16e_instruction' variable's 'full' member before the if statement and use this variable in the if condition. This is the error message reported by clang: arch/mips/kernel/branch.c:38:8: error: cast to union type from type 'unsigned short' not present in union if (((union mips16e_instruction)inst).ri.opcode ^ ~~~~ The changed code can be compiled successfully by both gcc and clang. Signed-off-by: Toma Tabacu <toma.tabacu@imgtec.com> Signed-off-by: Daniel Sanders <daniel.sanders@imgtec.com> Cc: Andreas Herrmann <andreas.herrmann@caviumnetworks.com> Cc: David Daney <david.daney@cavium.com> Cc: Manuel Lauss <manuel.lauss@gmail.com> Cc: linux-mips@linux-mips.org Cc: linux-kernel@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/9312/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* MIPS: kernel: mips-r2-to-r6-emul: Add R2 emulator for MIPS R6Leonid Yegoshin2015-02-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MIPS R6 removed quite a few R2 instructions. However, there is plenty of <R6 userland code so we add an in-kernel emulator so we can still be able to execute all R2 userland out there. The emulator comes with a handy debugfs under /mips/ directory (r2-emul-stats) to provide some basic statistics of the instructions that are being emulated. Below are some statistics from booting a minimal buildroot image: Instruction Total BDslot ------------------------------ movs 236969 0 hilo 56686 0 muls 55279 0 divs 10941 0 dsps 0 0 bops 1 0 traps 0 0 fpus 0 0 loads 214981 17 stores 103364 0 llsc 56898 0 dsemul 150418 0 jr 370158 bltzl 43 bgezl 1594 bltzll 0 bgezll 0 bltzal 39 bgezal 39 beql 14503 bnel 138741 blezl 0 bgtzl 3988 Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
* MIPS: Emulate the new MIPS R6 BNEZC and JIALC instructionsMarkos Chandras2015-02-17
| | | | | | MIPS R6 uses the <R6 sdc2 opcode for the new BNEZC and JIALC instructions Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
* MIPS: Emulate the new MIPS R6 BEQZC and JIC instructionsMarkos Chandras2015-02-17
| | | | | | MIPS R6 uses the <R6 ldc2 opcode for the new BEQZC and JIC instructions Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
* MIPS: Emulate the new MIPS R6 BALC instructionMarkos Chandras2015-02-17
| | | | | | MIPS R6 uses the <R6 swc2 opcode for the new BALC instructions. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
* MIPS: Emulate the new MIPS R6 BNVC, BNEC and BNEZLAC instructionsMarkos Chandras2015-02-17
| | | | | | | MIPS R6 uses the <R6 DADDI opcode for the new BNVC, BNEC and BNEZLAC instructions. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
* MIPS: Emulate the new MIPS R6 BOVC, BEQC and BEQZALC instructionsMarkos Chandras2015-02-17
| | | | | | | MIPS R6 uses the <R6 ADDI opcode for the new BOVC, BEQC and BEQZALC instructions. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
* MIPS: Emulate the new MIPS R6 branch compact (BC) instructionMarkos Chandras2015-02-17
| | | | | | MIPS R6 uses the <R6 LWC2 opcode for the new BC instruction. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
* MIPS: Emulate the new MIPS R6 B{L,G}T{Z,}{AL,}C instructionsMarkos Chandras2015-02-17
| | | | | | | | | | | | | | MIPS R6 added the following four instructions which share the BGTZ and BGTZL opcode: BLTZALC: Compact branch-and-link if GPR rt is < to zero BGTZALC: Compact branch-and-link if GPR rt is > to zero BLTZL : Compact branch if GPR rt is < to zero BGTZL : Compact branch if GPR rt is > to zero BLTC : Compact branch if GPR rs is less than GPR rt BLTUC : Similar to BLTC but unsigned Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
* MIPS: Emulate the new MIPS R6 B{L,G}Ε{Z,}{AL,}C instructionsMarkos Chandras2015-02-17
| | | | | | | | | | | | | | MIPS R6 added the following four instructions which share the BLEZ and BLEZL opcodes: BLEZALC: Compact branch-and-link if GPR rt is <= to zero BGEZALC: Compact branch-and-link if GPR rt is >= to zero BLEZC : Compact branch if GPR rt is <= to zero BGEZC : Compact branch if GPR rt is >= to zero BGEC : Compact branch if GPR rs is less than or equal to GPR rt BGEUC : Similar to BGEC but unsigned. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
* MIPS: Emulate the BC1{EQ,NE}Z FPU instructionsMarkos Chandras2015-02-17
| | | | | | | | | MIPS R6 introduced the following two branch instructions for COP1: BC1EQZ: Branch if Cop1 (FPR) Register Bit 0 is Equal to Zero BC1NEZ: Branch if Cop1 (FPR) Register Bit 0 is Not Equal to Zero Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
* MIPS: kernel: branch: Do not emulate the branch likelies on MIPS R6Markos Chandras2015-02-17
| | | | | | | | MIPS R6 removed the BLTZL, BGEZL, BLTZAL, BGEZAL, BEQL, BNEL, BLEZL, BGTZL branch likely instructions so we must not try to emulate them on MIPS R6 if the R2-to-R6 emulator is not present. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
* MIPS: kernel: Prepare the JR instruction for emulation on MIPS R6Markos Chandras2015-02-17
| | | | | | | The MIPS R6 JR instruction is an alias to the JALR one, so it may need emulation for non-R6 userlands. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
* MIPS: Fix build with binutils 2.24.51+Manuel Lauss2014-11-07
| | | | | | | | | | | | | | | | | | | | | | | | | Starting with version 2.24.51.20140728 MIPS binutils complain loudly about mixing soft-float and hard-float object files, leading to this build failure since GCC is invoked with "-msoft-float" on MIPS: {standard input}: Warning: .gnu_attribute 4,3 requires `softfloat' LD arch/mips/alchemy/common/built-in.o mipsel-softfloat-linux-gnu-ld: Warning: arch/mips/alchemy/common/built-in.o uses -msoft-float (set by arch/mips/alchemy/common/prom.o), arch/mips/alchemy/common/sleeper.o uses -mhard-float To fix this, we detect if GAS is new enough to support "-msoft-float" command option, and if it does, we can let GCC pass it to GAS; but then we also need to sprinkle the files which make use of floating point registers with the necessary ".set hardfloat" directives. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Cc: Linux-MIPS <linux-mips@linux-mips.org> Cc: Matthew Fortune <Matthew.Fortune@imgtec.com> Cc: Markos Chandras <Markos.Chandras@imgtec.com> Cc: Maciej W. Rozycki <macro@linux-mips.org> Patchwork: https://patchwork.linux-mips.org/patch/8355/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Merge branch '3.15-fixes' into mips-for-linux-nextRalf Baechle2014-06-04
|\
| * MIPS: Fix branch emulation of branch likely instructions.Ralf Baechle2014-05-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two issues: o For beql_op, beql_op, bne_op, bnel_op, blez_op, blezl_op, bgtz_op and bgtzl_op the wrong field was being checked for the instruction opcode. o For blez_op / blezl_op and bgtz_op / bgtzl_op the test was testing for the wrong opcode. This bug got introduced by d8d4e3ae0b5c179c0bfd3f0af5b352d13bea9cfa [MIPS Kprobes: Refactor branch emulation]. Signed-off-by: Ralf Baechle <ralf@linux-mips.org> Acked-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com> Acked-by: Victor Kamensky <kamensky@cisco.com>
* | MIPS: OCTEON: Enable use of FPUDavid Daney2014-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some versions of the assembler will not assemble CFC1 for OCTEON, so override the ISA for these. Add r4k_fpu.o to handle low level FPU initialization. Modify octeon_switch.S to save the FPU registers. And include r4k_switch.S to pick up more FPU support. Get rid of "#define cpu_has_fpu 0" Signed-off-by: David Daney <david.daney@cavium.com> Signed-off-by: Andreas Herrmann <andreas.herrmann@caviumnetworks.com> Cc: linux-mips@linux-mips.org Cc: James Hogan <james.hogan@imgtec.com> Cc: kvm@vger.kernel.org Patchwork: https://patchwork.linux-mips.org/patch/7006/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* | MIPS: Sort out mm_isBranchInstr.Ralf Baechle2014-05-23
|/ | | | | | | | | | | | | | | | | | | | | | | | mm_isBranchInstr() did reside in the math emu code even though it logically is separate and also is used outside the math emu code. In addition GCC 4.9.0 leaves the following unnnecessarily bloated function body for a non-microMIPS configuration: <mm_isBranchInstr>: 105c: afa50004 sw a1,4(sp) 1060: afa60008 sw a2,8(sp) 1064: afa7000c sw a3,12(sp) 1068: 03e00008 jr ra 106c: 00001021 move v0,zero which stores arguments that are never going to be used on the stack frame. Move mm_isBranchInstr() from cp1emu.c to branch.c, then split mm_isBranchInstr() into a __mm_isBranchInstr() core and a mm_isBranchInstr() wrapper inline function which only invokes __mm_isBranchInstr() on microMIPS configurations. This shaves off 112 bytes off the kernel and improves code flow a bit. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* MIPS: Cleanup indentation and whitespaceTony Wu2013-07-01
| | | | | | | Signed-off-by: Tony Wu <tung7970@gmail.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/5536/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* MIPS: MIPS16e: Support handling of delay slots.Steven J. Hill2013-05-09
| | | | | | | Add logic needed to properly calculate exceptions for delay slots when in MIPS16e mode. Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
* MIPS: microMIPS: Support handling of delay slots.Leonid Yegoshin2013-05-09
| | | | | | | | Add logic needed to properly calculate exceptions for delay slots when in microMIPS mode. Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com> Signed-off-by: Steven J. Hill <Steven.Hill@imgtec.com>
* MIPS: Whitespace cleanup.Ralf Baechle2013-02-01
| | | | | | | | Having received another series of whitespace patches I decided to do this once and for all rather than dealing with this kind of patches trickling in forever. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* MIPS Kprobes: Refactor branch emulationManeesh Soni2011-12-07
| | | | | | | | | | | | | | | | | | | | | | This patch refactors MIPS branch emulation code so as to allow skipping delay slot instruction in case of branch likely instructions when branch is not taken. This is useful for keeping the code common for use cases like kprobes where one would like to handle the branch instructions keeping the delay slot instuction also in picture for branch likely instructions. Also allow emulation when instruction to be decoded is not at pt_regs->cp0_epc as in case of kprobes where pt_regs->cp0_epc points to the breakpoint instruction. The patch also exports the function for modules. Signed-off-by: Maneesh Soni <manesoni@cisco.com> Signed-off-by: Victor Kamensky <kamensky@cisco.com> Cc: David Daney <david.daney@cavium.com> Cc: ananth@in.ibm.com Cc: linux-kernel@vger.kernel.org Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/2913/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* MIPS: Sanitize restart logicsAl Viro2010-10-18
| | | | | | | | | | | | | | | Put the original syscall number into ->regs[0] when we leave syscall with error. Use it in restart logics. Everything else will have it 0 since we pass through SAVE_SOME on all the ways in. Note that in places like bad_stack and inllegal_syscall we leave it 0 - it's not restartable. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Cc: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/1698/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* MIPS: Compute branch returns for Cavium OCTEON specific branch instructions.David Daney2009-01-11
| | | | | | | | | For Cavium OCTEON, compute the return epc value for OCTEON specific branch instructions. Signed-off-by: Tomaso Paoletti <tpaoletti@caviumnetworks.com> Signed-off-by: David Daney <ddaney@caviumnetworks.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* [MIPS] Add some __user tagsAtsushi Nemoto2007-07-13
| | | | | Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* [MIPS] Unify mips_fpu_soft_struct and mips_fpu_hard_structs.Atsushi Nemoto2006-06-19
| | | | | | | | | The struct mips_fpu_soft_struct and mips_fpu_hard_struct are completely same now and the kernel fpu emulator assumes that. This patch unifies them to mips_fpu_struct and get rid of mips_fpu_union. Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* [MIPS] Fix branch emulation for floating-point exceptions.Ralf Baechle2006-04-27
| | | | | | | | | | | In the branch emulation for floating-point exceptions, __compute_return_epc must determine for bc1f et al which condition code bit to test. This is based on bits <4:2> of the rt field. The switch statement to distinguish bc1f et al needs to use only the two low bits of rt, but the old code tests on the whole rt field. This patch masks off the proper bits. Signed-off-by: Win Treese <treese@acm.org> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Support the MIPS32 / MIPS64 DSP ASE.Ralf Baechle2005-10-29
| | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* __compute_return_epc() uses CFC1 instruction which might result in aRalf Baechle2005-10-29
| | | | | | | coprocessor unusable exception since the process can lose its fpu context by preemption. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Linux-2.6.12-rc2Linus Torvalds2005-04-16
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!