<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.linux.ports.sparc">
    <title>gmane.linux.ports.sparc</title>
    <link>http://blog.gmane.org/gmane.linux.ports.sparc</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16421"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16420"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16419"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16418"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16417"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16416"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16414"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16413"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16412"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16411"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16410"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16409"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16408"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16407"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16406"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16405"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16404"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16403"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16402"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.linux.ports.sparc/16401"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16421">
    <title>[PATCH] sparc64: Fix several bugs in quad floating point emulation.</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16421</link>
    <description>&lt;pre&gt;
UltraSPARC-T2 and later do not use the fp_exception_other trap and do
not set the floating point trap type field in the %fsr at all when you
try to execute an unimplemented FPU operation.

Instead, it uses the illegal_instruction trap and it leaves the
floating point trap type field clear.

So we should not validate the %fsr trap type field when do_mathemu()
is invoked from the illegal instruction handler.

Also, the floating point trap type field is 3 bits, not 4 bits.

Signed-off-by: David S. Miller &amp;lt;davem&amp;lt; at &amp;gt;davemloft.net&amp;gt;
---
 arch/sparc/kernel/traps_64.c  |   12 +++++++-----
 arch/sparc/math-emu/math_64.c |   20 ++++++++++++++------
 2 files changed, 21 insertions(+), 11 deletions(-)

diff --git a/arch/sparc/kernel/traps_64.c b/arch/sparc/kernel/traps_64.c
index c72fdf5..3b05e66 100644
--- a/arch/sparc/kernel/traps_64.c
+++ b/arch/sparc/kernel/traps_64.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2054,7 +2054,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void do_fpieee(struct pt_regs *regs)
 do_fpe_common(regs);
 }
 
-extern int do_mathemu(struct pt_regs *, struct fpustate *);
+extern int do_mathemu(struct pt_regs *, struct fpustate *, bool);
 
 void do_fpother(struct pt_regs *regs)
 {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2068,7 +2068,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void do_fpother(struct pt_regs *regs)
 switch ((current_thread_info()-&amp;gt;xfsr[0] &amp;amp; 0x1c000)) {
 case (2 &amp;lt;&amp;lt; 14): /* unfinished_FPop */
 case (3 &amp;lt;&amp;lt; 14): /* unimplemented_FPop */
-ret = do_mathemu(regs, f);
+ret = do_mathemu(regs, f, false);
 break;
 }
 if (ret)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -2308,10 +2308,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void do_illegal_instruction(struct pt_regs *regs)
 } else {
 struct fpustate *f = FPUSTATE;
 
-/* XXX maybe verify XFSR bits like
- * XXX do_fpother() does?
+/* On UltraSPARC T2 and later, FPU insns which
+ * are not implemented in HW signal an illegal
+ * instruction trap and do not set the FP Trap
+ * Trap in the %fsr to unimplemented_FPop.
  */
-if (do_mathemu(regs, f))
+if (do_mathemu(regs, f, true))
 return;
 }
 }
diff --git a/arch/sparc/math-emu/math_64.c b/arch/sparc/math-emu/math_64.c
index 2bbe2f2..1704068 100644
--- a/arch/sparc/math-emu/math_64.c
+++ b/arch/sparc/math-emu/math_64.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -163,7 +163,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; typedef union {
 u64 q[2];
 } *argp;
 
-int do_mathemu(struct pt_regs *regs, struct fpustate *f)
+int do_mathemu(struct pt_regs *regs, struct fpustate *f, bool illegal_insn_trap)
 {
 unsigned long pc = regs-&amp;gt;tpc;
 unsigned long tstate = regs-&amp;gt;tstate;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -218,7 +218,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int do_mathemu(struct pt_regs *regs, struct fpustate *f)
 case FSQRTS: {
 unsigned long x = current_thread_info()-&amp;gt;xfsr[0];
 
-x = (x &amp;gt;&amp;gt; 14) &amp;amp; 0xf;
+x = (x &amp;gt;&amp;gt; 14) &amp;amp; 0x7;
 TYPE(x,1,1,1,1,0,0);
 break;
 }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -226,7 +226,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int do_mathemu(struct pt_regs *regs, struct fpustate *f)
 case FSQRTD: {
 unsigned long x = current_thread_info()-&amp;gt;xfsr[0];
 
-x = (x &amp;gt;&amp;gt; 14) &amp;amp; 0xf;
+x = (x &amp;gt;&amp;gt; 14) &amp;amp; 0x7;
 TYPE(x,2,1,2,1,0,0);
 break;
 }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -357,9 +357,17 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; int do_mathemu(struct pt_regs *regs, struct fpustate *f)
 if (type) {
 argp rs1 = NULL, rs2 = NULL, rd = NULL;
 
-freg = (current_thread_info()-&amp;gt;xfsr[0] &amp;gt;&amp;gt; 14) &amp;amp; 0xf;
-if (freg != (type &amp;gt;&amp;gt; 9))
-goto err;
+/* Starting with UltraSPARC-T2, the cpu does not set the FP Trap
+ * Type field in the %fsr to unimplemented_FPop.  Nor does it
+ * use the fp_exception_other trap.  Instead it signals an
+ * illegal instruction and leaves the FP trap type field of
+ * the %fsr unchanged.
+ */
+if (!illegal_insn_trap) {
+int ftt = (current_thread_info()-&amp;gt;xfsr[0] &amp;gt;&amp;gt; 14) &amp;amp; 0x7;
+if (ftt != (type &amp;gt;&amp;gt; 9))
+goto err;
+}
 current_thread_info()-&amp;gt;xfsr[0] &amp;amp;= ~0x1c000;
 freg = ((insn &amp;gt;&amp;gt; 14) &amp;amp; 0x1f);
 switch (type &amp;amp; 0x3) {
&lt;/pre&gt;</description>
    <dc:creator>David Miller</dc:creator>
    <dc:date>2012-05-25T07:37:14</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16420">
    <title>[GIT] Sparc</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16420</link>
    <description>&lt;pre&gt;
This has the generic strncpy_from_user() implementation architectures
can now use, which we've been developing on linux-arch over the past
few days.

For good measure I ran both a 32-bit and a 64-bit glibc testsuite
run, and the latter of which pointed out an adjustment I needed to
make to sparc's user_addr_max() definition.  Linus, you were right,
STACK_TOP was not the right thing to use, even on sparc itself :-)

From Sam Ravnborg, we have a conversion of sparc32 over to the common
alloc_thread_info_node(), since the aspect which originally blocked
our doing so (sun4c) has been removed.

Please pull, thanks a lot.

The following changes since commit 72c04af9a2d57b7945cf3de8e71461bd80695d50:

  fbdev: sh_mobile_lcdc: Don't confuse line size with pitch (2012-05-21 20:59:32 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc.git master

for you to fetch changes up to c5389831cda3b38a56606a348a537a1332f2d729:

  sparc: Fix user_addr_max() definition. (2012-05-24 13:41:58 -0700)

----------------------------------------------------------------
David S. Miller (6):
      sparc: Add full proper error handling to strncpy_from_user().
      sparc: Optimize strncpy_from_user() zero byte search.
      sparc: Increase portability of strncpy_from_user() implementation.
      kernel: Move REPEAT_BYTE definition into linux/kernel.h
      lib: Sparc's strncpy_from_user is generic enough, move under lib/
      sparc: Fix user_addr_max() definition.

Sam Ravnborg (1):
      sparc32: use the common implementation of alloc_thread_info_node()

 arch/sparc/Kconfig                      |    2 +-
 arch/sparc/include/asm/processor_64.h   |    4 +-
 arch/sparc/include/asm/thread_info_32.h |   11 +--
 arch/sparc/include/asm/uaccess.h        |    6 ++
 arch/sparc/include/asm/uaccess_32.h     |   10 ---
 arch/sparc/include/asm/uaccess_64.h     |    4 -
 arch/sparc/lib/Makefile                 |    2 +-
 arch/sparc/lib/ksyms.c                  |    3 -
 arch/sparc/lib/strncpy_from_user_32.S   |   47 ----------
 arch/sparc/lib/strncpy_from_user_64.S   |  133 ----------------------------
 arch/sparc/lib/usercopy.c               |    1 +
 arch/sparc/mm/srmmu.c                   |   27 ------
 arch/x86/include/asm/word-at-a-time.h   |    4 +-
 fs/namei.c                              |    1 +
 include/linux/kernel.h                  |    2 +
 lib/Kconfig                             |    3 +
 lib/Makefile                            |    2 +
 lib/strncpy_from_user.c                 |  146 +++++++++++++++++++++++++++++++
 18 files changed, 170 insertions(+), 238 deletions(-)
 delete mode 100644 arch/sparc/lib/strncpy_from_user_32.S
 delete mode 100644 arch/sparc/lib/strncpy_from_user_64.S
 create mode 100644 lib/strncpy_from_user.c
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>David Miller</dc:creator>
    <dc:date>2012-05-24T21:32:39</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16419">
    <title>Re: sparc32: some testing</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16419</link>
    <description>&lt;pre&gt;
Hi Marcel.
Thanks for testing. I will take a closer look at this during the
weekend (in the vain hope David beats me..).

Sam
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Sam Ravnborg</dc:creator>
    <dc:date>2012-05-24T21:29:14</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16418">
    <title>Date: 24/05/2012.</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16418</link>
    <description>&lt;pre&gt;Dear friend                                 24/05/2012.
I am Dr Raymond Chien Independent Non-executive Director of Hang Seng
Bank Hong Kong I have a business transaction of $44.5 million USD
to share with you,If interested contact me for more details via my
personal email:  draymndch8&amp;lt; at &amp;gt;yahoo.co.jp
Full names:Address:Age:Occupation:Phone/Fax
Regards: Date: 24/05/2012.
Dr Raymond Chien Kuo Fung 
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>From Hang Seng Bank</dc:creator>
    <dc:date>2012-05-24T20:47:24</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16417">
    <title>[PATCH] sparc: Fix user_addr_max() definition.</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16417</link>
    <description>&lt;pre&gt;
We need to use TASK_SIZE because for 64-bit tasks the value
of STACK_TOP actually sits in the middle of the address space
so we'll get false-negatives.

Adjust the TASK_SIZE definition on sparc64 to accomodate this,
in the context in which user_addr_max() is used we have the
test_thread_flag() definition available but not the one for
test_tsk_thread_flag().

Signed-off-by: David S. Miller &amp;lt;davem&amp;lt; at &amp;gt;davemloft.net&amp;gt;
---

Some glibc testsuite failures for 64-bit showed me that
STACK_TOP isn't the right thing to use here because of
how we place the 64-bit process stack in the middle
of the address space.

Committed to master.

 arch/sparc/include/asm/processor_64.h |    4 +++-
 arch/sparc/include/asm/uaccess.h      |    2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/sparc/include/asm/processor_64.h b/arch/sparc/include/asm/processor_64.h
index e713db2..6ca7709 100644
--- a/arch/sparc/include/asm/processor_64.h
+++ b/arch/sparc/include/asm/processor_64.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -42,7 +42,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #define TASK_SIZE_OF(tsk) \
 (test_tsk_thread_flag(tsk,TIF_32BIT) ? \
  (1UL &amp;lt;&amp;lt; 32UL) : ((unsigned long)-VPTE_SIZE))
-#define TASK_SIZETASK_SIZE_OF(current)
+#define TASK_SIZE \
+(test_thread_flag(TIF_32BIT) ? \
+ (1UL &amp;lt;&amp;lt; 32UL) : ((unsigned long)-VPTE_SIZE))
 #ifdef __KERNEL__
 
 #define STACK_TOP32((1UL &amp;lt;&amp;lt; 32UL) - PAGE_SIZE)
diff --git a/arch/sparc/include/asm/uaccess.h b/arch/sparc/include/asm/uaccess.h
index 20c2acb..0167d26 100644
--- a/arch/sparc/include/asm/uaccess.h
+++ b/arch/sparc/include/asm/uaccess.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -7,7 +7,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #endif
 
 #define user_addr_max() \
-(segment_eq(get_fs(), USER_DS) ? STACK_TOP : ~0UL)
+(segment_eq(get_fs(), USER_DS) ? TASK_SIZE : ~0UL)
 
 extern long strncpy_from_user(char *dest, const char __user *src, long count);
 
&lt;/pre&gt;</description>
    <dc:creator>David Miller</dc:creator>
    <dc:date>2012-05-24T20:57:28</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16416">
    <title>[PATCH 3/3 v2] lib: Sparc's strncpy_from_user is generic enough, move under lib/</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16416</link>
    <description>&lt;pre&gt;
To use this, an architecture simply needs to:

1) Provide a user_addr_max() implementation via asm/uaccess.h

2) Add "select GENERIC_STRNCPY_FROM_USER" to their arch Kcnfig

3) Remove the existing strncpy_from_user() implementation and symbol
   exports their architecture had.

Signed-off-by: David S. Miller &amp;lt;davem&amp;lt; at &amp;gt;davemloft.net&amp;gt;
Acked-by: David Howells &amp;lt;dhowells&amp;lt; at &amp;gt;redhat.com&amp;gt;
---
 arch/sparc/Kconfig        |    1 +
 arch/sparc/lib/usercopy.c |  144 --------------------------------------------
 lib/Kconfig               |    3 +
 lib/Makefile              |    2 +
 lib/strncpy_from_user.c   |  146 +++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 152 insertions(+), 144 deletions(-)
 create mode 100644 lib/strncpy_from_user.c

diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 051af37..2247423 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -32,6 +32,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; config SPARC
 select HAVE_NMI_WATCHDOG if SPARC64
 select HAVE_BPF_JIT
 select GENERIC_SMP_IDLE_THREAD
+select GENERIC_STRNCPY_FROM_USER
 
 config SPARC32
 def_bool !64BIT
diff --git a/arch/sparc/lib/usercopy.c b/arch/sparc/lib/usercopy.c
index 0b12e91..5c4284c 100644
--- a/arch/sparc/lib/usercopy.c
+++ b/arch/sparc/lib/usercopy.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,153 +1,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include &amp;lt;linux/module.h&amp;gt;
-#include &amp;lt;linux/uaccess.h&amp;gt;
 #include &amp;lt;linux/kernel.h&amp;gt;
-#include &amp;lt;linux/errno.h&amp;gt;
 #include &amp;lt;linux/bug.h&amp;gt;
 
-#include &amp;lt;asm/byteorder.h&amp;gt;
-
 void copy_from_user_overflow(void)
 {
 WARN(1, "Buffer overflow detected!\n");
 }
 EXPORT_SYMBOL(copy_from_user_overflow);
-
-static inline long find_zero(unsigned long mask)
-{
-long byte = 0;
-
-#ifdef __BIG_ENDIAN
-#ifdef CONFIG_64BIT
-if (mask &amp;gt;&amp;gt; 32)
-mask &amp;gt;&amp;gt;= 32;
-else
-byte = 4;
-#endif
-if (mask &amp;gt;&amp;gt; 16)
-mask &amp;gt;&amp;gt;= 16;
-else
-byte += 2;
-return (mask &amp;gt;&amp;gt; 8) ? byte : byte + 1;
-#else
-#ifdef CONFIG_64BIT
-if (!((unsigned int) mask)) {
-mask &amp;gt;&amp;gt;= 32;
-byte = 4;
-}
-#endif
-if (!(mask &amp;amp; 0xffff)) {
-mask &amp;gt;&amp;gt;= 16;
-byte += 2;
-}
-return (mask &amp;amp; 0xff) ? byte : byte + 1;
-#endif
-}
-
-#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
-#define IS_UNALIGNED(src, dst)0
-#else
-#define IS_UNALIGNED(src, dst)\
-(((long) dst | (long) src) &amp;amp; (sizeof(long) - 1))
-#endif
-
-/*
- * Do a strncpy, return length of string without final '\0'.
- * 'count' is the user-supplied count (return 'count' if we
- * hit it), 'max' is the address space maximum (and we return
- * -EFAULT if we hit it).
- */
-static inline long do_strncpy_from_user(char *dst, const char __user *src, long count, unsigned long max)
-{
-const unsigned long high_bits = REPEAT_BYTE(0xfe) + 1;
-const unsigned long low_bits = REPEAT_BYTE(0x7f);
-long res = 0;
-
-/*
- * Truncate 'max' to the user-specified limit, so that
- * we only have one limit we need to check in the loop
- */
-if (max &amp;gt; count)
-max = count;
-
-if (IS_UNALIGNED(src, dst))
-goto byte_at_a_time;
-
-while (max &amp;gt;= sizeof(unsigned long)) {
-unsigned long c, v, rhs;
-
-/* Fall back to byte-at-a-time if we get a page fault */
-if (unlikely(__get_user(c,(unsigned long __user *)(src+res))))
-break;
-rhs = c | low_bits;
-v = (c + high_bits) &amp;amp; ~rhs;
-*(unsigned long *)(dst+res) = c;
-if (v) {
-v = (c &amp;amp; low_bits) + low_bits;
-v = ~(v | rhs);
-return res + find_zero(v);
-}
-res += sizeof(unsigned long);
-max -= sizeof(unsigned long);
-}
-
-byte_at_a_time:
-while (max) {
-char c;
-
-if (unlikely(__get_user(c,src+res)))
-return -EFAULT;
-dst[res] = c;
-if (!c)
-return res;
-res++;
-max--;
-}
-
-/*
- * Uhhuh. We hit 'max'. But was that the user-specified maximum
- * too? If so, that's ok - we got as much as the user asked for.
- */
-if (res &amp;gt;= count)
-return res;
-
-/*
- * Nope: we hit the address space limit, and we still had more
- * characters the caller would have wanted. That's an EFAULT.
- */
-return -EFAULT;
-}
-
-/**
- * strncpy_from_user: - Copy a NUL terminated string from userspace.
- * &amp;lt; at &amp;gt;dst:   Destination address, in kernel space.  This buffer must be at
- *         least &amp;lt; at &amp;gt;count bytes long.
- * &amp;lt; at &amp;gt;src:   Source address, in user space.
- * &amp;lt; at &amp;gt;count: Maximum number of bytes to copy, including the trailing NUL.
- *
- * Copies a NUL-terminated string from userspace to kernel space.
- *
- * On success, returns the length of the string (not including the trailing
- * NUL).
- *
- * If access to userspace fails, returns -EFAULT (some data may have been
- * copied).
- *
- * If &amp;lt; at &amp;gt;count is smaller than the length of the string, copies &amp;lt; at &amp;gt;count bytes
- * and returns &amp;lt; at &amp;gt;count.
- */
-long strncpy_from_user(char *dst, const char __user *src, long count)
-{
-unsigned long max_addr, src_addr;
-
-if (unlikely(count &amp;lt;= 0))
-return 0;
-
-max_addr = user_addr_max();
-src_addr = (unsigned long)src;
-if (likely(src_addr &amp;lt; max_addr)) {
-unsigned long max = max_addr - src_addr;
-return do_strncpy_from_user(dst, src, count, max);
-}
-return -EFAULT;
-}
-EXPORT_SYMBOL(strncpy_from_user);
diff --git a/lib/Kconfig b/lib/Kconfig
index 4a8aba2..49cb463 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -16,6 +16,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; config BITREVERSE
 config RATIONAL
 boolean
 
+config GENERIC_STRNCPY_FROM_USER
+bool
+
 config GENERIC_FIND_FIRST_BIT
 bool
 
diff --git a/lib/Makefile b/lib/Makefile
index 18515f0..57538b4 100644
--- a/lib/Makefile
+++ b/lib/Makefile
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -123,6 +123,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; obj-$(CONFIG_SIGNATURE) += digsig.o
 
 obj-$(CONFIG_CLZ_TAB) += clz_tab.o
 
+obj-$(CONFIG_GENERIC_STRNCPY_FROM_USER) += strncpy_from_user.o
+
 hostprogs-y:= gen_crc32table
 clean-files:= crc32table.h
 
diff --git a/lib/strncpy_from_user.c b/lib/strncpy_from_user.c
new file mode 100644
index 0000000..c4c09b0
--- /dev/null
+++ b/lib/strncpy_from_user.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,146 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+#include &amp;lt;linux/module.h&amp;gt;
+#include &amp;lt;linux/uaccess.h&amp;gt;
+#include &amp;lt;linux/kernel.h&amp;gt;
+#include &amp;lt;linux/errno.h&amp;gt;
+
+#include &amp;lt;asm/byteorder.h&amp;gt;
+
+static inline long find_zero(unsigned long mask)
+{
+long byte = 0;
+
+#ifdef __BIG_ENDIAN
+#ifdef CONFIG_64BIT
+if (mask &amp;gt;&amp;gt; 32)
+mask &amp;gt;&amp;gt;= 32;
+else
+byte = 4;
+#endif
+if (mask &amp;gt;&amp;gt; 16)
+mask &amp;gt;&amp;gt;= 16;
+else
+byte += 2;
+return (mask &amp;gt;&amp;gt; 8) ? byte : byte + 1;
+#else
+#ifdef CONFIG_64BIT
+if (!((unsigned int) mask)) {
+mask &amp;gt;&amp;gt;= 32;
+byte = 4;
+}
+#endif
+if (!(mask &amp;amp; 0xffff)) {
+mask &amp;gt;&amp;gt;= 16;
+byte += 2;
+}
+return (mask &amp;amp; 0xff) ? byte : byte + 1;
+#endif
+}
+
+#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
+#define IS_UNALIGNED(src, dst)0
+#else
+#define IS_UNALIGNED(src, dst)\
+(((long) dst | (long) src) &amp;amp; (sizeof(long) - 1))
+#endif
+
+/*
+ * Do a strncpy, return length of string without final '\0'.
+ * 'count' is the user-supplied count (return 'count' if we
+ * hit it), 'max' is the address space maximum (and we return
+ * -EFAULT if we hit it).
+ */
+static inline long do_strncpy_from_user(char *dst, const char __user *src, long count, unsigned long max)
+{
+const unsigned long high_bits = REPEAT_BYTE(0xfe) + 1;
+const unsigned long low_bits = REPEAT_BYTE(0x7f);
+long res = 0;
+
+/*
+ * Truncate 'max' to the user-specified limit, so that
+ * we only have one limit we need to check in the loop
+ */
+if (max &amp;gt; count)
+max = count;
+
+if (IS_UNALIGNED(src, dst))
+goto byte_at_a_time;
+
+while (max &amp;gt;= sizeof(unsigned long)) {
+unsigned long c, v, rhs;
+
+/* Fall back to byte-at-a-time if we get a page fault */
+if (unlikely(__get_user(c,(unsigned long __user *)(src+res))))
+break;
+rhs = c | low_bits;
+v = (c + high_bits) &amp;amp; ~rhs;
+*(unsigned long *)(dst+res) = c;
+if (v) {
+v = (c &amp;amp; low_bits) + low_bits;
+v = ~(v | rhs);
+return res + find_zero(v);
+}
+res += sizeof(unsigned long);
+max -= sizeof(unsigned long);
+}
+
+byte_at_a_time:
+while (max) {
+char c;
+
+if (unlikely(__get_user(c,src+res)))
+return -EFAULT;
+dst[res] = c;
+if (!c)
+return res;
+res++;
+max--;
+}
+
+/*
+ * Uhhuh. We hit 'max'. But was that the user-specified maximum
+ * too? If so, that's ok - we got as much as the user asked for.
+ */
+if (res &amp;gt;= count)
+return res;
+
+/*
+ * Nope: we hit the address space limit, and we still had more
+ * characters the caller would have wanted. That's an EFAULT.
+ */
+return -EFAULT;
+}
+
+/**
+ * strncpy_from_user: - Copy a NUL terminated string from userspace.
+ * &amp;lt; at &amp;gt;dst:   Destination address, in kernel space.  This buffer must be at
+ *         least &amp;lt; at &amp;gt;count bytes long.
+ * &amp;lt; at &amp;gt;src:   Source address, in user space.
+ * &amp;lt; at &amp;gt;count: Maximum number of bytes to copy, including the trailing NUL.
+ *
+ * Copies a NUL-terminated string from userspace to kernel space.
+ *
+ * On success, returns the length of the string (not including the trailing
+ * NUL).
+ *
+ * If access to userspace fails, returns -EFAULT (some data may have been
+ * copied).
+ *
+ * If &amp;lt; at &amp;gt;count is smaller than the length of the string, copies &amp;lt; at &amp;gt;count bytes
+ * and returns &amp;lt; at &amp;gt;count.
+ */
+long strncpy_from_user(char *dst, const char __user *src, long count)
+{
+unsigned long max_addr, src_addr;
+
+if (unlikely(count &amp;lt;= 0))
+return 0;
+
+max_addr = user_addr_max();
+src_addr = (unsigned long)src;
+if (likely(src_addr &amp;lt; max_addr)) {
+unsigned long max = max_addr - src_addr;
+return do_strncpy_from_user(dst, src, count, max);
+}
+return -EFAULT;
+}
+EXPORT_SYMBOL(strncpy_from_user);
&lt;/pre&gt;</description>
    <dc:creator>David Miller</dc:creator>
    <dc:date>2012-05-24T20:26:31</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16414">
    <title>[PATCH 1/3 v2] sparc: Increase portability of strncpy_from_user() implementation.</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16414</link>
    <description>&lt;pre&gt;
Hide details of maximum user address calculation in a new
asm/uaccess.h interface named user_addr_max().

Provide little-endian implementation in find_zero(), which should work
but can probably be improved.

Abstrace alignment check behind IS_UNALIGNED() macro.

Kill double-semicolon, noticed by David Howells.

Signed-off-by: David S. Miller &amp;lt;davem&amp;lt; at &amp;gt;davemloft.net&amp;gt;
---
 arch/sparc/include/asm/uaccess.h |    3 +++
 arch/sparc/lib/usercopy.c        |   32 +++++++++++++++++++++++++++-----
 2 files changed, 30 insertions(+), 5 deletions(-)

diff --git a/arch/sparc/include/asm/uaccess.h b/arch/sparc/include/asm/uaccess.h
index 42a28cf..20c2acb 100644
--- a/arch/sparc/include/asm/uaccess.h
+++ b/arch/sparc/include/asm/uaccess.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -6,6 +6,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include &amp;lt;asm/uaccess_32.h&amp;gt;
 #endif
 
+#define user_addr_max() \
+(segment_eq(get_fs(), USER_DS) ? STACK_TOP : ~0UL)
+
 extern long strncpy_from_user(char *dest, const char __user *src, long count);
 
 #endif
diff --git a/arch/sparc/lib/usercopy.c b/arch/sparc/lib/usercopy.c
index 87f9645..f61ed82 100644
--- a/arch/sparc/lib/usercopy.c
+++ b/arch/sparc/lib/usercopy.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -3,6 +3,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include &amp;lt;linux/errno.h&amp;gt;
 #include &amp;lt;linux/bug.h&amp;gt;
 
+#include &amp;lt;asm/byteorder.h&amp;gt;
+
 void copy_from_user_overflow(void)
 {
 WARN(1, "Buffer overflow detected!\n");
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -14,6 +16,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; EXPORT_SYMBOL(copy_from_user_overflow);
 static inline long find_zero(unsigned long mask)
 {
 long byte = 0;
+
+#ifdef __BIG_ENDIAN
 #ifdef CONFIG_64BIT
 if (mask &amp;gt;&amp;gt; 32)
 mask &amp;gt;&amp;gt;= 32;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -25,8 +29,28 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static inline long find_zero(unsigned long mask)
 else
 byte += 2;
 return (mask &amp;gt;&amp;gt; 8) ? byte : byte + 1;
+#else
+#ifdef CONFIG_64BIT
+if (!((unsigned int) mask)) {
+mask &amp;gt;&amp;gt;= 32;
+byte = 4;
+}
+#endif
+if (!(mask &amp;amp; 0xffff)) {
+mask &amp;gt;&amp;gt;= 16;
+byte += 2;
+}
+return (mask &amp;amp; 0xff) ? byte : byte + 1;
+#endif
 }
 
+#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
+#define IS_UNALIGNED(src, dst)0
+#else
+#define IS_UNALIGNED(src, dst)\
+(((long) dst | (long) src) &amp;amp; (sizeof(long) - 1))
+#endif
+
 /*
  * Do a strncpy, return length of string without final '\0'.
  * 'count' is the user-supplied count (return 'count' if we
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -46,7 +70,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static inline long do_strncpy_from_user(char *dst, const char __user *src, long
 if (max &amp;gt; count)
 max = count;
 
-if (((long) dst | (long) src) &amp;amp; (sizeof(long) - 1))
+if (IS_UNALIGNED(src, dst))
 goto byte_at_a_time;
 
 while (max &amp;gt;= sizeof(unsigned long)) {
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -59,7 +83,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static inline long do_strncpy_from_user(char *dst, const char __user *src, long
 v = (c + high_bits) &amp;amp; ~rhs;
 *(unsigned long *)(dst+res) = c;
 if (v) {
-v = (c &amp;amp; low_bits) + low_bits;;
+v = (c &amp;amp; low_bits) + low_bits;
 v = ~(v | rhs);
 return res + find_zero(v);
 }
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -119,9 +143,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; long strncpy_from_user(char *dst, const char __user *src, long count)
 if (unlikely(count &amp;lt;= 0))
 return 0;
 
-max_addr = ~0UL;
-if (likely(segment_eq(get_fs(), USER_DS)))
-max_addr = STACK_TOP;
+max_addr = user_addr_max();
 src_addr = (unsigned long)src;
 if (likely(src_addr &amp;lt; max_addr)) {
 unsigned long max = max_addr - src_addr;
&lt;/pre&gt;</description>
    <dc:creator>David Miller</dc:creator>
    <dc:date>2012-05-24T20:26:13</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16413">
    <title>[PATCH 0/3 v2] Make sparc's strncpy_from_user() generic.</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16413</link>
    <description>&lt;pre&gt;
Ok, this integrates all the feedback I received and I pushed it
out to my Sparc GIT tree.

I'll ask Linus to pull this stuff in shortly.

Thanks everyone.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>David Miller</dc:creator>
    <dc:date>2012-05-24T20:26:04</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16412">
    <title>sparc32: some testing</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16412</link>
    <description>&lt;pre&gt;Hi,

I gave today's sparc.git a try on a SS20 with SuperSparc-II and
another one with HyperSparc CPUs.
Starting with an UP kernel, I got some bugs on the SuperSparc and a
segfault on the HyperSparc, see below for bootlogs.
I can test patches etc. If more info is required, please let me know.

Thanks,
M

=== HyperSparc ===

SPARCstation 20 MP (4 X RT625), No Keyboard
ROM Rev. 2.25R hyperSPARC, 448 MB memory installed, Serial #8491359.
Ethernet address 8:0:20:81:91:5f, Host ID: 7281915f.

Timeout waiting for ARP/RARP packet
349c00
PROMLIB: obio_ranges 5
PROMLIB: Sun Boot Prom Version 3 Revision 2
Linux version 3.4.0-02583-g4efcac3 (builder&amp;lt; at &amp;gt;jalapeno) (gcc version
4.5.3 (Gentoo 4.5.3-r1 p1.0, pie-0.4.5) ) #2 Thu May 24 18:44:32 CEST
2012
bootconsole [earlyprom0] enabled
ARCH: SUN4M
TYPE: Sun4m SparcStation10/20
Ethernet address: 08:00:20:81:91:5f
SRMMU: Using VAC size of 262144 bytes, line size 64 bytes.
255MB HIGHMEM available.
OF stdout device is: /obio/zs&amp;lt; at &amp;gt;0,100000:a
PROM: Built device tree with 30178 bytes of memory.
Booting Linux...
Power off control detected.
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 112691
Kernel command line: root=/dev/sdb4
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 445292k/458224k available (2592k kernel code, 12932k reserved,
624k data, 124k init, 261616k highmem)
SLUB: Genslabs=15, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:64
Console: colour dummy device 80x25
console [tty0] enabled, bootconsole disabled
PROMLIB: Sun Boot Prom Version 3 Revision 2
Linux version 3.4.0-02583-g4efcac3 (builder&amp;lt; at &amp;gt;jalapeno) (gcc version
4.5.3 (Gentoo 4.5.3-r1 p1.0, pie-0.4.5) ) #2 Thu May 24 18:44:32 CEST
2012
bootconsole [earlyprom0] enabled
ARCH: SUN4M
TYPE: Sun4m SparcStation10/20
Ethernet address: 08:00:20:81:91:5f
SRMMU: Using VAC size of 262144 bytes, line size 64 bytes.
255MB HIGHMEM available.
OF stdout device is: /obio/zs&amp;lt; at &amp;gt;0,100000:a
PROM: Built device tree with 30178 bytes of memory.
Booting Linux...
Power off control detected.
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 112691
Kernel command line: root=/dev/sdb4
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 445292k/458224k available (2592k kernel code, 12932k reserved,
624k data, 124k init, 261616k highmem)
SLUB: Genslabs=15, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:64
Console: colour dummy device 80x25
console [tty0] enabled, bootconsole disabled
Calibrating delay loop... 123.90 BogoMIPS (lpj=247808)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
IOMMU: impl 1 vers 3 table 0xfbc80000[262144 B] map [65536 b]
bio: create slab &amp;lt;bio-0&amp;gt; at 0
SCSI subsystem initialized
Switching to clocksource timer_cs
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
led: version 0.1, Lars Kotthoff &amp;lt;metalhead&amp;lt; at &amp;gt;metalhead.ws&amp;gt;
highmem bounce pool size: 64 pages
msgmni has been set to 358
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
ffd60050: ttyS0 at MMIO 0xf1100000 (irq = 8) is a zs (ESCC)
Console: ttyS0 (SunZilog zs0)
console [ttyS0] enabled
ffd60050: ttyS1 at MMIO 0xf1100004 (irq = 8) is a zs (ESCC)
ffd60130: Keyboard at MMIO 0xf1000000 (irq = 8) is a zs
ffd60130: Mouse at MMIO 0xf1000004 (irq = 8) is a zs
brd: module loaded
esp: esp0, regs[fd00a000:fd009000] irq[2]
esp: esp0 is a FAS100A, 40 MHz (ccf=0), SCSI ID 7
scsi0 : esp
scsi 0:0:1:0: Direct-Access     FUJITSU  MAP3735N SUN72G  0401 PQ: 0 ANSI: 4
scsi target0:0:1: Beginning Domain Validation
scsi target0:0:1: FAST-10 SCSI 10.0 MB/s ST (100 ns, offset 15)
scsi target0:0:1: Domain Validation skipping write tests
scsi target0:0:1: Ending Domain Validation
scsi 0:0:3:0: Direct-Access     FUJITSU  MAP3735N SUN72G  0401 PQ: 0 ANSI: 4
scsi target0:0:3: Beginning Domain Validation
scsi target0:0:3: FAST-10 SCSI 10.0 MB/s ST (100 ns, offset 15)
scsi target0:0:3: Domain Validation skipping write tests
scsi target0:0:3: Ending Domain Validation
esp: esp1, regs[fd00c000:fd00b000] irq[7]
esp: esp1 is a FASHME, 40 MHz (ccf=0), SCSI ID 7
scsi1 : esp
sd 0:0:1:0: [sda] 143374738 512-byte logical blocks: (73.4 GB/68.3 GiB)
sd 0:0:3:0: [sdb] 143374738 512-byte logical blocks: (73.4 GB/68.3 GiB)
sd 0:0:1:0: [sda] Write Protect is off
sd 0:0:3:0: [sdb] Write Protect is off
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky &amp;lt;maxk&amp;lt; at &amp;gt;qualcomm.com&amp;gt;
sunlance.c:v2.02 8/24/03 Miguel de Icaza (miguel&amp;lt; at &amp;gt;nuclecu.unam.mx)
ioremap: done with statics, switching to malloc
sd 0:0:1:0: [sda] Write cache: disabled, read cache: enabled, doesn't
support DPO or FUA
sd 0:0:3:0: [sdb] Write cache: disabled, read cache: enabled, doesn't
support DPO or FUA
eth0: LANCE 08:00:20:81:91:5f
sunhme.c:v3.10 August 26, 2008 David S. Miller (davem&amp;lt; at &amp;gt;davemloft.net)
eth1: HAPPY MEAL (SBUS) 10/100baseT Ethernet 08:00:20:81:91:5f
mousedev: PS/2 mouse device common for all mice
 sdb: sdb1 sdb2 sdb3 sdb4 sdb5 sdb6 sdb7
 sda: sda1 sda2 sda3
rtc-m48t59 rtc-m48t59.0: rtc core: registered m48t08 as rtc0
TCP: cubic registered
NET: Registered protocol family 17
sd 0:0:3:0: [sdb] Attached SCSI disk
rtc-m48t59 rtc-m48t59.0: setting system clock to 2012-05-24 17:57:10
UTC (1337882230)
sd 0:0:1:0: [sda] Attached SCSI disk
kjournald starting.  Commit interval 5 seconds
EXT3-fs (sdb4): mounted filesystem with ordered data mode
VFS: Mounted root (ext3 filesystem) readonly on device 8:20.
Freeing unused kernel memory: 124k freed
init[1]: segfault at 0 ip 5000dac8 (rpc f0008c6c) sp efb7b8a0 error
30001 in ld-2.3.5.so[50000000+1a000]
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[f00244f4 : do_group_exit+0x28/0xb0 ]
[f002e850 : get_signal_to_deliver+0x198/0x4dc ]
[f000ba58 : do_signal+0x44/0x768 ]
[f000c4f4 : do_notify_resume+0x2c/0x3c ]
[f00099bc : signal_p+0x14/0x24 ]
[f0008c6c : srmmu_fault+0x58/0x68 ]

Press Stop-A (L1-A) to return to the boot prom



=== SuperSparc ===

SPARCstation 20 MP (2 X SuperSPARC-II), No Keyboard
ROM Rev. 2.25, 448 MB memory installed, Serial #8021487.
Ethernet address 8:0:20:7a:65:ef, Host ID: 727a65ef.

Timeout waiting for ARP/RARP packet
349c00
Server IP address: 192.168.178.250
Client IP address: 192.168.178.75
PROMLIB: obio_ranges 5
PROMLIB: Sun Boot Prom Version 3 Revision 2
Linux version 3.4.0-02583-g4efcac3 (builder&amp;lt; at &amp;gt;jalapeno) (gcc version
4.5.3 (Gentoo 4.5.3-r1 p1.0, pie-0.4.5) ) #2 Thu May 24 18:44:32 CEST
2012
bootconsole [earlyprom0] enabled
ARCH: SUN4M
TYPE: Sun4m SparcStation10/20
Ethernet address: 08:00:20:7a:65:ef
255MB HIGHMEM available.
OF stdout device is: /obio/zs&amp;lt; at &amp;gt;0,100000:a
PROM: Built device tree with 26926 bytes of memory.
Booting Linux...
Power off control detected.
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 112714
Kernel command line: root=/dev/sda4
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 444432k/457932k available (2592k kernel code, 13500k reserved,
624k data, 124k init, 261324k highmem)
SLUB: Genslabs=15, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:64
Console: colour dummy device 80x25
console [tty0] enabled, bootconsole disabled
PROMLIB: Sun Boot Prom Version 3 Revision 2
Linux version 3.4.0-02583-g4efcac3 (builder&amp;lt; at &amp;gt;jalapeno) (gcc version
4.5.3 (Gentoo 4.5.3-r1 p1.0, pie-0.4.5) ) #2 Thu May 24 18:44:32 CEST
2012
bootconsole [earlyprom0] enabled
ARCH: SUN4M
TYPE: Sun4m SparcStation10/20
Ethernet address: 08:00:20:7a:65:ef
255MB HIGHMEM available.
OF stdout device is: /obio/zs&amp;lt; at &amp;gt;0,100000:a
PROM: Built device tree with 26926 bytes of memory.
Booting Linux...
Power off control detected.
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 112714
Kernel command line: root=/dev/sda4
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 444432k/457932k available (2592k kernel code, 13500k reserved,
624k data, 124k init, 261324k highmem)
SLUB: Genslabs=15, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:64
Console: colour dummy device 80x25
console [tty0] enabled, bootconsole disabled
Calibrating delay loop... 74.24 BogoMIPS (lpj=148480)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
IOMMU: impl 1 vers 3 table 0xfbc80000[262144 B] map [65536 b]
bio: create slab &amp;lt;bio-0&amp;gt; at 0
SCSI subsystem initialized
Switching to clocksource timer_cs
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
led: version 0.1, Lars Kotthoff &amp;lt;metalhead&amp;lt; at &amp;gt;metalhead.ws&amp;gt;
highmem bounce pool size: 64 pages
msgmni has been set to 357
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
ffd5c3c0: ttyS0 at MMIO 0xf1100000 (irq = 8) is a zs (ESCC)
Console: ttyS0 (SunZilog zs0)
console [ttyS0] enabled
ffd5c3c0: ttyS1 at MMIO 0xf1100004 (irq = 8) is a zs (ESCC)
ffd5c4a0: Keyboard at MMIO 0xf1000000 (irq = 8) is a zs
ffd5c4a0: Mouse at MMIO 0xf1000004 (irq = 8) is a zs
brd: module loaded
esp: esp0, regs[fd00a000:fd009000] irq[2]
esp: esp0 is a FAS100A, 40 MHz (ccf=0), SCSI ID 7
scsi0 : esp
scsi 0:0:3:0: Direct-Access     FUJITSU  MAP3735N SUN72G  0401 PQ: 0 ANSI: 4
scsi target0:0:3: Beginning Domain Validation
scsi target0:0:3: FAST-10 SCSI 10.0 MB/s ST (100 ns, offset 15)
scsi target0:0:3: Domain Validation skipping write tests
scsi target0:0:3: Ending Domain Validation
esp: esp1, regs[fd00c000:fd00b000] irq[7]
esp: esp1 is a FASHME, 40 MHz (ccf=0), SCSI ID 7
scsi1 : esp
sd 0:0:3:0: [sda] 143374738 512-byte logical blocks: (73.4 GB/68.3 GiB)
sd 0:0:3:0: [sda] Write Protect is off
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky &amp;lt;maxk&amp;lt; at &amp;gt;qualcomm.com&amp;gt;
sunlance.c:v2.02 8/24/03 Miguel de Icaza (miguel&amp;lt; at &amp;gt;nuclecu.unam.mx)
ioremap: done with statics, switching to malloc
sd 0:0:3:0: [sda] Write cache: disabled, read cache: enabled, doesn't
support DPO or FUA
eth0: LANCE 08:00:20:7a:65:ef
sunhme.c:v3.10 August 26, 2008 David S. Miller (davem&amp;lt; at &amp;gt;davemloft.net)
eth1: HAPPY MEAL (SBUS) 10/100baseT Ethernet 08:00:20:7a:65:ef
mousedev: PS/2 mouse device common for all mice
 sda: sda1 sda2 sda3 sda4 sda5 sda6 sda7
rtc-m48t59 rtc-m48t59.0: rtc core: registered m48t08 as rtc0
TCP: cubic registered
NET: Registered protocol family 17
rtc-m48t59 rtc-m48t59.0: setting system clock to 2007-05-09 14:27:28
UTC (1178720848)
sd 0:0:3:0: [sda] Attached SCSI disk
kjournald starting.  Commit interval 5 seconds
EXT3-fs (sda4): mounted filesystem with ordered data mode
VFS: Mounted root (ext3 filesystem) readonly on device 8:4.
Freeing unused kernel memory: 124k freed
INIT: version 2.86 booting
...

cat /proc/cpuinfo
cpu             : Texas Instruments, Inc. - SuperSparc-(II)
fpu             : SuperSparc on-chip FPU
promlib         : Version 3 Revision 2
prom            : 2.25
type            : sun4m
ncpus probed    : 2
ncpus active    : 1
CPU0Bogo        : 74.24
CPU0ClkTck      : 75000000
MMU type        : TI Viking/MXCC
contexts        : 65536
nocache total   : 5242880
nocache used    : 464128

dmesg
PROMLIB: Sun Boot Prom Version 3 Revision 2
Linux version 3.4.0-02583-g4efcac3 (builder&amp;lt; at &amp;gt;jalapeno) (gcc version
4.5.3 (Gentoo 4.5.3-r1 p1.0, pie-0.4.5) ) #2 Thu May 24 18:44:32 CEST
2012
bootconsole [earlyprom0] enabled
ARCH: SUN4M
TYPE: Sun4m SparcStation10/20
Ethernet address: 08:00:20:7a:65:ef
255MB HIGHMEM available.
On node 0 totalpages: 113609
free_area_init_node: node 0, pgdat f0326a54, node_mem_map f0980a00
  DMA zone: 384 pages used for memmap
  DMA zone: 0 pages reserved
  DMA zone: 47894 pages, LIFO batch:15
  HighMem zone: 511 pages used for memmap
  HighMem zone: 64820 pages, LIFO batch:15
OF stdout device is: /obio/zs&amp;lt; at &amp;gt;0,100000:a
PROM: Built device tree with 26926 bytes of memory.
Booting Linux...
Power off control detected.
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: [0] 0
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 112714
Kernel command line: root=/dev/sda4
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 444432k/457932k available (2592k kernel code, 13500k reserved,
624k data, 124k init, 261324k highmem)
SLUB: Genslabs=15, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
NR_IRQS:64
Console: colour dummy device 80x25
console [tty0] enabled, bootconsole disabled
Calibrating delay loop... 74.24 BogoMIPS (lpj=148480)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
IOMMU: impl 1 vers 3 table 0xfbc80000[262144 B] map [65536 b]
bio: create slab &amp;lt;bio-0&amp;gt; at 0
SCSI subsystem initialized
Switching to clocksource timer_cs
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes)
TCP established hash table entries: 8192 (order: 4, 65536 bytes)
TCP bind hash table entries: 8192 (order: 3, 32768 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
led: version 0.1, Lars Kotthoff &amp;lt;metalhead&amp;lt; at &amp;gt;metalhead.ws&amp;gt;
highmem bounce pool size: 64 pages
msgmni has been set to 357
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
ffd5c3c0: ttyS0 at MMIO 0xf1100000 (irq = 8) is a zs (ESCC)
Console: ttyS0 (SunZilog zs0)
console [ttyS0] enabled
ffd5c3c0: ttyS1 at MMIO 0xf1100004 (irq = 8) is a zs (ESCC)
ffd5c4a0: Keyboard at MMIO 0xf1000000 (irq = 8) is a zs
ffd5c4a0: Mouse at MMIO 0xf1000004 (irq = 8) is a zs
brd: module loaded
esp: esp0, regs[fd00a000:fd009000] irq[2]
esp: esp0 is a FAS100A, 40 MHz (ccf=0), SCSI ID 7
scsi0 : esp
scsi 0:0:3:0: Direct-Access     FUJITSU  MAP3735N SUN72G  0401 PQ: 0 ANSI: 4
scsi target0:0:3: Beginning Domain Validation
scsi target0:0:3: FAST-10 SCSI 10.0 MB/s ST (100 ns, offset 15)
scsi target0:0:3: Domain Validation skipping write tests
scsi target0:0:3: Ending Domain Validation
esp: esp1, regs[fd00c000:fd00b000] irq[7]
esp: esp1 is a FASHME, 40 MHz (ccf=0), SCSI ID 7
scsi1 : esp
tun: Universal TUN/TAP device driver, 1.6
tun: (C) 1999-2004 Max Krasnyansky &amp;lt;maxk&amp;lt; at &amp;gt;qualcomm.com&amp;gt;
sd 0:0:3:0: [sda] 143374738 512-byte logical blocks: (73.4 GB/68.3 GiB)
sunlance.c:v2.02 8/24/03 Miguel de Icaza (miguel&amp;lt; at &amp;gt;nuclecu.unam.mx)
ioremap: done with statics, switching to malloc
sd 0:0:3:0: [sda] Write Protect is off
sd 0:0:3:0: [sda] Mode Sense: b3 00 00 08
eth0: LANCE 08:00:20:7a:65:ef
sd 0:0:3:0: [sda] Write cache: disabled, read cache: enabled, doesn't
support DPO or FUA
sunhme.c:v3.10 August 26, 2008 David S. Miller (davem&amp;lt; at &amp;gt;davemloft.net)
eth1: HAPPY MEAL (SBUS) 10/100baseT Ethernet 08:00:20:7a:65:ef
mousedev: PS/2 mouse device common for all mice
 sda: sda1 sda2 sda3 sda4 sda5 sda6 sda7
rtc-m48t59 rtc-m48t59.0: rtc core: registered m48t08 as rtc0
TCP: cubic registered
NET: Registered protocol family 17
rtc-m48t59 rtc-m48t59.0: setting system clock to 2007-05-09 14:27:28
UTC (1178720848)
sd 0:0:3:0: [sda] Attached SCSI disk
kjournald starting.  Commit interval 5 seconds
EXT3-fs (sda4): mounted filesystem with ordered data mode
VFS: Mounted root (ext3 filesystem) readonly on device 8:4.
Freeing unused kernel memory: 124k freed
udevd (988): /proc/988/oom_adj is deprecated, please use
/proc/988/oom_score_adj instead.
EXT3-fs (sda4): using internal journal
kjournald starting.  Commit interval 5 seconds
EXT3-fs (sda5): using internal journal
EXT3-fs (sda5): mounted filesystem with ordered data mode
kjournald starting.  Commit interval 5 seconds
EXT3-fs (sda6): using internal journal
EXT3-fs (sda6): mounted filesystem with ordered data mode
kjournald starting.  Commit interval 5 seconds
EXT3-fs (sda7): using internal journal
EXT3-fs (sda7): mounted filesystem with ordered data mode
Adding 310364k swap on /dev/sda2.  Priority:-1 extents:1 across:310364k
swap_free: Bad swap file entry d0000dec
BUG: Bad page map in process ntpd  pte:01bd9abc pmd:0003ac01
addr:5039b000 vm_flags:08000070 anon_vma:  (null) mapping:fb816c00 index:9
vma-&amp;gt;vm_ops-&amp;gt;fault: filemap_fault+0x8/0x3d8
vma-&amp;gt;vm_file-&amp;gt;f_op-&amp;gt;mmap: generic_file_mmap+0x8/0x6c
[f007962c : unmap_vmas+0x3c/0x5c ]
[f007ee30 : exit_mmap+0xac/0x15c ]
[f001e8d8 : mmput+0x2c/0xd4 ]
[f0022558 : exit_mm+0xd4/0x118 ]
[f002401c : do_exit+0x500/0x790 ]
[f00244f4 : do_group_exit+0x28/0xb0 ]
[f002e850 : get_signal_to_deliver+0x198/0x4dc ]
[f000ba58 : do_signal+0x44/0x768 ]
[f000c4f4 : do_notify_resume+0x2c/0x3c ]
[f00099bc : signal_p+0x14/0x24 ]
[50282ab8 : 0x50282ab8 ]
Disabling lock debugging due to kernel taint
swap_free: Bad swap file entry e8000dec
BUG: Bad page map in process ntpd  pte:01bd9dbc pmd:0003ac01
addr:5039c000 vm_flags:08000070 anon_vma:  (null) mapping:fb816c00 index:a
vma-&amp;gt;vm_ops-&amp;gt;fault: filemap_fault+0x8/0x3d8
vma-&amp;gt;vm_file-&amp;gt;f_op-&amp;gt;mmap: generic_file_mmap+0x8/0x6c
[f007962c : unmap_vmas+0x3c/0x5c ]
[f007ee30 : exit_mmap+0xac/0x15c ]
[f001e8d8 : mmput+0x2c/0xd4 ]
[f0022558 : exit_mm+0xd4/0x118 ]
[f002401c : do_exit+0x500/0x790 ]
[f00244f4 : do_group_exit+0x28/0xb0 ]
[f002e850 : get_signal_to_deliver+0x198/0x4dc ]
[f000ba58 : do_signal+0x44/0x768 ]
[f000c4f4 : do_notify_resume+0x2c/0x3c ]
[f00099bc : signal_p+0x14/0x24 ]
[50282ab8 : 0x50282ab8 ]
BUG: Bad rss-counter state mm:fbfba480 idx:0 val:2
BUG: Bad rss-counter state mm:fbfba480 idx:2 val:-2
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Marcel van Nies</dc:creator>
    <dc:date>2012-05-24T19:27:31</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16411">
    <title>[PATCH] sparc: Optimize strncpy_from_user() zero byte search.</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16411</link>
    <description>&lt;pre&gt;
Compute a mask that will only have 0x80 in the bytes which
had a zero in them.  The formula is:

~(((x &amp;amp; 0x7f7f7f7f) + 0x7f7f7f7f) | x | 0x7f7f7f7f)

In the inner word iteration, we have to compute the "x | 0x7f7f7f7f"
part, so we can reuse that in the above calculation.

Once we have this mask, we perform divide and conquer to find the
highest 0x80 location.

Signed-off-by: David S. Miller &amp;lt;davem&amp;lt; at &amp;gt;davemloft.net&amp;gt;
---

On linux-arch we're talking about making this code I wrote
for sparc suitable for other platforms to use since it's
reasonably portable already.

As part of that Linus wanted me to make an effort to improve
the code GCC generates for the final zero byte discovery code
and this is what I came up with.

 arch/sparc/lib/usercopy.c |   50 +++++++++++++++++++--------------------------
 1 file changed, 21 insertions(+), 29 deletions(-)

diff --git a/arch/sparc/lib/usercopy.c b/arch/sparc/lib/usercopy.c
index 851cb75..87f9645 100644
--- a/arch/sparc/lib/usercopy.c
+++ b/arch/sparc/lib/usercopy.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -11,35 +11,20 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; EXPORT_SYMBOL(copy_from_user_overflow);
 
 #define REPEAT_BYTE(x)((~0ul / 0xff) * (x))
 
-/* Return the high bit set in the first byte that is a zero */
-static inline unsigned long has_zero(unsigned long a)
-{
-return ((a - REPEAT_BYTE(0x01)) &amp;amp; ~a) &amp;amp; REPEAT_BYTE(0x80);
-}
-
-static inline long find_zero(unsigned long c)
+static inline long find_zero(unsigned long mask)
 {
+long byte = 0;
 #ifdef CONFIG_64BIT
-if (!(c &amp;amp; 0xff00000000000000UL))
-return 0;
-if (!(c &amp;amp; 0x00ff000000000000UL))
-return 1;
-if (!(c &amp;amp; 0x0000ff0000000000UL))
-return 2;
-if (!(c &amp;amp; 0x000000ff00000000UL))
-return 3;
-#define __OFF 4
-#else
-#define __OFF 0
+if (mask &amp;gt;&amp;gt; 32)
+mask &amp;gt;&amp;gt;= 32;
+else
+byte = 4;
 #endif
-if (!(c &amp;amp; 0xff000000))
-return __OFF + 0;
-if (!(c &amp;amp; 0x00ff0000))
-return __OFF + 1;
-if (!(c &amp;amp; 0x0000ff00))
-return __OFF + 2;
-return __OFF + 3;
-#undef __OFF
+if (mask &amp;gt;&amp;gt; 16)
+mask &amp;gt;&amp;gt;= 16;
+else
+byte += 2;
+return (mask &amp;gt;&amp;gt; 8) ? byte : byte + 1;
 }
 
 /*
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -50,6 +35,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static inline long find_zero(unsigned long c)
  */
 static inline long do_strncpy_from_user(char *dst, const char __user *src, long count, unsigned long max)
 {
+const unsigned long high_bits = REPEAT_BYTE(0xfe) + 1;
+const unsigned long low_bits = REPEAT_BYTE(0x7f);
 long res = 0;
 
 /*
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -63,14 +50,19 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static inline long do_strncpy_from_user(char *dst, const char __user *src, long
 goto byte_at_a_time;
 
 while (max &amp;gt;= sizeof(unsigned long)) {
-unsigned long c;
+unsigned long c, v, rhs;
 
 /* Fall back to byte-at-a-time if we get a page fault */
 if (unlikely(__get_user(c,(unsigned long __user *)(src+res))))
 break;
+rhs = c | low_bits;
+v = (c + high_bits) &amp;amp; ~rhs;
 *(unsigned long *)(dst+res) = c;
-if (has_zero(c))
-return res + find_zero(c);
+if (v) {
+v = (c &amp;amp; low_bits) + low_bits;;
+v = ~(v | rhs);
+return res + find_zero(v);
+}
 res += sizeof(unsigned long);
 max -= sizeof(unsigned long);
 }
&lt;/pre&gt;</description>
    <dc:creator>David Miller</dc:creator>
    <dc:date>2012-05-24T02:29:31</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16410">
    <title>Re: [PATCH] sparc: Add full proper error handling tostrncpy_from_user().</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16410</link>
    <description>&lt;pre&gt;
Great - I have removed this from my TODO list.

Sam
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Sam Ravnborg</dc:creator>
    <dc:date>2012-05-23T20:36:54</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16409">
    <title>Re: [RFC PATCH 0/5] first batch of leon adaptions</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16409</link>
    <description>&lt;pre&gt;Great - thanks for testing.

Chances that I screw up in the coming work is higher...

Sam
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Sam Ravnborg</dc:creator>
    <dc:date>2012-05-23T20:10:38</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16408">
    <title>Re: [RFC PATCH 0/5] first batch of leon adaptions</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16408</link>
    <description>&lt;pre&gt;Hi,

I havn't tested this patch series yet, however I can report that the current code commited and applied by linus is booting on LEON.

Thanks,
Daniel

PROMLIB: Sun Boot Prom Version 0 Revision 0
Linux version 3.4.0-04843-g9e14dfd (daniel&amp;lt; at &amp;gt;daniel) (gcc version 4.4.2 (crosstoo2
bootconsole [earlyprom0] enabled
ARCH: LEON
TYPE: Leon3 System-on-a-Chip
Ethernet address: 00:00:7c:cc:01:45
CACHE: 2-way associative cache, set size 4k
OF stdout device is: /a::a
PROM: Built device tree with 16716 bytes of memory.
Booting Linux...
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 29871
Kernel command line: console=ttyS0,38400 init=/sbin/init
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory: 117120k/131048k available (3780k kernel code, 13928k reserved, 1352k da)
NR_IRQS:64
Console: colour dummy device 80x25
console [ttyS0] enabled, bootconsole disabled
console [ttyS0] enabled, bootconsole disabled
Calibrating delay loop... 49.35 BogoMIPS (lpj=246784)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
initlevel:0=early, 4 registered initcalls
initlevel:1=core, 12 registered initcalls
NET: Registered protocol family 16
initlevel:2=postcore, 7 registered initcalls
initlevel:3=arch, 1 registered initcalls
initlevel:4=subsys, 28 registered initcalls
bio: create slab &amp;lt;bio-0&amp;gt; at 0
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
initlevel:5=fs, 18 registered initcalls
Switching to clocksource timer_cs
FS-Cache: Loaded
CacheFiles: Loaded
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
initlevel:6=device, 169 registered initcalls
NFS: Registeringthe id_resolver key type
Key type id_resolver registered
FS-Cache: Netfs 'nfs' registered for caching
ROMFS MTD (C) 2007 Red Hat, Inc.
JFS: nTxBlock = 915, nTxLock = 7320
msgmni has been set to 228
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (default)
Serial: GRLIB APBUART driver
ffd0d754: ttyS0 at MMIO 0x80000100 (irq = 5) is a GRLIB/APBUART
grlib-apbuart at 0x80000100, irq 5
ffd0d4ec: ttyS1 at MMIO 0x80000600 (irq = 2)GRLIB/APBUART
grlib-apbuart at 0x80000600, irq 2
brd: module loaded
loop: module loaded
greth-mdio: probed
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
uhci_hcd: USB Universal Host Controller Interface driver
usbcore: registered new interface driver usblp
Initializing USB Mass Storage driver...
usbcore: registered new interface driver usb-storage
USB Mass Storage support registered.
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver usbserial_generic
USB Serial support registered for generic
usbserial: USB Serial Driver core
usbcore: registered new interface driver belkin_sa
USB Serial support registered for Belkin / Peracom / GoHubs USB Serial Adapter
usbcore: registered new interface driver ftdi_sio
USB Serial support registered for FTDI USB Serial Device
ftdi_sio: v1.6.0:USB FTDI Serial Converters Driver
mousedev: PS/2 mouse device common for all mice
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
TCP: cubic registered
NET: Registered protocol family 10
sit: IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
Key type dns_resolver registered
initlevel:7=late, 15 registered initcalls
leon: power management initialized
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
Freeing unused kernel memory: 5280k freed
Initializing random number generator... done.
Starting network...

Welcome to Buildroot
buildroot login: root
# ls -al
total 12
drwxr-xr-x    2 root     root             0 Jan :00 .
drwxr-xr-x   16 root     root             0 Jun 10  2011 ..
-rw-r--r--    1 root     root             7 Jan  1 00:00 .ash_history
-rw-r--r--    1 root     root             0 Dec  3  2010 .bash_history
-rw-r--r--    1 root     root           175 Dec  3  2010 .bash_logout
-rw-r--r--    1 root     root           161 Dec  3  2010 .bash_profile
# cat /proc/cpuinfo
cpu             : LEON
fpu             : GRFPU
promlib         : Version 0 Revision 0
prom            : 0.0
type            : leon
ncpus probed    : 1
ncpus active    : 1
CPU0Bogo        : 49.35
CPU0ClkTck      : 50000
MMU type        : LEON
contexts        : 256ache total : 2252800
nocache used    : 156672


On 05/22/2012 10:06 PM, Sam Ravnborg wrote:

--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Daniel Hellstrom</dc:creator>
    <dc:date>2012-05-23T14:32:51</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16407">
    <title>Re: Linux on sparc v7</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16407</link>
    <description>&lt;pre&gt;
Note that it will also flush the LEON data cache. Flushing on a LEON is normally done:
  * I-cache, write anywhere using ASI=0x15
  * D-cache, write anywhere using ASI=0x16

Daniel


--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Daniel Hellstrom</dc:creator>
    <dc:date>2012-05-23T12:27:19</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16406">
    <title>[PATCH] sparc: Add full proper error handling to strncpy_from_user().</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16406</link>
    <description>&lt;pre&gt;
Linus removed the end-of-address-space hackery from
fs/namei.c:do_getname() so we really have to validate these edge
conditions and cannot cheat any more (as x86 used to as well).

Move to a common C implementation like x86 did.  And if both
src and dst are sufficiently aligned we'll do word at a time
copies and checks as well.

Signed-off-by: David S. Miller &amp;lt;davem&amp;lt; at &amp;gt;davemloft.net&amp;gt;
---

This addresses:

http://marc.info/?l=linux-arch&amp;amp;m=133761921425977&amp;amp;w=2

 arch/sparc/include/asm/uaccess.h      |    3 +
 arch/sparc/include/asm/uaccess_32.h   |   10 ---
 arch/sparc/include/asm/uaccess_64.h   |    4 -
 arch/sparc/lib/Makefile               |    2 +-
 arch/sparc/lib/ksyms.c                |    3 -
 arch/sparc/lib/strncpy_from_user_32.S |   47 ------------
 arch/sparc/lib/strncpy_from_user_64.S |  133 ---------------------------------
 arch/sparc/lib/usercopy.c             |  132 ++++++++++++++++++++++++++++++++
 8 files changed, 136 insertions(+), 198 deletions(-)
 delete mode 100644 arch/sparc/lib/strncpy_from_user_32.S
 delete mode 100644 arch/sparc/lib/strncpy_from_user_64.S

diff --git a/arch/sparc/include/asm/uaccess.h b/arch/sparc/include/asm/uaccess.h
index e88fbe5..42a28cf 100644
--- a/arch/sparc/include/asm/uaccess.h
+++ b/arch/sparc/include/asm/uaccess.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -5,4 +5,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #else
 #include &amp;lt;asm/uaccess_32.h&amp;gt;
 #endif
+
+extern long strncpy_from_user(char *dest, const char __user *src, long count);
+
 #endif
diff --git a/arch/sparc/include/asm/uaccess_32.h b/arch/sparc/include/asm/uaccess_32.h
index d50c310..59586b5 100644
--- a/arch/sparc/include/asm/uaccess_32.h
+++ b/arch/sparc/include/asm/uaccess_32.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -304,16 +304,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static inline unsigned long clear_user(void __user *addr, unsigned long n)
 return n;
 }
 
-extern long __strncpy_from_user(char *dest, const char __user *src, long count);
-
-static inline long strncpy_from_user(char *dest, const char __user *src, long count)
-{
-if (__access_ok((unsigned long) src, count))
-return __strncpy_from_user(dest, src, count);
-else
-return -EFAULT;
-}
-
 extern long __strlen_user(const char __user *);
 extern long __strnlen_user(const char __user *, long len);
 
diff --git a/arch/sparc/include/asm/uaccess_64.h b/arch/sparc/include/asm/uaccess_64.h
index a1091afb..dcdfb89 100644
--- a/arch/sparc/include/asm/uaccess_64.h
+++ b/arch/sparc/include/asm/uaccess_64.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -257,10 +257,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; extern unsigned long __must_check __clear_user(void __user *, unsigned long);
 
 #define clear_user __clear_user
 
-extern long __must_check __strncpy_from_user(char *dest, const char __user *src, long count);
-
-#define strncpy_from_user __strncpy_from_user
-
 extern long __strlen_user(const char __user *);
 extern long __strnlen_user(const char __user *, long len);
 
diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile
index 389628f..943d98d 100644
--- a/arch/sparc/lib/Makefile
+++ b/arch/sparc/lib/Makefile
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -10,7 +10,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; lib-y                 += strlen.o
 lib-y                 += checksum_$(BITS).o
 lib-$(CONFIG_SPARC32) += blockops.o
 lib-y                 += memscan_$(BITS).o memcmp.o strncmp_$(BITS).o
-lib-y                 += strncpy_from_user_$(BITS).o strlen_user_$(BITS).o
+lib-y                 += strlen_user_$(BITS).o
 lib-$(CONFIG_SPARC32) += divdi3.o udivdi3.o
 lib-$(CONFIG_SPARC32) += copy_user.o locks.o
 lib-$(CONFIG_SPARC64) += atomic_64.o
diff --git a/arch/sparc/lib/ksyms.c b/arch/sparc/lib/ksyms.c
index 2dc3087..6b278ab 100644
--- a/arch/sparc/lib/ksyms.c
+++ b/arch/sparc/lib/ksyms.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -33,9 +33,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; EXPORT_SYMBOL(memset);
 EXPORT_SYMBOL(memmove);
 EXPORT_SYMBOL(__bzero);
 
-/* Moving data to/from/in userspace. */
-EXPORT_SYMBOL(__strncpy_from_user);
-
 /* Networking helper routines. */
 EXPORT_SYMBOL(csum_partial);
 
diff --git a/arch/sparc/lib/strncpy_from_user_32.S b/arch/sparc/lib/strncpy_from_user_32.S
deleted file mode 100644
index db0ed29..0000000
--- a/arch/sparc/lib/strncpy_from_user_32.S
+++ /dev/null
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,47 +0,0 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
-/* strncpy_from_user.S: Sparc strncpy from userspace.
- *
- *  Copyright(C) 1996 David S. Miller
- */
-
-#include &amp;lt;linux/linkage.h&amp;gt;
-#include &amp;lt;asm/ptrace.h&amp;gt;
-#include &amp;lt;asm/errno.h&amp;gt;
-
-.text
-
-/* Must return:
- *
- * -EFAULTfor an exception
- * countif we hit the buffer limit
- * bytes copiedif we hit a null byte
- */
-
-ENTRY(__strncpy_from_user)
-/* %o0=dest, %o1=src, %o2=count */
-mov%o2, %o3
-1:
-subcc%o2, 1, %o2
-bneg2f
- nop
-10:
-ldub[%o1], %o4
-add%o0, 1, %o0
-cmp%o4, 0
-add%o1, 1, %o1
-bne1b
- stb%o4, [%o0 - 1]
-2:
-add%o2, 1, %o0
-retl
- sub%o3, %o0, %o0
-ENDPROC(__strncpy_from_user)
-
-.section .fixup,#alloc,#execinstr
-.align4
-4:
-retl
- mov-EFAULT, %o0
-
-.section __ex_table,#alloc
-.align4
-.word10b, 4b
diff --git a/arch/sparc/lib/strncpy_from_user_64.S b/arch/sparc/lib/strncpy_from_user_64.S
deleted file mode 100644
index d1246b7..0000000
--- a/arch/sparc/lib/strncpy_from_user_64.S
+++ /dev/null
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,133 +0,0 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
-/*
- * strncpy_from_user.S: Sparc64 strncpy from userspace.
- *
- *  Copyright (C) 1997, 1999 Jakub Jelinek (jj&amp;lt; at &amp;gt;ultra.linux.cz)
- */
-
-#include &amp;lt;linux/linkage.h&amp;gt;
-#include &amp;lt;asm/asi.h&amp;gt;
-#include &amp;lt;asm/errno.h&amp;gt;
-
-.data
-.align8
-0:.xword0x0101010101010101
-
-.text
-
-/* Must return:
- *
- * -EFAULTfor an exception
- * countif we hit the buffer limit
- * bytes copiedif we hit a null byte
- * (without the null byte)
- *
- * This implementation assumes:
- * %o1 is 8 aligned =&amp;gt; !(%o2 &amp;amp; 7)
- * %o0 is 8 aligned (if not, it will be slooooow, but will work)
- *
- * This is optimized for the common case:
- * in my stats, 90% of src are 8 aligned (even on sparc32)
- * and average length is 18 or so.
- */
-
-ENTRY(__strncpy_from_user)
-/* %o0=dest, %o1=src, %o2=count */
-andcc%o1, 7, %g0! IEU1Group
-bne,pn%icc, 30f! CTI
- add%o0, %o2, %g3! IEU0
-60:ldxa[%o1] %asi, %g1! LoadGroup
-brlez,pn %o2, 10f! CTI
- mov%o0, %o3! IEU0
-50:sethi%hi(0b), %o4! IEU0Group
-ldx[%o4 + %lo(0b)], %o4! Load
-sllx%o4, 7, %o5! IEU1Group
-1:sub%g1, %o4, %g2! IEU0Group
-stx%g1, [%o0]! Store
-add%o0, 8, %o0! IEU1
-andcc%g2, %o5, %g0! IEU1Group
-bne,pn%xcc, 5f! CTI
- add%o1, 8, %o1! IEU0
-cmp%o0, %g3! IEU1Group
-bl,a,pt %xcc, 1b! CTI
-61: ldxa[%o1] %asi, %g1! Load
-10:retl! CTIGroup
- mov%o2, %o0! IEU0
-5:srlx%g2, 32, %g7! IEU0Group
-sethi%hi(0xff00), %o4! IEU1
-andcc%g7, %o5, %g0! IEU1Group
-be,pn%icc, 2f! CTI
- or%o4, %lo(0xff00), %o4! IEU0
-srlx%g1, 48, %g7! IEU0Group
-andcc%g7, %o4, %g0! IEU1Group
-be,pn%icc, 50f! CTI
- andcc%g7, 0xff, %g0! IEU1Group
-be,pn%icc, 51f! CTI
- srlx%g1, 32, %g7! IEU0
-andcc%g7, %o4, %g0! IEU1Group
-be,pn%icc, 52f! CTI
- andcc%g7, 0xff, %g0! IEU1Group
-be,pn%icc, 53f! CTI
-2: andcc%g2, %o5, %g0! IEU1Group
-be,pn%icc, 2f! CTI
- srl%g1, 16, %g7! IEU0
-andcc%g7, %o4, %g0! IEU1Group
-be,pn%icc, 54f! CTI
- andcc%g7, 0xff, %g0! IEU1Group
-be,pn%icc, 55f! CTI
- andcc%g1, %o4, %g0! IEU1Group
-be,pn%icc, 56f! CTI
- andcc%g1, 0xff, %g0! IEU1Group
-be,a,pn%icc, 57f! CTI
- sub%o0, %o3, %o0! IEU0
-2:cmp%o0, %g3! IEU1Group
-bl,a,pt%xcc, 50b! CTI
-62: ldxa[%o1] %asi, %g1! Load
-retl! CTIGroup
- mov%o2, %o0! IEU0
-50:sub%o0, %o3, %o0
-retl
- sub%o0, 8, %o0
-51:sub%o0, %o3, %o0
-retl
- sub%o0, 7, %o0
-52:sub%o0, %o3, %o0
-retl
- sub%o0, 6, %o0
-53:sub%o0, %o3, %o0
-retl
- sub%o0, 5, %o0
-54:sub%o0, %o3, %o0
-retl
- sub%o0, 4, %o0
-55:sub%o0, %o3, %o0
-retl
- sub%o0, 3, %o0
-56:sub%o0, %o3, %o0
-retl
- sub%o0, 2, %o0
-57:retl
- sub%o0, 1, %o0
-30:brlez,pn %o2, 3f
- sub%g0, %o2, %o3
-add%o0, %o2, %o0
-63:lduba[%o1] %asi, %o4
-1:add%o1, 1, %o1
-brz,pn%o4, 2f
- stb%o4, [%o0 + %o3]
-addcc%o3, 1, %o3
-bne,pt%xcc, 1b
-64: lduba[%o1] %asi, %o4
-3:retl
- mov%o2, %o0
-2:retl
- add%o2, %o3, %o0
-ENDPROC(__strncpy_from_user)
-
-.section __ex_table,"a"
-.align4
-.word60b, __retl_efault
-.word61b, __retl_efault
-.word62b, __retl_efault
-.word63b, __retl_efault
-.word64b, __retl_efault
-.previous
diff --git a/arch/sparc/lib/usercopy.c b/arch/sparc/lib/usercopy.c
index 14b363f..851cb75 100644
--- a/arch/sparc/lib/usercopy.c
+++ b/arch/sparc/lib/usercopy.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1,4 +1,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include &amp;lt;linux/module.h&amp;gt;
+#include &amp;lt;linux/uaccess.h&amp;gt;
+#include &amp;lt;linux/errno.h&amp;gt;
 #include &amp;lt;linux/bug.h&amp;gt;
 
 void copy_from_user_overflow(void)
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -6,3 +8,133 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; void copy_from_user_overflow(void)
 WARN(1, "Buffer overflow detected!\n");
 }
 EXPORT_SYMBOL(copy_from_user_overflow);
+
+#define REPEAT_BYTE(x)((~0ul / 0xff) * (x))
+
+/* Return the high bit set in the first byte that is a zero */
+static inline unsigned long has_zero(unsigned long a)
+{
+return ((a - REPEAT_BYTE(0x01)) &amp;amp; ~a) &amp;amp; REPEAT_BYTE(0x80);
+}
+
+static inline long find_zero(unsigned long c)
+{
+#ifdef CONFIG_64BIT
+if (!(c &amp;amp; 0xff00000000000000UL))
+return 0;
+if (!(c &amp;amp; 0x00ff000000000000UL))
+return 1;
+if (!(c &amp;amp; 0x0000ff0000000000UL))
+return 2;
+if (!(c &amp;amp; 0x000000ff00000000UL))
+return 3;
+#define __OFF 4
+#else
+#define __OFF 0
+#endif
+if (!(c &amp;amp; 0xff000000))
+return __OFF + 0;
+if (!(c &amp;amp; 0x00ff0000))
+return __OFF + 1;
+if (!(c &amp;amp; 0x0000ff00))
+return __OFF + 2;
+return __OFF + 3;
+#undef __OFF
+}
+
+/*
+ * Do a strncpy, return length of string without final '\0'.
+ * 'count' is the user-supplied count (return 'count' if we
+ * hit it), 'max' is the address space maximum (and we return
+ * -EFAULT if we hit it).
+ */
+static inline long do_strncpy_from_user(char *dst, const char __user *src, long count, unsigned long max)
+{
+long res = 0;
+
+/*
+ * Truncate 'max' to the user-specified limit, so that
+ * we only have one limit we need to check in the loop
+ */
+if (max &amp;gt; count)
+max = count;
+
+if (((long) dst | (long) src) &amp;amp; (sizeof(long) - 1))
+goto byte_at_a_time;
+
+while (max &amp;gt;= sizeof(unsigned long)) {
+unsigned long c;
+
+/* Fall back to byte-at-a-time if we get a page fault */
+if (unlikely(__get_user(c,(unsigned long __user *)(src+res))))
+break;
+*(unsigned long *)(dst+res) = c;
+if (has_zero(c))
+return res + find_zero(c);
+res += sizeof(unsigned long);
+max -= sizeof(unsigned long);
+}
+
+byte_at_a_time:
+while (max) {
+char c;
+
+if (unlikely(__get_user(c,src+res)))
+return -EFAULT;
+dst[res] = c;
+if (!c)
+return res;
+res++;
+max--;
+}
+
+/*
+ * Uhhuh. We hit 'max'. But was that the user-specified maximum
+ * too? If so, that's ok - we got as much as the user asked for.
+ */
+if (res &amp;gt;= count)
+return res;
+
+/*
+ * Nope: we hit the address space limit, and we still had more
+ * characters the caller would have wanted. That's an EFAULT.
+ */
+return -EFAULT;
+}
+
+/**
+ * strncpy_from_user: - Copy a NUL terminated string from userspace.
+ * &amp;lt; at &amp;gt;dst:   Destination address, in kernel space.  This buffer must be at
+ *         least &amp;lt; at &amp;gt;count bytes long.
+ * &amp;lt; at &amp;gt;src:   Source address, in user space.
+ * &amp;lt; at &amp;gt;count: Maximum number of bytes to copy, including the trailing NUL.
+ *
+ * Copies a NUL-terminated string from userspace to kernel space.
+ *
+ * On success, returns the length of the string (not including the trailing
+ * NUL).
+ *
+ * If access to userspace fails, returns -EFAULT (some data may have been
+ * copied).
+ *
+ * If &amp;lt; at &amp;gt;count is smaller than the length of the string, copies &amp;lt; at &amp;gt;count bytes
+ * and returns &amp;lt; at &amp;gt;count.
+ */
+long strncpy_from_user(char *dst, const char __user *src, long count)
+{
+unsigned long max_addr, src_addr;
+
+if (unlikely(count &amp;lt;= 0))
+return 0;
+
+max_addr = ~0UL;
+if (likely(segment_eq(get_fs(), USER_DS)))
+max_addr = STACK_TOP;
+src_addr = (unsigned long)src;
+if (likely(src_addr &amp;lt; max_addr)) {
+unsigned long max = max_addr - src_addr;
+return do_strncpy_from_user(dst, src, count, max);
+}
+return -EFAULT;
+}
+EXPORT_SYMBOL(strncpy_from_user);
&lt;/pre&gt;</description>
    <dc:creator>David Miller</dc:creator>
    <dc:date>2012-05-23T07:35:50</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16405">
    <title>Re: [PATCH 1/5] sparc32: whitespace cleanup in head_32.S</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16405</link>
    <description>&lt;pre&gt;Hi Sam,

On Wed, May 23, 2012 at 6:10 AM, Sam Ravnborg &amp;lt;sam&amp;lt; at &amp;gt;ravnborg.org&amp;gt; wrote:

We should probably drop the 'c' from this message.

Thanks,

&lt;/pre&gt;</description>
    <dc:creator>Julian Calaby</dc:creator>
    <dc:date>2012-05-22T23:19:06</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16404">
    <title>Re: [PATCH 2/5] sparc32: implement proper LEON support in head_32(before highmem)</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16404</link>
    <description>&lt;pre&gt;
I did not like it either - but this
was a straight copy from the old code with
proper replacement of the MMUREGS.
I actually considered to just drop it.

I will rephrase the text in a separate commit.


Thanks for the quick feedback!

I will address it all and get back.
Will take a couple of days as weather is
too good to do serious coding ;-)

Sam
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Sam Ravnborg</dc:creator>
    <dc:date>2012-05-22T20:31:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16403">
    <title>Re: [PATCH 5/5] sparc32: handle leon in irq_32.c</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16403</link>
    <description>&lt;pre&gt;From: Sam Ravnborg &amp;lt;sam&amp;lt; at &amp;gt;ravnborg.org&amp;gt;
Date: Tue, 22 May 2012 22:10:43 +0200


Also looks fine.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>David Miller</dc:creator>
    <dc:date>2012-05-22T20:24:40</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16402">
    <title>Re: [PATCH 4/5] sparc32: handle leon in cpu.c</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16402</link>
    <description>&lt;pre&gt;From: Sam Ravnborg &amp;lt;sam&amp;lt; at &amp;gt;ravnborg.org&amp;gt;
Date: Tue, 22 May 2012 22:10:42 +0200


Looks ok.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>David Miller</dc:creator>
    <dc:date>2012-05-22T20:24:30</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16401">
    <title>Re: [PATCH 3/5] sparc32: implement proper LEON support in head_32 (after highmem)</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16401</link>
    <description>&lt;pre&gt;From: Sam Ravnborg &amp;lt;sam&amp;lt; at &amp;gt;ravnborg.org&amp;gt;
Date: Tue, 22 May 2012 22:10:41 +0200


Looks ok.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>David Miller</dc:creator>
    <dc:date>2012-05-22T20:23:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.linux.ports.sparc/16400">
    <title>Re: [PATCH 2/5] sparc32: implement proper LEON support in head_32 (before highmem)</title>
    <link>http://permalink.gmane.org/gmane.linux.ports.sparc/16400</link>
    <description>&lt;pre&gt;From: Sam Ravnborg &amp;lt;sam&amp;lt; at &amp;gt;ravnborg.org&amp;gt;
Date: Tue, 22 May 2012 22:10:40 +0200

                          ^^^

"CPU" :-)


I would code this like:

rd%psr, %g3
srl%g3, PSR_IMPL_SHIFT, %g3
and%g3, 0xf /* PST_IMPL_WHATEVER_MASK */, %g3
cmp%g3, PSR_IMPL_LEON



PSR_IMPL_TI is probably a better name fo this macro.


Checking that the MMU is disabled is correct, but branching
to the sun4c-not-supported error message is probably not. :-)

Otherwise looks OK.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo&amp;lt; at &amp;gt;vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>David Miller</dc:creator>
    <dc:date>2012-05-22T20:23:10</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.linux.ports.sparc">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.linux.ports.sparc</link>
  </textinput>
</rdf:RDF>

