All of lore.kernel.org
 help / color / mirror / Atom feed
* S+core architecture (arch/score/) support files
@ 2009-06-23  8:37 liqin.chen
  2009-06-23  9:43 ` Arnd Bergmann
  2009-06-23 14:50 ` Christoph Hellwig
  0 siblings, 2 replies; 21+ messages in thread
From: liqin.chen @ 2009-06-23  8:37 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Arnd Bergmann, linux-kernel, linux-arch

Hi Linus,

This repository contains Linux support for S+core CPU.

Please pull
git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git score

Changes in v3:
Sending pull request again.

Changes in v2:
Christoph Hellwig and Arnd review it.

Thanks,
Liqin

---

 MAINTAINERS                                |    8 +
 arch/score/Kconfig                         |  141 ++++++
 arch/score/Kconfig.debug                   |   37 ++
 arch/score/Makefile                        |   43 ++
 arch/score/boot/Makefile                   |   15 +
 arch/score/configs/spct6600_defconfig      |  717 
++++++++++++++++++++++++++++
 arch/score/include/asm/Kbuild              |    3 +
 arch/score/include/asm/asmmacro.h          |  161 +++++++
 arch/score/include/asm/atomic.h            |    6 +
 arch/score/include/asm/auxvec.h            |    4 +
 arch/score/include/asm/bitops.h            |   16 +
 arch/score/include/asm/bitsperlong.h       |    6 +
 arch/score/include/asm/bug.h               |    6 +
 arch/score/include/asm/bugs.h              |    6 +
 arch/score/include/asm/byteorder.h         |    6 +
 arch/score/include/asm/cache.h             |    7 +
 arch/score/include/asm/cacheflush.h        |   45 ++
 arch/score/include/asm/checksum.h          |  235 +++++++++
 arch/score/include/asm/cputime.h           |    6 +
 arch/score/include/asm/current.h           |    6 +
 arch/score/include/asm/delay.h             |   26 +
 arch/score/include/asm/device.h            |    6 +
 arch/score/include/asm/div64.h             |    6 +
 arch/score/include/asm/dma-mapping.h       |    6 +
 arch/score/include/asm/dma.h               |    8 +
 arch/score/include/asm/elf.h               |   99 ++++
 arch/score/include/asm/emergency-restart.h |    6 +
 arch/score/include/asm/errno.h             |    6 +
 arch/score/include/asm/fcntl.h             |    6 +
 arch/score/include/asm/fixmap.h            |   82 ++++
 arch/score/include/asm/ftrace.h            |    4 +
 arch/score/include/asm/futex.h             |    6 +
 arch/score/include/asm/hardirq.h           |    6 +
 arch/score/include/asm/hw_irq.h            |    4 +
 arch/score/include/asm/io.h                |    9 +
 arch/score/include/asm/ioctl.h             |    6 +
 arch/score/include/asm/ioctls.h            |    6 +
 arch/score/include/asm/ipcbuf.h            |    6 +
 arch/score/include/asm/irq.h               |   33 ++
 arch/score/include/asm/irq_regs.h          |    6 +
 arch/score/include/asm/irqflags.h          |  111 +++++
 arch/score/include/asm/kdebug.h            |    6 +
 arch/score/include/asm/kmap_types.h        |    6 +
 arch/score/include/asm/linkage.h           |    4 +
 arch/score/include/asm/local.h             |    6 +
 arch/score/include/asm/mman.h              |    6 +
 arch/score/include/asm/mmu.h               |    6 +
 arch/score/include/asm/mmu_context.h       |  113 +++++
 arch/score/include/asm/module.h            |   39 ++
 arch/score/include/asm/msgbuf.h            |    6 +
 arch/score/include/asm/mutex.h             |    6 +
 arch/score/include/asm/page.h              |   92 ++++
 arch/score/include/asm/param.h             |    6 +
 arch/score/include/asm/pci.h               |    4 +
 arch/score/include/asm/percpu.h            |    6 +
 arch/score/include/asm/pgalloc.h           |   83 ++++
 arch/score/include/asm/pgtable-bits.h      |   25 +
 arch/score/include/asm/pgtable.h           |  276 +++++++++++
 arch/score/include/asm/poll.h              |    6 +
 arch/score/include/asm/posix_types.h       |    6 +
 arch/score/include/asm/processor.h         |  106 ++++
 arch/score/include/asm/ptrace.h            |   95 ++++
 arch/score/include/asm/resource.h          |    6 +
 arch/score/include/asm/scatterlist.h       |    6 +
 arch/score/include/asm/scoreregs.h         |   51 ++
 arch/score/include/asm/sections.h          |    6 +
 arch/score/include/asm/segment.h           |   21 +
 arch/score/include/asm/sembuf.h            |    6 +
 arch/score/include/asm/setup.h             |   40 ++
 arch/score/include/asm/shmbuf.h            |    6 +
 arch/score/include/asm/shmparam.h          |    6 +
 arch/score/include/asm/sigcontext.h        |   22 +
 arch/score/include/asm/siginfo.h           |    6 +
 arch/score/include/asm/signal.h            |    6 +
 arch/score/include/asm/socket.h            |    6 +
 arch/score/include/asm/sockios.h           |    6 +
 arch/score/include/asm/stat.h              |    6 +
 arch/score/include/asm/statfs.h            |    6 +
 arch/score/include/asm/string.h            |    8 +
 arch/score/include/asm/swab.h              |    6 +
 arch/score/include/asm/syscalls.h          |   11 +
 arch/score/include/asm/system.h            |   90 ++++
 arch/score/include/asm/termbits.h          |    6 +
 arch/score/include/asm/termios.h           |    6 +
 arch/score/include/asm/thread_info.h       |  103 ++++
 arch/score/include/asm/timex.h             |    8 +
 arch/score/include/asm/tlb.h               |   17 +
 arch/score/include/asm/tlbflush.h          |  142 ++++++
 arch/score/include/asm/topology.h          |    6 +
 arch/score/include/asm/types.h             |    6 +
 arch/score/include/asm/uaccess.h           |   27 +
 arch/score/include/asm/unaligned.h         |    6 +
 arch/score/include/asm/unistd.h            |    8 +
 arch/score/include/asm/user.h              |    4 +
 arch/score/kernel/Makefile                 |   11 +
 arch/score/kernel/asm-offsets.c            |  216 +++++++++
 arch/score/kernel/entry.S                  |  501 +++++++++++++++++++
 arch/score/kernel/head.S                   |   70 +++
 arch/score/kernel/init_task.c              |   47 ++
 arch/score/kernel/irq.c                    |  135 ++++++
 arch/score/kernel/module.c                 |  164 +++++++
 arch/score/kernel/process.c                |  165 +++++++
 arch/score/kernel/ptrace.c                 |  399 ++++++++++++++++
 arch/score/kernel/setup.c                  |  157 ++++++
 arch/score/kernel/signal.c                 |  355 ++++++++++++++
 arch/score/kernel/sys_call_table.c         |   12 +
 arch/score/kernel/sys_score.c              |  139 ++++++
 arch/score/kernel/time.c                   |   99 ++++
 arch/score/kernel/traps.c                  |  349 ++++++++++++++
 arch/score/kernel/vmlinux.lds              |  276 +++++++++++
 arch/score/kernel/vmlinux.lds.S            |  148 ++++++
 arch/score/lib/Makefile                    |    8 +
 arch/score/lib/ashldi3.c                   |   46 ++
 arch/score/lib/ashrdi3.c                   |   48 ++
 arch/score/lib/checksum.S                  |  255 ++++++++++
 arch/score/lib/checksum_copy.c             |   52 ++
 arch/score/lib/cmpdi2.c                    |   44 ++
 arch/score/lib/libgcc.h                    |   37 ++
 arch/score/lib/lshrdi3.c                   |   47 ++
 arch/score/lib/string.S                    |  184 +++++++
 arch/score/lib/ucmpdi2.c                   |   38 ++
 arch/score/mm/Makefile                     |    6 +
 arch/score/mm/cache.c                      |  257 ++++++++++
 arch/score/mm/extable.c                    |   38 ++
 arch/score/mm/fault.c                      |  235 +++++++++
 arch/score/mm/init.c                       |  173 +++++++
 arch/score/mm/pgtable.c                    |   60 +++
 arch/score/mm/tlb-miss.S                   |  199 ++++++++
 arch/score/mm/tlb-score.c                  |  251 ++++++++++
 129 files changed, 8706 insertions(+), 0 deletions(-)
 create mode 100644 arch/score/Kconfig
 create mode 100644 arch/score/Kconfig.debug
 create mode 100644 arch/score/Makefile
 create mode 100644 arch/score/boot/Makefile
 create mode 100644 arch/score/configs/spct6600_defconfig
 create mode 100644 arch/score/include/asm/Kbuild
 create mode 100644 arch/score/include/asm/asmmacro.h
 create mode 100644 arch/score/include/asm/atomic.h
 create mode 100644 arch/score/include/asm/auxvec.h
 create mode 100644 arch/score/include/asm/bitops.h
 create mode 100644 arch/score/include/asm/bitsperlong.h
 create mode 100644 arch/score/include/asm/bug.h
 create mode 100644 arch/score/include/asm/bugs.h
 create mode 100644 arch/score/include/asm/byteorder.h
 create mode 100644 arch/score/include/asm/cache.h
 create mode 100644 arch/score/include/asm/cacheflush.h
 create mode 100644 arch/score/include/asm/checksum.h
 create mode 100644 arch/score/include/asm/cputime.h
 create mode 100644 arch/score/include/asm/current.h
 create mode 100644 arch/score/include/asm/delay.h
 create mode 100644 arch/score/include/asm/device.h
 create mode 100644 arch/score/include/asm/div64.h
 create mode 100644 arch/score/include/asm/dma-mapping.h
 create mode 100644 arch/score/include/asm/dma.h
 create mode 100644 arch/score/include/asm/elf.h
 create mode 100644 arch/score/include/asm/emergency-restart.h
 create mode 100644 arch/score/include/asm/errno.h
 create mode 100644 arch/score/include/asm/fcntl.h
 create mode 100644 arch/score/include/asm/fixmap.h
 create mode 100644 arch/score/include/asm/ftrace.h
 create mode 100644 arch/score/include/asm/futex.h
 create mode 100644 arch/score/include/asm/hardirq.h
 create mode 100644 arch/score/include/asm/hw_irq.h
 create mode 100644 arch/score/include/asm/io.h
 create mode 100644 arch/score/include/asm/ioctl.h
 create mode 100644 arch/score/include/asm/ioctls.h
 create mode 100644 arch/score/include/asm/ipcbuf.h
 create mode 100644 arch/score/include/asm/irq.h
 create mode 100644 arch/score/include/asm/irq_regs.h
 create mode 100644 arch/score/include/asm/irqflags.h
 create mode 100644 arch/score/include/asm/kdebug.h
 create mode 100644 arch/score/include/asm/kmap_types.h
 create mode 100644 arch/score/include/asm/linkage.h
 create mode 100644 arch/score/include/asm/local.h
 create mode 100644 arch/score/include/asm/mman.h
 create mode 100644 arch/score/include/asm/mmu.h
 create mode 100644 arch/score/include/asm/mmu_context.h
 create mode 100644 arch/score/include/asm/module.h
 create mode 100644 arch/score/include/asm/msgbuf.h
 create mode 100644 arch/score/include/asm/mutex.h
 create mode 100644 arch/score/include/asm/page.h
 create mode 100644 arch/score/include/asm/param.h
 create mode 100644 arch/score/include/asm/pci.h
 create mode 100644 arch/score/include/asm/percpu.h
 create mode 100644 arch/score/include/asm/pgalloc.h
 create mode 100644 arch/score/include/asm/pgtable-bits.h
 create mode 100644 arch/score/include/asm/pgtable.h
 create mode 100644 arch/score/include/asm/poll.h
 create mode 100644 arch/score/include/asm/posix_types.h
 create mode 100644 arch/score/include/asm/processor.h
 create mode 100644 arch/score/include/asm/ptrace.h
 create mode 100644 arch/score/include/asm/resource.h
 create mode 100644 arch/score/include/asm/scatterlist.h
 create mode 100644 arch/score/include/asm/scoreregs.h
 create mode 100644 arch/score/include/asm/sections.h
 create mode 100644 arch/score/include/asm/segment.h
 create mode 100644 arch/score/include/asm/sembuf.h
 create mode 100644 arch/score/include/asm/setup.h
 create mode 100644 arch/score/include/asm/shmbuf.h
 create mode 100644 arch/score/include/asm/shmparam.h
 create mode 100644 arch/score/include/asm/sigcontext.h
 create mode 100644 arch/score/include/asm/siginfo.h
 create mode 100644 arch/score/include/asm/signal.h
 create mode 100644 arch/score/include/asm/socket.h
 create mode 100644 arch/score/include/asm/sockios.h
 create mode 100644 arch/score/include/asm/stat.h
 create mode 100644 arch/score/include/asm/statfs.h
 create mode 100644 arch/score/include/asm/string.h
 create mode 100644 arch/score/include/asm/swab.h
 create mode 100644 arch/score/include/asm/syscalls.h
 create mode 100644 arch/score/include/asm/system.h
 create mode 100644 arch/score/include/asm/termbits.h
 create mode 100644 arch/score/include/asm/termios.h
 create mode 100644 arch/score/include/asm/thread_info.h
 create mode 100644 arch/score/include/asm/timex.h
 create mode 100644 arch/score/include/asm/tlb.h
 create mode 100644 arch/score/include/asm/tlbflush.h
 create mode 100644 arch/score/include/asm/topology.h
 create mode 100644 arch/score/include/asm/types.h
 create mode 100644 arch/score/include/asm/uaccess.h
 create mode 100644 arch/score/include/asm/unaligned.h
 create mode 100644 arch/score/include/asm/unistd.h
 create mode 100644 arch/score/include/asm/user.h
 create mode 100644 arch/score/kernel/Makefile
 create mode 100644 arch/score/kernel/asm-offsets.c
 create mode 100644 arch/score/kernel/entry.S
 create mode 100644 arch/score/kernel/head.S
 create mode 100644 arch/score/kernel/init_task.c
 create mode 100644 arch/score/kernel/irq.c
 create mode 100644 arch/score/kernel/module.c
 create mode 100644 arch/score/kernel/process.c
 create mode 100644 arch/score/kernel/ptrace.c
 create mode 100644 arch/score/kernel/setup.c
 create mode 100644 arch/score/kernel/signal.c
 create mode 100644 arch/score/kernel/sys_call_table.c
 create mode 100644 arch/score/kernel/sys_score.c
 create mode 100644 arch/score/kernel/time.c
 create mode 100644 arch/score/kernel/traps.c
 create mode 100644 arch/score/kernel/vmlinux.lds
 create mode 100644 arch/score/kernel/vmlinux.lds.S
 create mode 100644 arch/score/lib/Makefile
 create mode 100644 arch/score/lib/ashldi3.c
 create mode 100644 arch/score/lib/ashrdi3.c
 create mode 100644 arch/score/lib/checksum.S
 create mode 100644 arch/score/lib/checksum_copy.c
 create mode 100644 arch/score/lib/cmpdi2.c
 create mode 100644 arch/score/lib/libgcc.h
 create mode 100644 arch/score/lib/lshrdi3.c
 create mode 100644 arch/score/lib/string.S
 create mode 100644 arch/score/lib/ucmpdi2.c
 create mode 100644 arch/score/mm/Makefile
 create mode 100644 arch/score/mm/cache.c
 create mode 100644 arch/score/mm/extable.c
 create mode 100644 arch/score/mm/fault.c
 create mode 100644 arch/score/mm/init.c
 create mode 100644 arch/score/mm/pgtable.c
 create mode 100644 arch/score/mm/tlb-miss.S
 create mode 100644 arch/score/mm/tlb-score.c


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: S+core architecture (arch/score/) support files
  2009-06-23  8:37 S+core architecture (arch/score/) support files liqin.chen
@ 2009-06-23  9:43 ` Arnd Bergmann
  2009-06-23 10:51     ` liqin.chen
  2009-06-23 12:06   ` Andi Kleen
  2009-06-23 14:50 ` Christoph Hellwig
  1 sibling, 2 replies; 21+ messages in thread
From: Arnd Bergmann @ 2009-06-23  9:43 UTC (permalink / raw)
  To: liqin.chen; +Cc: Linus Torvalds, linux-kernel, linux-arch

On Tuesday 23 June 2009, liqin.chen@sunplusct.com wrote:
> Hi Linus,
> 
> This repository contains Linux support for S+core CPU.
> 
> Please pull
> git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git score

I've helped Liquin getting this into a state for inclusion,
so I'll share my observations about the submission.

The code looks very clean for a new architecture support, with the
exception of a few misformatted comments and similar minor issues.
By using the asm-generic headers that are now in 2.6.31, the amount
of copy-paste programming was reduced to a minimum, the total amount
of code added is much less than any other architecture (200kb score,
290kb h8300, 570kb microblaze are the smallest ones).
Fixes for any issues noted during review usually came in quickly.

S+core is now the first architecture to use the ABI defined in
asm-generic, which means it can serve as an example for other
architectures that want to merge their code in the future.

Unfortunately, I don't think that the score glibc has been fully
ported to support this, so it also means that the version that is
being submitted has undergone any run-time testing. I did check
that it compiles fine but could not do more in lack of hardware
or even just a user space distro.

Another small negative is that Liquin is still unexperienced with
the procedures we use in Linux. I've helped out by providing
my git tree, but am not planning to do that beyond 2.6.31.
Given that he has also been upstream gcc maintainer for S+core
for well over 2 years, I believe merging it now will work out well.

	Arnd <><

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: S+core architecture (arch/score/) support files
  2009-06-23  9:43 ` Arnd Bergmann
@ 2009-06-23 10:51     ` liqin.chen
  2009-06-23 12:06   ` Andi Kleen
  1 sibling, 0 replies; 21+ messages in thread
From: liqin.chen @ 2009-06-23 10:51 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-arch, linux-kernel, Linus Torvalds

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="GB2312", Size: 2296 bytes --]

Arnd Bergmann <arnd@arndb.de> дÓÚ 2009-06-23 17:43:22:

> On Tuesday 23 June 2009, liqin.chen@sunplusct.com wrote:
> > Hi Linus,
> > 
> > This repository contains Linux support for S+core CPU.
> > 
> > Please pull
> > git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git 
score
> 
> I've helped Liquin getting this into a state for inclusion,
> so I'll share my observations about the submission.
> 
> The code looks very clean for a new architecture support, with the
> exception of a few misformatted comments and similar minor issues.
> By using the asm-generic headers that are now in 2.6.31, the amount
> of copy-paste programming was reduced to a minimum, the total amount
> of code added is much less than any other architecture (200kb score,
> 290kb h8300, 570kb microblaze are the smallest ones).
> Fixes for any issues noted during review usually came in quickly.
> 
> S+core is now the first architecture to use the ABI defined in
> asm-generic, which means it can serve as an example for other
> architectures that want to merge their code in the future.
> 
> Unfortunately, I don't think that the score glibc has been fully
> ported to support this, so it also means that the version that is
> being submitted has undergone any run-time testing. I did check
> that it compiles fine but could not do more in lack of hardware
> or even just a user space distro.
> 
> Another small negative is that Liquin is still unexperienced with
> the procedures we use in Linux. I've helped out by providing
> my git tree, but am not planning to do that beyond 2.6.31.
> Given that he has also been upstream gcc maintainer for S+core
> for well over 2 years, I believe merging it now will work out well.
> 

Thanks Arnd.
With the help of Arnd, linux/score code become more and more clear.

Before we commit the code to linux.org, 
Linux had run on spct6600 score platform well. 
It had passed LTP test and could run many general applications.
S+core application depend on glibc-2.3.6, which support static
and dynamic applications.

We will upgrade glibc to catch up with the linux/score updating.

Best Regards
Liqin
---
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: S+core architecture (arch/score/) support files
@ 2009-06-23 10:51     ` liqin.chen
  0 siblings, 0 replies; 21+ messages in thread
From: liqin.chen @ 2009-06-23 10:51 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux-arch, linux-kernel, Linus Torvalds

Arnd Bergmann <arnd@arndb.de> 写于 2009-06-23 17:43:22:

> On Tuesday 23 June 2009, liqin.chen@sunplusct.com wrote:
> > Hi Linus,
> > 
> > This repository contains Linux support for S+core CPU.
> > 
> > Please pull
> > git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git 
score
> 
> I've helped Liquin getting this into a state for inclusion,
> so I'll share my observations about the submission.
> 
> The code looks very clean for a new architecture support, with the
> exception of a few misformatted comments and similar minor issues.
> By using the asm-generic headers that are now in 2.6.31, the amount
> of copy-paste programming was reduced to a minimum, the total amount
> of code added is much less than any other architecture (200kb score,
> 290kb h8300, 570kb microblaze are the smallest ones).
> Fixes for any issues noted during review usually came in quickly.
> 
> S+core is now the first architecture to use the ABI defined in
> asm-generic, which means it can serve as an example for other
> architectures that want to merge their code in the future.
> 
> Unfortunately, I don't think that the score glibc has been fully
> ported to support this, so it also means that the version that is
> being submitted has undergone any run-time testing. I did check
> that it compiles fine but could not do more in lack of hardware
> or even just a user space distro.
> 
> Another small negative is that Liquin is still unexperienced with
> the procedures we use in Linux. I've helped out by providing
> my git tree, but am not planning to do that beyond 2.6.31.
> Given that he has also been upstream gcc maintainer for S+core
> for well over 2 years, I believe merging it now will work out well.
> 

Thanks Arnd.
With the help of Arnd, linux/score code become more and more clear.

Before we commit the code to linux.org, 
Linux had run on spct6600 score platform well. 
It had passed LTP test and could run many general applications.
S+core application depend on glibc-2.3.6, which support static
and dynamic applications.

We will upgrade glibc to catch up with the linux/score updating.

Best Regards
Liqin
---

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: S+core architecture (arch/score/) support files
  2009-06-23  9:43 ` Arnd Bergmann
  2009-06-23 10:51     ` liqin.chen
@ 2009-06-23 12:06   ` Andi Kleen
  2009-06-23 13:55     ` Arnd Bergmann
  2009-06-24  3:22       ` liqin.chen
  1 sibling, 2 replies; 21+ messages in thread
From: Andi Kleen @ 2009-06-23 12:06 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: liqin.chen, Linus Torvalds, linux-kernel, linux-arch

Arnd Bergmann <arnd@arndb.de> writes:
>
> Unfortunately, I don't think that the score glibc has been fully
> ported to support this, so it also means that the version that is
> being submitted has undergone any run-time testing. I did check
> that it compiles fine but could not do more in lack of hardware
> or even just a user space distro.

IMHO a full successfull LTP run should be minimal criterium for
merging an architecture. That should catch most of the possible
"simple" mistakes in the syscall ABI. I would suggest to wait to after
this has been done.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: S+core architecture (arch/score/) support files
  2009-06-23 12:06   ` Andi Kleen
@ 2009-06-23 13:55     ` Arnd Bergmann
  2009-06-23 14:30       ` Andi Kleen
  2009-06-24  3:22       ` liqin.chen
  1 sibling, 1 reply; 21+ messages in thread
From: Arnd Bergmann @ 2009-06-23 13:55 UTC (permalink / raw)
  To: Andi Kleen; +Cc: liqin.chen, Linus Torvalds, linux-kernel, linux-arch

On Tuesday 23 June 2009, Andi Kleen wrote:
> IMHO a full successfull LTP run should be minimal criterium for
> merging an architecture. That should catch most of the possible
> "simple" mistakes in the syscall ABI. I would suggest to wait to after
> this has been done.

I agree in general, but in this case the ABI is essentially defined
through the asm-generic headers, with the exception of the functions
that actually were tested before the change (sys_clone, sys_execve,
sys_rt_sigreturn and sys_sig).

We should certainly fix the asm-generic versions if there are some
unexpected problems found by LTP, but delaying the score merge
won't help that, because the interesting code is already there.

While I understand the argument against merging untested code
(that's why I mentioned it in the first place), I think in
this case it's not about the ABI and the code is obviously
self-contained enough to cause no harm to others.

	Arnd <><

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: S+core architecture (arch/score/) support files
  2009-06-23 13:55     ` Arnd Bergmann
@ 2009-06-23 14:30       ` Andi Kleen
  0 siblings, 0 replies; 21+ messages in thread
From: Andi Kleen @ 2009-06-23 14:30 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andi Kleen, liqin.chen, Linus Torvalds, linux-kernel, linux-arch

On Tue, Jun 23, 2009 at 03:55:54PM +0200, Arnd Bergmann wrote:
> On Tuesday 23 June 2009, Andi Kleen wrote:
> > IMHO a full successfull LTP run should be minimal criterium for
> > merging an architecture. That should catch most of the possible
> > "simple" mistakes in the syscall ABI. I would suggest to wait to after
> > this has been done.
> 
> I agree in general, but in this case the ABI is essentially defined
> through the asm-generic headers, with the exception of the functions

What I meant LTP would test if what you implemented works. Not that
you implement a particular ABI, just that the source level interface
works.

It's not a full test of course, but it's a reasonable sanity check over a wide
range of interfaces. When I was working on my architecture I found
it very helpful.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: S+core architecture (arch/score/) support files
  2009-06-23  8:37 S+core architecture (arch/score/) support files liqin.chen
  2009-06-23  9:43 ` Arnd Bergmann
@ 2009-06-23 14:50 ` Christoph Hellwig
  2009-07-08 10:53   ` [PATCH] score: add regsets support for score liqin.chen
  1 sibling, 1 reply; 21+ messages in thread
From: Christoph Hellwig @ 2009-06-23 14:50 UTC (permalink / raw)
  To: liqin.chen; +Cc: Linus Torvalds, Arnd Bergmann, linux-kernel, linux-arch

On Tue, Jun 23, 2009 at 04:37:07PM +0800, liqin.chen@sunplusct.com wrote:
> Hi Linus,
> 
> This repository contains Linux support for S+core CPU.
> 
> Please pull
> git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git score
> 
> Changes in v3:
> Sending pull request again.
> 
> Changes in v2:
> Christoph Hellwig and Arnd review it.

Still doesn't seem to be quite uptodate in the ptrace area, e.g. not
using regsets at all.  It would be really helpful if the final ptrace
code could be ran past Roland McGrath as the ptrace maintainer.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: S+core architecture (arch/score/) support files
  2009-06-23 12:06   ` Andi Kleen
@ 2009-06-24  3:22       ` liqin.chen
  2009-06-24  3:22       ` liqin.chen
  1 sibling, 0 replies; 21+ messages in thread
From: liqin.chen @ 2009-06-24  3:22 UTC (permalink / raw)
  To: Andi Kleen, Christoph Hellwig
  Cc: Arnd Bergmann, linux-arch, linux-kernel, Linus Torvalds

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="GB2312", Size: 2303 bytes --]

Andi Kleen <andi@firstfloor.org> дÓÚ 2009-06-23 20:06:00:

> IMHO a full successfull LTP run should be minimal criterium for
> merging an architecture. That should catch most of the possible
> "simple" mistakes in the syscall ABI. I would suggest to wait to after
> this has been done.

Oh, Andi, it isn't a short time work. especially we use 
asm-generic/unistd.h instead of score old asm/unistd.h.
You see, the most work was focus on glibc/applications.

linux-arch-owner@vger.kernel.org дÓÚ 2009-06-23 18:51:47:

> Before we commit the code to linux.org, 
> Linux had run on spct6600 score platform well. 
> It had passed LTP test and could run many general applications.
> S+core application depend on glibc-2.3.6, which support static
> and dynamic applications.

void merge_score_to_upstream(void)
{
        if (asm-generic is the right direction for all linux arch) {
                if (merge score code) {
                        It's easy for us to update score code and
                                commit the asm-generic problems we meet.
                } else {
                        People will pay no attation to score/asm-generic
                                problems.
                        printk("it haven't help asm-generic to stable.");
                }
        else {
                we could use score old asm/unistd.h instead.
        }
}

I think merge score to upstream will be no harm to linux kernel.

Christoph Hellwig <hch@infradead.org> дÓÚ 2009-06-23 22:50:59:

> Still doesn't seem to be quite uptodate in the ptrace area, e.g. not
> using regsets at all.  It would be really helpful if the final ptrace
> code could be ran past Roland McGrath as the ptrace maintainer.

As a new comer, we don't know what we should or shouldn't do,
Since we begin to commit linux/score code to linux.org, we found
the best way is as simple as possible, because in linux world
people also have the different suggestions, it will make us 
confused and don't know what todo next soon.

The simple code has little error. We think it isn't the right
time to add utrace code so we don't do it.

Best Regards
Liqin
---
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: S+core architecture (arch/score/) support files
@ 2009-06-24  3:22       ` liqin.chen
  0 siblings, 0 replies; 21+ messages in thread
From: liqin.chen @ 2009-06-24  3:22 UTC (permalink / raw)
  To: Andi Kleen, Christoph Hellwig
  Cc: Arnd Bergmann, linux-arch, linux-kernel, Linus Torvalds

Andi Kleen <andi@firstfloor.org> 写于 2009-06-23 20:06:00:

> IMHO a full successfull LTP run should be minimal criterium for
> merging an architecture. That should catch most of the possible
> "simple" mistakes in the syscall ABI. I would suggest to wait to after
> this has been done.

Oh, Andi, it isn't a short time work. especially we use 
asm-generic/unistd.h instead of score old asm/unistd.h.
You see, the most work was focus on glibc/applications.

linux-arch-owner@vger.kernel.org 写于 2009-06-23 18:51:47:

> Before we commit the code to linux.org, 
> Linux had run on spct6600 score platform well. 
> It had passed LTP test and could run many general applications.
> S+core application depend on glibc-2.3.6, which support static
> and dynamic applications.

void merge_score_to_upstream(void)
{
        if (asm-generic is the right direction for all linux arch) {
                if (merge score code) {
                        It's easy for us to update score code and
                                commit the asm-generic problems we meet.
                } else {
                        People will pay no attation to score/asm-generic
                                problems.
                        printk("it haven't help asm-generic to stable.");
                }
        else {
                we could use score old asm/unistd.h instead.
        }
}

I think merge score to upstream will be no harm to linux kernel.

Christoph Hellwig <hch@infradead.org> 写于 2009-06-23 22:50:59:

> Still doesn't seem to be quite uptodate in the ptrace area, e.g. not
> using regsets at all.  It would be really helpful if the final ptrace
> code could be ran past Roland McGrath as the ptrace maintainer.

As a new comer, we don't know what we should or shouldn't do,
Since we begin to commit linux/score code to linux.org, we found
the best way is as simple as possible, because in linux world
people also have the different suggestions, it will make us 
confused and don't know what todo next soon.

The simple code has little error. We think it isn't the right
time to add utrace code so we don't do it.

Best Regards
Liqin
---

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: S+core architecture (arch/score/) support files
  2009-06-24  3:22       ` liqin.chen
  (?)
@ 2009-06-24  7:07       ` Andi Kleen
  2009-06-25  3:00           ` liqin.chen
  -1 siblings, 1 reply; 21+ messages in thread
From: Andi Kleen @ 2009-06-24  7:07 UTC (permalink / raw)
  To: liqin.chen
  Cc: Andi Kleen, Christoph Hellwig, Arnd Bergmann, linux-arch,
	linux-kernel, Linus Torvalds

> I think merge score to upstream will be no harm to linux kernel.

The problem is just that if the code is not tested in its
current configuration it will most likely not work (unless you're a perfect 
coder, but most of us are not). And merging code that doesn't work doesn't
make sense.

The need for a full retest after the changes inspired by review
feedback is somewhat annoying -- I agree -- but there's really
no way around it that I know.

BTW I'm not saying that LTP is the perfect user test (it's definitely
not), but it's a relatively useful basic sanity check and you
should pass something like this at least. Other real user testing would
be still needed too of course then.

-Andi
  
-- 
ak@linux.intel.com -- Speaking for myself only.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: S+core architecture (arch/score/) support files
  2009-06-24  7:07       ` Andi Kleen
@ 2009-06-25  3:00           ` liqin.chen
  0 siblings, 0 replies; 21+ messages in thread
From: liqin.chen @ 2009-06-25  3:00 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Arnd Bergmann, Christoph Hellwig, linux-arch, linux-arch-owner,
	linux-kernel, Linus Torvalds

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="GB2312", Size: 1134 bytes --]

linux-arch-owner@vger.kernel.org дÓÚ 2009-06-24 15:07:08:

> The problem is just that if the code is not tested in its
> current configuration it will most likely not work (unless you're a 
perfect 
> coder, but most of us are not). And merging code that doesn't work 
doesn't
> make sense.
> 
> The need for a full retest after the changes inspired by review
> feedback is somewhat annoying -- I agree -- but there's really
> no way around it that I know.
> 
> BTW I'm not saying that LTP is the perfect user test (it's definitely
> not), but it's a relatively useful basic sanity check and you
> should pass something like this at least. Other real user testing would
> be still needed too of course then.

Thanks Andi,

In fact, what I worry about is leaving score outside upstream,
Few person will pay attation to asm-generic/score patches.
When score kernel/glibc finish its update and passed LTP,
We still could not catch up people's suggestion.

Best Regards
Liqin

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: S+core architecture (arch/score/) support files
@ 2009-06-25  3:00           ` liqin.chen
  0 siblings, 0 replies; 21+ messages in thread
From: liqin.chen @ 2009-06-25  3:00 UTC (permalink / raw)
  To: Andi Kleen
  Cc: Arnd Bergmann, Christoph Hellwig, linux-arch, linux-arch-owner,
	linux-kernel, Linus Torvalds

linux-arch-owner@vger.kernel.org 写于 2009-06-24 15:07:08:

> The problem is just that if the code is not tested in its
> current configuration it will most likely not work (unless you're a 
perfect 
> coder, but most of us are not). And merging code that doesn't work 
doesn't
> make sense.
> 
> The need for a full retest after the changes inspired by review
> feedback is somewhat annoying -- I agree -- but there's really
> no way around it that I know.
> 
> BTW I'm not saying that LTP is the perfect user test (it's definitely
> not), but it's a relatively useful basic sanity check and you
> should pass something like this at least. Other real user testing would
> be still needed too of course then.

Thanks Andi,

In fact, what I worry about is leaving score outside upstream,
Few person will pay attation to asm-generic/score patches.
When score kernel/glibc finish its update and passed LTP,
We still could not catch up people's suggestion.

Best Regards
Liqin


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH] score: add regsets support for score
  2009-06-23 14:50 ` Christoph Hellwig
@ 2009-07-08 10:53   ` liqin.chen
  2009-07-09 15:08     ` Arnd Bergmann
  0 siblings, 1 reply; 21+ messages in thread
From: liqin.chen @ 2009-07-08 10:53 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Arnd Bergmann, linux-arch, linux-kernel, Linus Torvalds

ptrace.c add register sets support for score architecture.

- genregs_get(struct task_struct *target,
               const struct user_regset *regset,
               unsigned int pos, unsigned int count,
               void *kbuf, void __user *ubuf)
        Retrieve the contents of score userspace general registers.

- genregs_set(struct task_struct *target,
               const struct user_regset *regset,
               unsigned int pos, unsigned int count,
               const void *kbuf, const void __user *ubuf)
        Update the contents of the score userspace general registers.

Signed-off-by: Chen Liqin <liqin.chen@sunplusct.com>
---
 arch/score/include/asm/elf.h |    3 +-
 arch/score/kernel/ptrace.c   |   78 
++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 80 insertions(+), 1 deletions(-)

diff --git a/arch/score/include/asm/elf.h b/arch/score/include/asm/elf.h
index 8324363..d69668c 100644
--- a/arch/score/include/asm/elf.h
+++ b/arch/score/include/asm/elf.h
@@ -2,7 +2,7 @@
 #define _ASM_SCORE_ELF_H
 
 /* ELF register definitions */
-#define ELF_NGREG      45
+#define ELF_NGREG      42
 #define ELF_NFPREG     33
 #define EM_SCORE7      135
 
@@ -57,6 +57,7 @@ do { \
 struct task_struct;
 struct pt_regs;
 
+#define CORE_DUMP_USE_REGSET
 #define USE_ELF_CORE_DUMP
 #define ELF_EXEC_PAGESIZE      PAGE_SIZE
 
diff --git a/arch/score/kernel/ptrace.c b/arch/score/kernel/ptrace.c
index 1db876b..9eec6a2 100644
--- a/arch/score/kernel/ptrace.c
+++ b/arch/score/kernel/ptrace.c
@@ -23,11 +23,89 @@
  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <linux/elf.h>
 #include <linux/kernel.h>
 #include <linux/ptrace.h>
+#include <linux/regset.h>
 
 #include <asm/uaccess.h>
 
+/*
+ * retrieve the contents of SCORE userspace general registers
+ */
+static int genregs_get(struct task_struct *target,
+                      const struct user_regset *regset,
+                      unsigned int pos, unsigned int count,
+                      void *kbuf, void __user *ubuf)
+{
+       const struct pt_regs *regs = task_pt_regs(target);
+       int end_pos = sizeof(struct pt_regs) - 9 * sizeof(long);
+       int ret;
+
+       ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
+                                 regs->regs,
+                                 offsetof(struct pt_regs, regs),
+                                 end_pos);
+       if (!ret)
+               ret = user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf,
+                                               end_pos, -1);
+
+       return ret;
+}
+
+/*
+ * update the contents of the SCORE userspace general registers
+ */
+static int genregs_set(struct task_struct *target,
+                      const struct user_regset *regset,
+                      unsigned int pos, unsigned int count,
+                      const void *kbuf, const void __user *ubuf)
+{
+       struct pt_regs *regs = task_pt_regs(target);
+       int end_pos = sizeof(struct pt_regs) - 9 * sizeof(long);
+       int ret;
+
+       ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
+                                regs->regs,
+                                offsetof(struct pt_regs, regs),
+                                end_pos);
+       if (!ret)
+               ret = user_regset_copyin_ignore(&pos, &count, &kbuf, 
&ubuf,
+                                               end_pos, -1);
+
+       return ret;
+}
+
+/*
+ * Define the register sets available on the score7 under Linux
+ */
+enum score7_regset {
+       REGSET_GENERAL,
+};
+
+static const struct user_regset score7_regsets[] = {
+       [REGSET_GENERAL] = {
+               .core_note_type = NT_PRSTATUS,
+               .n              = ELF_NGREG,
+               .size           = sizeof(long),
+               .align          = sizeof(long),
+               .get            = genregs_get,
+               .set            = genregs_set,
+       },
+};
+
+static const struct user_regset_view user_score_native_view = {
+       .name           = "score7",
+       .e_machine      = EM_SCORE7,
+       .regsets        = score7_regsets,
+       .n              = ARRAY_SIZE(score7_regsets),
+};
+
+const struct user_regset_view *task_user_regset_view(struct task_struct 
*task)
+{
+       return &user_score_native_view;
+}
+
 static int is_16bitinsn(unsigned long insn)
 {
        if ((insn & INSN32_MASK) == INSN32_MASK)
-- 
1.6.2


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH] score: add regsets support for score
  2009-07-08 10:53   ` [PATCH] score: add regsets support for score liqin.chen
@ 2009-07-09 15:08     ` Arnd Bergmann
  2009-07-09 21:03       ` Roland McGrath
  2009-07-10  9:43         ` liqin.chen
  0 siblings, 2 replies; 21+ messages in thread
From: Arnd Bergmann @ 2009-07-09 15:08 UTC (permalink / raw)
  To: liqin.chen
  Cc: Christoph Hellwig, linux-arch, linux-kernel, Linus Torvalds,
	Roland McGrath

On Wednesday 08 July 2009, liqin.chen@sunplusct.com wrote:
> ptrace.c add register sets support for score architecture.
> 
> - genregs_get(struct task_struct *target,
>                const struct user_regset *regset,
>                unsigned int pos, unsigned int count,
>                void *kbuf, void __user *ubuf)
>         Retrieve the contents of score userspace general registers.
> 
> - genregs_set(struct task_struct *target,
>                const struct user_regset *regset,
>                unsigned int pos, unsigned int count,
>                const void *kbuf, const void __user *ubuf)
>         Update the contents of the score userspace general registers.
> 
> Signed-off-by: Chen Liqin <liqin.chen@sunplusct.com>
> ---
>  arch/score/include/asm/elf.h |    3 +-
>  arch/score/kernel/ptrace.c   |   78 
> ++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 80 insertions(+), 1 deletions(-)

You still use an email client that breaks patches by adding line-wraps.
Please use a different mail client for sending patches. You could for
example use git-send-email with a random freemail account and still
set your corporate sender address.

The code you add looks ok to me, but it appears you forgot to hook
it up to the ptrace logic. Some architectures use it only for
PTRACE_{GET,SET}REGS, others also use it in PTRACE_{PEEK,POKE}USR,
I'm not sure what the right approach is for new architectures.
Should a new architecture actually implement both of those
interfaces?

Maybe Christoph (who was asking for the change) or Roland can comment
on that.

	Arnd <><

> diff --git a/arch/score/include/asm/elf.h b/arch/score/include/asm/elf.h
> index 8324363..d69668c 100644
> --- a/arch/score/include/asm/elf.h
> +++ b/arch/score/include/asm/elf.h
> @@ -2,7 +2,7 @@
>  #define _ASM_SCORE_ELF_H
>  
>  /* ELF register definitions */
> -#define ELF_NGREG      45
> +#define ELF_NGREG      42
>  #define ELF_NFPREG     33
>  #define EM_SCORE7      135
>  
> @@ -57,6 +57,7 @@ do { \
>  struct task_struct;
>  struct pt_regs;
>  
> +#define CORE_DUMP_USE_REGSET
>  #define USE_ELF_CORE_DUMP
>  #define ELF_EXEC_PAGESIZE      PAGE_SIZE
>  
> diff --git a/arch/score/kernel/ptrace.c b/arch/score/kernel/ptrace.c
> index 1db876b..9eec6a2 100644
> --- a/arch/score/kernel/ptrace.c
> +++ b/arch/score/kernel/ptrace.c
> @@ -23,11 +23,89 @@
>   * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
>   */
>  
> +#include <linux/elf.h>
>  #include <linux/kernel.h>
>  #include <linux/ptrace.h>
> +#include <linux/regset.h>
>  
>  #include <asm/uaccess.h>
>  
> +/*
> + * retrieve the contents of SCORE userspace general registers
> + */
> +static int genregs_get(struct task_struct *target,
> +                      const struct user_regset *regset,
> +                      unsigned int pos, unsigned int count,
> +                      void *kbuf, void __user *ubuf)
> +{
> +       const struct pt_regs *regs = task_pt_regs(target);
> +       int end_pos = sizeof(struct pt_regs) - 9 * sizeof(long);
> +       int ret;
> +
> +       ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
> +                                 regs->regs,
> +                                 offsetof(struct pt_regs, regs),
> +                                 end_pos);
> +       if (!ret)
> +               ret = user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf,
> +                                               end_pos, -1);
> +
> +       return ret;
> +}
> +
> +/*
> + * update the contents of the SCORE userspace general registers
> + */
> +static int genregs_set(struct task_struct *target,
> +                      const struct user_regset *regset,
> +                      unsigned int pos, unsigned int count,
> +                      const void *kbuf, const void __user *ubuf)
> +{
> +       struct pt_regs *regs = task_pt_regs(target);
> +       int end_pos = sizeof(struct pt_regs) - 9 * sizeof(long);
> +       int ret;
> +
> +       ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
> +                                regs->regs,
> +                                offsetof(struct pt_regs, regs),
> +                                end_pos);
> +       if (!ret)
> +               ret = user_regset_copyin_ignore(&pos, &count, &kbuf, 
> &ubuf,
> +                                               end_pos, -1);
> +
> +       return ret;
> +}
> +
> +/*
> + * Define the register sets available on the score7 under Linux
> + */
> +enum score7_regset {
> +       REGSET_GENERAL,
> +};
> +
> +static const struct user_regset score7_regsets[] = {
> +       [REGSET_GENERAL] = {
> +               .core_note_type = NT_PRSTATUS,
> +               .n              = ELF_NGREG,
> +               .size           = sizeof(long),
> +               .align          = sizeof(long),
> +               .get            = genregs_get,
> +               .set            = genregs_set,
> +       },
> +};
> +
> +static const struct user_regset_view user_score_native_view = {
> +       .name           = "score7",
> +       .e_machine      = EM_SCORE7,
> +       .regsets        = score7_regsets,
> +       .n              = ARRAY_SIZE(score7_regsets),
> +};
> +
> +const struct user_regset_view *task_user_regset_view(struct task_struct 
> *task)
> +{
> +       return &user_score_native_view;
> +}
> +
>  static int is_16bitinsn(unsigned long insn)
>  {
>         if ((insn & INSN32_MASK) == INSN32_MASK)



^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] score: add regsets support for score
  2009-07-09 15:08     ` Arnd Bergmann
@ 2009-07-09 21:03       ` Roland McGrath
  2009-07-10  9:06           ` liqin.chen
  2009-07-10  9:43         ` liqin.chen
  1 sibling, 1 reply; 21+ messages in thread
From: Roland McGrath @ 2009-07-09 21:03 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: liqin.chen, Christoph Hellwig, linux-arch, linux-kernel, Linus Torvalds

> The code you add looks ok to me, but it appears you forgot to hook
> it up to the ptrace logic. Some architectures use it only for
> PTRACE_{GET,SET}REGS, others also use it in PTRACE_{PEEK,POKE}USR,
> I'm not sure what the right approach is for new architectures.
> Should a new architecture actually implement both of those
> interfaces?

I would not recommend adding PTRACE_{PEEK,POKE}USR to an ABI that
doesn't have it already.  It only exists on other arch's for past
compatibility; it's the poorest interface for this.

If you are starting from scratch, then you should define your arch's
user_regset layouts so that everything is nicely represented in one
regset or another.  Then for ptrace, define a PTRACE_{GET,SET}REGS
that exactly matches your regset 0, plus a *FPREGS for your FP regset
or one each such pair of ptrace requests for each extra user_regset
you have (if any).  arch_ptrace in arch/x86/kernel/ptrace.c shows an
example where *REGS are implemented in this trivial way.

> > +       ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
> > +                                 regs->regs,
> > +                                 offsetof(struct pt_regs, regs),
> > +                                 end_pos);

This looks odd to me.  The last two arguments here are offsets into
the userland ABI format defined by the user_regset layout.  Unless
offsetof(struct pt_regs, regs) is zero, then you need to precede
this call with one that fills in the initial stretch of the userland
format layout from its 0 up to offsetof(struct pt_regs, regs).  If
in fact offsetof(struct pt_regs, regs) is zero, then it would be far
less confusing to just write 0 there IMHO.  Using offsetof on
pt_regs at all here is very confusing to me unless pt_regs describes
the userland ABI layout (in which case the use here still doesn't
make sense).

If what's instead the case is that the userland ABI format matches
just the pt_regs.regs field and nothing more, then what you want is:

	ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
				  regs->regs, 0, sizeof(regs->regs));

I gather that you then have some reserved zero-fill words at the end
of the userland format (preparation for future use I presume).  So it's:

	ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
				  regs->regs, 0, sizeof(regs->regs));
	if (!ret)
		ret = user_regset_copyout_zero(&pos, &count, &kbuf, &ubuf,
					       sizeof(regs->regs), -1);

Et voila.

But I may be misunderstanding what the intended userland ABI format is
here.  I'd advise you to make sure that everything that can affect
user-mode instructions (condition codes, etc.) is exposed via some
user_regset layouts, or else you'll eventually have userland debugger
folks coming back to have you cram them in somehow later (and it won't
wind up as pretty).


Thanks,
Roland

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] score: add regsets support for score
  2009-07-09 21:03       ` Roland McGrath
@ 2009-07-10  9:06           ` liqin.chen
  0 siblings, 0 replies; 21+ messages in thread
From: liqin.chen @ 2009-07-10  9:06 UTC (permalink / raw)
  To: Roland McGrath
  Cc: Arnd Bergmann, Christoph Hellwig, linux-arch, linux-kernel,
	Linus Torvalds

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="GB2312", Size: 1369 bytes --]

Roland McGrath <roland@redhat.com> дÓÚ 2009-07-10 05:03:56:

> > > +       ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
> > > +                                 regs->regs,
> > > +                                 offsetof(struct pt_regs, regs),
> > > +                                 end_pos);
> 
> This looks odd to me.  The last two arguments here are offsets into
> the userland ABI format defined by the user_regset layout.  Unless
> offsetof(struct pt_regs, regs) is zero, then you need to precede
> this call with one that fills in the initial stretch of the userland
> format layout from its 0 up to offsetof(struct pt_regs, regs).  If
> in fact offsetof(struct pt_regs, regs) is zero, then it would be far
> less confusing to just write 0 there IMHO.  Using offsetof on
> pt_regs at all here is very confusing to me unless pt_regs describes
> the userland ABI layout (in which case the use here still doesn't
> make sense).

Thanks Roland,

Maybe I misunderstand the arguments meaning of
user_regset_copy(in/out), I rewrite these code,
use userland ABI format the same as score's pt_regs, 
just like sh arch do, maybe it's easy to understand.
It will be sent out latter.

Best Regards
Liqin
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] score: add regsets support for score
@ 2009-07-10  9:06           ` liqin.chen
  0 siblings, 0 replies; 21+ messages in thread
From: liqin.chen @ 2009-07-10  9:06 UTC (permalink / raw)
  To: Roland McGrath
  Cc: Arnd Bergmann, Christoph Hellwig, linux-arch, linux-kernel,
	Linus Torvalds

Roland McGrath <roland@redhat.com> 写于 2009-07-10 05:03:56:

> > > +       ret = user_regset_copyout(&pos, &count, &kbuf, &ubuf,
> > > +                                 regs->regs,
> > > +                                 offsetof(struct pt_regs, regs),
> > > +                                 end_pos);
> 
> This looks odd to me.  The last two arguments here are offsets into
> the userland ABI format defined by the user_regset layout.  Unless
> offsetof(struct pt_regs, regs) is zero, then you need to precede
> this call with one that fills in the initial stretch of the userland
> format layout from its 0 up to offsetof(struct pt_regs, regs).  If
> in fact offsetof(struct pt_regs, regs) is zero, then it would be far
> less confusing to just write 0 there IMHO.  Using offsetof on
> pt_regs at all here is very confusing to me unless pt_regs describes
> the userland ABI layout (in which case the use here still doesn't
> make sense).

Thanks Roland,

Maybe I misunderstand the arguments meaning of
user_regset_copy(in/out), I rewrite these code,
use userland ABI format the same as score's pt_regs, 
just like sh arch do, maybe it's easy to understand.
It will be sent out latter.

Best Regards
Liqin

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] score: add regsets support for score
  2009-07-09 15:08     ` Arnd Bergmann
@ 2009-07-10  9:43         ` liqin.chen
  2009-07-10  9:43         ` liqin.chen
  1 sibling, 0 replies; 21+ messages in thread
From: liqin.chen @ 2009-07-10  9:43 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Christoph Hellwig, linux-arch, linux-kernel, Roland McGrath,
	Linus Torvalds

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="GB2312", Size: 629 bytes --]

Arnd Bergmann <arnd@arndb.de> дÓÚ 2009-07-09 23:08:54:

> You still use an email client that breaks patches by adding line-wraps.
> Please use a different mail client for sending patches. You could for
> example use git-send-email with a random freemail account and still
> set your corporate sender address.

Sorry, our MIS haven't solved this problem yet,
I have to used it until they fixed this bug.

I will enclose a patch file in mail latter.

Best Regards
Liqin
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] score: add regsets support for score
@ 2009-07-10  9:43         ` liqin.chen
  0 siblings, 0 replies; 21+ messages in thread
From: liqin.chen @ 2009-07-10  9:43 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Christoph Hellwig, linux-arch, linux-kernel, Roland McGrath,
	Linus Torvalds

Arnd Bergmann <arnd@arndb.de> 写于 2009-07-09 23:08:54:

> You still use an email client that breaks patches by adding line-wraps.
> Please use a different mail client for sending patches. You could for
> example use git-send-email with a random freemail account and still
> set your corporate sender address.

Sorry, our MIS haven't solved this problem yet,
I have to used it until they fixed this bug.

I will enclose a patch file in mail latter.

Best Regards
Liqin

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH] score: add regsets support for score
  2009-07-10  9:43         ` liqin.chen
  (?)
@ 2009-07-10 10:44         ` Arnd Bergmann
  -1 siblings, 0 replies; 21+ messages in thread
From: Arnd Bergmann @ 2009-07-10 10:44 UTC (permalink / raw)
  To: liqin.chen
  Cc: Christoph Hellwig, linux-arch, linux-kernel, Linus Torvalds,
	Roland McGrath

On Friday 10 July 2009, liqin.chen@sunplusct.com wrote:
> Arnd Bergmann <arnd@arndb.de> 写于 2009-07-09 23:08:54:
> 
> > You still use an email client that breaks patches by adding line-wraps.
> > Please use a different mail client for sending patches. You could for
> > example use git-send-email with a random freemail account and still
> > set your corporate sender address.
> 
> Sorry, our MIS haven't solved this problem yet,
> I have to used it until they fixed this bug.

What's the problem? Do you need a development machine with SMTP access to
the internet? If so, the easiest way would be to use master.kernel.org
once you have an account there and not rely on your company infrastructure.

I noticed that you have started using Thunderbird instead of Notes now.
While Thunderbird has the same bug, you can at least work around it,
see the section on thunderbird in
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/email-clients.txt

OTOH, if you got thunderbird to send out your mails, you should
also be able to send out using git-send-email on the same server,
without any help from your MIS.

	Arnd <><

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2009-07-10 10:44 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-23  8:37 S+core architecture (arch/score/) support files liqin.chen
2009-06-23  9:43 ` Arnd Bergmann
2009-06-23 10:51   ` liqin.chen
2009-06-23 10:51     ` liqin.chen
2009-06-23 12:06   ` Andi Kleen
2009-06-23 13:55     ` Arnd Bergmann
2009-06-23 14:30       ` Andi Kleen
2009-06-24  3:22     ` liqin.chen
2009-06-24  3:22       ` liqin.chen
2009-06-24  7:07       ` Andi Kleen
2009-06-25  3:00         ` liqin.chen
2009-06-25  3:00           ` liqin.chen
2009-06-23 14:50 ` Christoph Hellwig
2009-07-08 10:53   ` [PATCH] score: add regsets support for score liqin.chen
2009-07-09 15:08     ` Arnd Bergmann
2009-07-09 21:03       ` Roland McGrath
2009-07-10  9:06         ` liqin.chen
2009-07-10  9:06           ` liqin.chen
2009-07-10  9:43       ` liqin.chen
2009-07-10  9:43         ` liqin.chen
2009-07-10 10:44         ` Arnd Bergmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.