From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org,
alan@lxorguk.ukuu.org.uk, "David S. Miller" <davem@davemloft.net>
Subject: [47/67] sparc32: Remove uses of %g7 in memcpy implementation.
Date: Tue, 03 Jan 2012 14:30:05 -0800 [thread overview]
Message-ID: <20120103223035.283761837@clark.kroah.org> (raw)
In-Reply-To: <20120103223043.GA26738@kroah.com>
3.0-stable review patch. If anyone has any objections, please let me know.
------------------
From: "David S. Miller" <davem@davemloft.net>
[ Upstream commit 21f74d361dfd6a7d0e47574e315f780d8172084a ]
This is setting things up so that we can correct the return
value, so that it properly returns the original destination
buffer pointer.
Signed-off-by: David S. Miller <davem@davemloft.net>
Tested-by: Kjetil Oftedal <oftedal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
arch/sparc/lib/memcpy.S | 177 ++++++++++++++++++++++++------------------------
1 file changed, 91 insertions(+), 86 deletions(-)
--- a/arch/sparc/lib/memcpy.S
+++ b/arch/sparc/lib/memcpy.S
@@ -235,7 +235,7 @@ FUNC(memcpy) /* %o0=dst %o1=src %o2=len
add %o1, 4, %o1
add %o0, 4, %o0
2:
- andcc %g1, 0xffffff80, %g7
+ andcc %g1, 0xffffff80, %g0
be 3f
andcc %o0, 4, %g0
@@ -245,22 +245,23 @@ FUNC(memcpy) /* %o0=dst %o1=src %o2=len
MOVE_BIGCHUNK(o1, o0, 0x20, o2, o3, o4, o5, g2, g3, g4, g5)
MOVE_BIGCHUNK(o1, o0, 0x40, o2, o3, o4, o5, g2, g3, g4, g5)
MOVE_BIGCHUNK(o1, o0, 0x60, o2, o3, o4, o5, g2, g3, g4, g5)
- subcc %g7, 128, %g7
+ sub %g1, 128, %g1
add %o1, 128, %o1
- bne 5b
+ cmp %g1, 128
+ bge 5b
add %o0, 128, %o0
3:
- andcc %g1, 0x70, %g7
+ andcc %g1, 0x70, %g4
be 80f
andcc %g1, 8, %g0
sethi %hi(80f), %o5
- srl %g7, 1, %o4
- add %g7, %o4, %o4
- add %o1, %g7, %o1
+ srl %g4, 1, %o4
+ add %g4, %o4, %o4
+ add %o1, %g4, %o1
sub %o5, %o4, %o5
jmpl %o5 + %lo(80f), %g0
- add %o0, %g7, %o0
+ add %o0, %g4, %o0
79: /* memcpy_table */
@@ -314,20 +315,21 @@ FUNC(memcpy) /* %o0=dst %o1=src %o2=len
MOVE_BIGALIGNCHUNK(o1, o0, 0x20, o2, o3, o4, o5, g2, g3, g4, g5)
MOVE_BIGALIGNCHUNK(o1, o0, 0x40, o2, o3, o4, o5, g2, g3, g4, g5)
MOVE_BIGALIGNCHUNK(o1, o0, 0x60, o2, o3, o4, o5, g2, g3, g4, g5)
- subcc %g7, 128, %g7
+ subcc %g1, 128, %g1
add %o1, 128, %o1
- bne 82b
+ cmp %g1, 128
+ bge 82b
add %o0, 128, %o0
- andcc %g1, 0x70, %g7
+ andcc %g1, 0x70, %g4
be 84f
andcc %g1, 8, %g0
sethi %hi(84f), %o5
- add %o1, %g7, %o1
- sub %o5, %g7, %o5
+ add %o1, %g4, %o1
+ sub %o5, %g4, %o5
jmpl %o5 + %lo(84f), %g0
- add %o0, %g7, %o0
+ add %o0, %g4, %o0
83: /* amemcpy_table */
@@ -376,124 +378,127 @@ FUNC(memcpy) /* %o0=dst %o1=src %o2=len
86: /* non_aligned */
cmp %o2, 6
bleu 88f
- andcc %o0, 3, %g0
+ nop
+
+ save %sp, -96, %sp
+ andcc %i0, 3, %g0
be 61f
- andcc %o0, 1, %g0
+ andcc %i0, 1, %g0
be 60f
- andcc %o0, 2, %g0
+ andcc %i0, 2, %g0
- ldub [%o1], %g5
- add %o1, 1, %o1
- stb %g5, [%o0]
- sub %o2, 1, %o2
+ ldub [%i1], %g5
+ add %i1, 1, %i1
+ stb %g5, [%i0]
+ sub %i2, 1, %i2
bne 61f
- add %o0, 1, %o0
+ add %i0, 1, %i0
60:
- ldub [%o1], %g3
- add %o1, 2, %o1
- stb %g3, [%o0]
- sub %o2, 2, %o2
- ldub [%o1 - 1], %g3
- add %o0, 2, %o0
- stb %g3, [%o0 - 1]
+ ldub [%i1], %g3
+ add %i1, 2, %i1
+ stb %g3, [%i0]
+ sub %i2, 2, %i2
+ ldub [%i1 - 1], %g3
+ add %i0, 2, %i0
+ stb %g3, [%i0 - 1]
61:
- and %o1, 3, %g2
- and %o2, 0xc, %g3
- and %o1, -4, %o1
+ and %i1, 3, %g2
+ and %i2, 0xc, %g3
+ and %i1, -4, %i1
cmp %g3, 4
sll %g2, 3, %g4
mov 32, %g2
be 4f
- sub %g2, %g4, %g7
+ sub %g2, %g4, %l0
blu 3f
cmp %g3, 0x8
be 2f
- srl %o2, 2, %g3
+ srl %i2, 2, %g3
- ld [%o1], %o3
- add %o0, -8, %o0
- ld [%o1 + 4], %o4
+ ld [%i1], %i3
+ add %i0, -8, %i0
+ ld [%i1 + 4], %i4
b 8f
add %g3, 1, %g3
2:
- ld [%o1], %o4
- add %o0, -12, %o0
- ld [%o1 + 4], %o5
+ ld [%i1], %i4
+ add %i0, -12, %i0
+ ld [%i1 + 4], %i5
add %g3, 2, %g3
b 9f
- add %o1, -4, %o1
+ add %i1, -4, %i1
3:
- ld [%o1], %g1
- add %o0, -4, %o0
- ld [%o1 + 4], %o3
- srl %o2, 2, %g3
+ ld [%i1], %g1
+ add %i0, -4, %i0
+ ld [%i1 + 4], %i3
+ srl %i2, 2, %g3
b 7f
- add %o1, 4, %o1
+ add %i1, 4, %i1
4:
- ld [%o1], %o5
- cmp %o2, 7
- ld [%o1 + 4], %g1
- srl %o2, 2, %g3
+ ld [%i1], %i5
+ cmp %i2, 7
+ ld [%i1 + 4], %g1
+ srl %i2, 2, %g3
bleu 10f
- add %o1, 8, %o1
+ add %i1, 8, %i1
- ld [%o1], %o3
+ ld [%i1], %i3
add %g3, -1, %g3
5:
- sll %o5, %g4, %g2
- srl %g1, %g7, %g5
+ sll %i5, %g4, %g2
+ srl %g1, %l0, %g5
or %g2, %g5, %g2
- st %g2, [%o0]
+ st %g2, [%i0]
7:
- ld [%o1 + 4], %o4
+ ld [%i1 + 4], %i4
sll %g1, %g4, %g2
- srl %o3, %g7, %g5
+ srl %i3, %l0, %g5
or %g2, %g5, %g2
- st %g2, [%o0 + 4]
+ st %g2, [%i0 + 4]
8:
- ld [%o1 + 8], %o5
- sll %o3, %g4, %g2
- srl %o4, %g7, %g5
+ ld [%i1 + 8], %i5
+ sll %i3, %g4, %g2
+ srl %i4, %l0, %g5
or %g2, %g5, %g2
- st %g2, [%o0 + 8]
+ st %g2, [%i0 + 8]
9:
- ld [%o1 + 12], %g1
- sll %o4, %g4, %g2
- srl %o5, %g7, %g5
+ ld [%i1 + 12], %g1
+ sll %i4, %g4, %g2
+ srl %i5, %l0, %g5
addcc %g3, -4, %g3
or %g2, %g5, %g2
- add %o1, 16, %o1
- st %g2, [%o0 + 12]
- add %o0, 16, %o0
+ add %i1, 16, %i1
+ st %g2, [%i0 + 12]
+ add %i0, 16, %i0
bne,a 5b
- ld [%o1], %o3
+ ld [%i1], %i3
10:
- sll %o5, %g4, %g2
- srl %g1, %g7, %g5
- srl %g7, 3, %g3
+ sll %i5, %g4, %g2
+ srl %g1, %l0, %g5
+ srl %l0, 3, %g3
or %g2, %g5, %g2
- sub %o1, %g3, %o1
- andcc %o2, 2, %g0
- st %g2, [%o0]
+ sub %i1, %g3, %i1
+ andcc %i2, 2, %g0
+ st %g2, [%i0]
be 1f
- andcc %o2, 1, %g0
+ andcc %i2, 1, %g0
- ldub [%o1], %g2
- add %o1, 2, %o1
- stb %g2, [%o0 + 4]
- add %o0, 2, %o0
- ldub [%o1 - 1], %g2
- stb %g2, [%o0 + 3]
+ ldub [%i1], %g2
+ add %i1, 2, %i1
+ stb %g2, [%i0 + 4]
+ add %i0, 2, %i0
+ ldub [%i1 - 1], %g2
+ stb %g2, [%i0 + 3]
1:
be 1f
nop
- ldub [%o1], %g2
- stb %g2, [%o0 + 4]
+ ldub [%i1], %g2
+ stb %g2, [%i0 + 4]
1:
- retl
- RETL_INSN
+ ret
+ restore %g0, %g0, %o0
88: /* short_end */
next prev parent reply other threads:[~2012-01-03 22:30 UTC|newest]
Thread overview: 82+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-03 22:30 [00/67] 3.0.16-stable review Greg KH
2012-01-03 22:29 ` [01/67] ARM: OMAP: rx51: fix USB Greg KH
2012-01-03 22:29 ` [02/67] ipip, sit: copy parms.name after register_netdevice Greg KH
2012-01-03 22:29 ` [03/67] rtc: Expire alarms after the time is set Greg KH
2012-01-03 22:46 ` John Stultz
2012-01-03 22:47 ` Greg KH
2012-01-03 23:11 ` John Stultz
2012-01-03 22:29 ` [04/67] rtc: m41t80: Workaround broken alarm functionality Greg KH
2012-01-03 22:29 ` [05/67] drm/i915: prevent division by zero when asking for chipset power Greg KH
2012-01-03 22:29 ` [06/67] cfq-iosched: free cic_index if blkio_alloc_blkg_stats fails Greg KH
2012-01-03 22:29 ` [07/67] cfq-iosched: fix cfq_cic_link() race confition Greg KH
2012-01-03 22:29 ` [08/67] SCSI: zfcp: return early from slave_destroy if slave_alloc returned early Greg KH
2012-01-03 22:29 ` [09/67] SCSI: mpt2sas: _scsih_smart_predicted_fault uses GFP_KERNEL in interrupt context Greg KH
2012-01-03 22:29 ` [10/67] SCSI: fcoe: Fix preempt count leak in fcoe_filter_frames() Greg KH
2012-01-03 22:29 ` [11/67] mac80211: fix another race in aggregation start Greg KH
2012-01-03 22:29 ` [12/67] block: initialize request_queues numa node during Greg KH
2012-01-03 22:29 ` [13/67] ssb: fix init regression with SoCs Greg KH
2012-01-03 22:29 ` [14/67] MXC PWM: should active during DOZE/WAIT/DBG mode Greg KH
2012-01-03 22:29 ` [15/67] Input: synaptics - fix touchpad not working after S2R on Vostro V13 Greg KH
2012-01-03 22:29 ` [16/67] percpu: fix per_cpu_ptr_to_phys() handling of non-page-aligned addresses Greg KH
2012-01-03 22:29 ` [17/67] binary_sysctl(): fix memory leak Greg KH
2012-01-03 22:29 ` [18/67] oom: fix integer overflow of points in oom_badness Greg KH
2012-01-03 22:29 ` [19/67] oprofile: Fix uninitialized memory access when writing to writing to oprofilefs Greg KH
2012-01-03 22:29 ` [20/67] NFSv4.1: Ensure that we handle _all_ SEQUENCE status bits Greg KH
2012-01-03 22:29 ` [21/67] SELinux: Fix RCU deref check warning in sel_netport_insert() Greg KH
2012-01-03 22:29 ` [22/67] nilfs2: unbreak compat ioctl Greg KH
2012-01-03 22:29 ` [23/67] mmc: vub300: fix type of firmware_rom_wait_states module parameter Greg KH
2012-01-03 22:29 ` [24/67] cgroups: fix a css_set not found bug in cgroup_attach_proc Greg KH
2012-01-03 22:29 ` [25/67] mfd: Fix twl-core oops while calling twl_i2c_* for unbound driver Greg KH
2012-01-03 22:29 ` [26/67] vfs: __read_cache_page should use gfp argument rather than GFP_KERNEL Greg KH
2012-01-03 22:29 ` [27/67] media: s5p-fimc: Use correct fourcc for RGB565 colour format Greg KH
2012-01-03 22:29 ` [28/67] ath9k: fix max phy rate at rate control init Greg KH
2012-01-03 22:29 ` [29/67] iwlwifi: do not set the sequence control bit is not needed Greg KH
2012-01-03 22:29 ` [30/67] iwlwifi: allow to switch to HT40 if not associated Greg KH
2012-01-03 22:29 ` [31/67] memcg: keep root group unchanged if creation fails Greg KH
2012-01-03 22:29 ` [32/67] VFS: Fix race between CPU hotplug and lglocks Greg KH
2012-01-03 22:29 ` [33/67] ARM:imx:fix pwm period value Greg KH
2012-01-03 22:29 ` [34/67] ARM: 7214/1: mmc: mmci: Fixup handling of MCI_STARTBITERR Greg KH
2012-01-03 22:29 ` [35/67] ARM: 7220/1: mmc: mmci: Fixup error handling for dma Greg KH
2012-01-03 22:29 ` [36/67] oprofile, arm/sh: Fix oprofile_arch_exit() linkage issue Greg KH
2012-01-03 22:29 ` [37/67] futex: Fix uninterruptible loop due to gate_area Greg KH
2012-01-03 22:29 ` [38/67] watchdog: hpwdt: Changes to handle NX secure bit in 32bit path Greg KH
2012-01-03 22:29 ` [39/67] drm/radeon/kms: bail on BTC parts if MC ucode is missing Greg KH
2012-01-03 22:29 ` [40/67] mm: hugetlb: fix non-atomic enqueue of huge page Greg KH
2012-01-03 22:29 ` [41/67] mpt2sas crashes on shutdown Greg KH
2012-01-03 22:30 ` [42/67] sparc64: Fix MSIQ HV call ordering in pci_sun4v_msiq_build_irq() Greg KH
2012-01-03 22:30 ` [43/67] sparc32: Be less strict in matching %lo part of relocation Greg KH
2012-01-03 22:30 ` [44/67] sparc64: Patch sun4v code sequences properly on module load Greg KH
2012-01-03 22:30 ` [45/67] sparc: Kill custom io_remap_pfn_range() Greg KH
2012-01-03 22:30 ` [46/67] sparc32: Remove non-kernel code from memcpy implementation Greg KH
2012-01-03 22:30 ` Greg KH [this message]
2012-01-03 22:30 ` [48/67] sparc32: Correct the return value of memcpy Greg KH
2012-01-03 22:30 ` [49/67] sparc64: Fix masking and shifting in VIS fpcmp emulation Greg KH
2012-01-03 22:30 ` [50/67] sparc: Fix handling of orig_i0 wrt. debugging when restarting syscalls Greg KH
2012-01-03 22:30 ` [51/67] net: bpf_jit: fix an off-one bug in x86_64 cond jump target Greg KH
2012-01-03 22:30 ` [52/67] ppp: fix pptp double release_sock in pptp_bind() Greg KH
2012-01-03 22:30 ` [53/67] llc: llc_cmsg_rcv was getting called after sk_eat_skb Greg KH
2012-01-03 22:30 ` [54/67] mqprio: Avoid panic if no options are provided Greg KH
2012-01-03 22:30 ` [55/67] net: have ipconfig not wait if no dev is available Greg KH
2012-01-03 22:30 ` [56/67] sch_gred: should not use GFP_KERNEL while holding a spinlock Greg KH
2012-01-03 22:30 ` [57/67] sctp: fix incorrect overflow check on autoclose Greg KH
2012-01-03 22:30 ` [58/67] sctp: Do not account for sizeof(struct sk_buff) in estimated rwnd Greg KH
2012-01-03 22:30 ` [59/67] ipv4: flush route cache after change accept_local Greg KH
2012-01-03 22:30 ` [60/67] ipv4: reintroduce route cache garbage collector Greg KH
2012-01-03 22:30 ` [61/67] ipv4: using prefetch requires including prefetch.h Greg KH
2012-01-03 22:30 ` [62/67] iwlwifi: update SCD BC table for all SCD queues Greg KH
2012-01-03 22:30 ` [63/67] mfd: Fix mismatch in twl4030 mutex lock-unlock Greg KH
2012-01-03 22:30 ` [64/67] mfd: Copy the device pointer to the twl4030-madc structure Greg KH
2012-01-03 22:30 ` [65/67] mfd: Check for twl4030-madc NULL pointer Greg KH
2012-01-03 22:30 ` [66/67] mfd: Turn on the twl4030-madc MADC clock Greg KH
2012-01-03 22:30 ` [67/67] xen/swiotlb: Use page alignment for early buffer allocation Greg KH
2012-01-05 19:18 ` [00/67] 3.0.16-stable review Greg KH
2012-01-05 19:26 ` Greg KH
2012-01-05 22:46 ` Greg KH
2012-01-05 22:44 ` [40/73] mpt2sas: fix non-x86 crash on shutdown Greg KH
2012-01-05 22:44 ` [67/73] xfs: log the inode in ->write_inode calls for kupdate Greg KH
2012-01-05 22:44 ` [68/73] xfs: log all dirty inodes in xfs_fs_sync_fs Greg KH
2012-01-05 22:44 ` [69/73] drm/radeon/kms/atom: fix possible segfault in pm setup Greg KH
2012-01-05 22:44 ` [70/73] hung_task: fix false positive during vfork Greg KH
2012-01-05 22:44 ` [71/73] Revert "rtc: Disable the alarm in the hardware" Greg KH
2012-01-05 22:44 ` [72/73] ptrace: partially fix the do_wait(WEXITED) vs EXIT_DEAD->EXIT_ZOMBIE race Greg KH
2012-01-05 22:44 ` [73/73] ath9k: Fix kernel panic in AR2427 in AP mode Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120103223035.283761837@clark.kroah.org \
--to=gregkh@suse.de \
--cc=akpm@linux-foundation.org \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).