All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Chris Metcalf <cmetcalf@tilera.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-arch@vger.kernel.org
Subject: Re: [PATCH] arch/tile: new multi-core architecture for Linux
Date: Thu, 27 May 2010 16:11:47 +0200	[thread overview]
Message-ID: <201005271611.47963.arnd@arndb.de> (raw)
In-Reply-To: <4BFE73DF.5090107@tilera.com>

On Thursday 27 May 2010, Chris Metcalf wrote:
> On 5/27/2010 4:41 AM, Arnd Bergmann wrote:
> > Are you able to build 32 bit kernels for TILE-Gx as well? It's
> > probably something you never really want to do for performance
> > reasons, but I guess you could use that to verify that the
> > ABI is really compatible.
> >   
> 
> No, we haven't tried to do this.  I suppose it would be possible to port
> the TILE-Gx kernel to use -m32 mode and HIGHMEM, but I think it would
> just uglify the code.  :-)

Probably right, yes.

> >> The notion of using a file descriptor as the "rights" object is pretty
> >> central, so I think a character device will work out well.
> >>     
> > ok, I see. Now you could easily do this with system calls as well:
> > Instead of the initial ioctl that associates the file descriptor
> > with a rectangle, you can have a syscall that creates a rectangle
> > and a file descriptor (using anon_inode_getfd) associated with it,
> > and returns the fd to user space. This is similar to what we
> > do for other system call interfaces that operate on their own fds.
> >   
> 
> Yes, good point.  I'll be holding back this code from the initial patch,
> so I can think about it some more.  I'm still predisposed to avoid
> adding system calls in general, though.

Well, adding chardevs just for the sake of doing ioctl in place of
a syscall is no better than adding the real syscall for something that
should be one.
It has all the disadvantages of new syscalls but does it in a sneaky way.

> >> I'll try to remove them and see if anything falls over.  We don't have
> >> any memory-mapped addresses in the 32-bit architecture, though that
> >> changes with the 64-bit architecture, which introduces IO mappings.  For
> >> PCI we actually have to do a hypervisor transaction for reads or writes.
> >>     
> > Ok, then I assume that PIO would also be a hypervisor call, right?
> > If you don't have MMIO on 32 bit, you might want to not define either
> > PIO (inb, ...) no MMIO (readb, ...) calls there and disable
> > CONFIG_HAVE_MMIO in Kconfig.
> >   
> 
> We don't define CONFIG_HAVE_MMIO, but drivers certainly seem to use
> ioread/iowrite methods as well as inb/outb without guarding them with
> any particular tests, so we have to provide definitions of some kind for
> all of them.  I'll confer with our PCI developer to see if we can clean
> up the set of definitions in io.h.

As Geert mentioned, I meant CONFIG_HAS_IOMEM. If that is disabled,
no code should ever call any of these functions.

> >> Hmm, I didn't know about that.  Any information would be appreciated.  I
> >> guess you could synthesize something that looked like a signal purely in
> >> user-space?  But how would debuggers trap it?  I'm not sure how it would
> >> work without a system call.
> >>     
> > I think the C99 standard allows you to not implement SIGFPE at all but
> > instead rely on applications doing fetestexcept() etc.
> >   
> 
> We use this not for the floating-point operations, but for integer
> divide-by-zero.  In principle we could use it for floating-point too,
> but we currently don't, since generally folks don't expect it there.

Ah, I see. That probably makes a lot of sense to present as a signal
the way you do.

> >> Except they're also used by the 32-bit platform where there is no compat
> >> mode (the compat code DOES use them too, it's true).
> >>     
> > I see. AFAICT, all other architectures don't need the wrapper in
> > the 32 bit native case because they define the syscall calling
> > conventions in libc such that they match what the kernel
> > expects for a 64 bit argument (typically split in two subsequent
> > argument slots). Would that work for you as well?
> >   
> 
> Yes, we could override this in libc.  My assumption was that it was
> cleaner to do it in the kernel, since we support uclibc and glibc, and
> doing it in the kernel meant only doing it in one place.

That's not the way I meant. There are two options how (any) libc can
implement this:
1. the calling conventions for user function calls and for kernel
   function calls are the same, so you don't need to do anything here.
2. the calling conventions are different, so you already need a wrapper
   in user space for 64 bit arguments to split them up and you could
   to that in exactly the way that the kernel expects to be called.

> >> I'll think about it.  These are both basically disassembly-related, so
> >> maybe an arch/tile/disasm directory with the tile_desc stuff and the
> >> backtracer?  I'm not sure it's really worth moving out of
> >> arch/tile/kernel though.
> >>     
> > Ok. If you leave them in the directory, just split them out into a separate
> > patch on your next submission then.
> >   
> 
> Does this imply separate git commits to our repository, if we want to do
> things the Right Way?  I always tend to try to commit things in such a
> way that everything is always buildable between each commit, and I can't
> easily pull out the disassembly-related files from the kernel.  On the
> other hand I can easily split up a single bit GIT commit-patch into
> multiple emails, but then of course it wouldn't apply easily to a "git
> am".  Guidance??  :-)

You're right that any commit should result in something that's buildable.
In this case I think you can make an exception because before the first
patch, nothing builds in arch/tile, so you extend that phase to two
or three patches before you get to the first one that's actually
compilable.

	Arnd

  parent reply	other threads:[~2010-05-27 14:12 UTC|newest]

Thread overview: 110+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-20  5:43 [PATCH] arch/tile: new multi-core architecture for Linux Chris Metcalf
2010-05-20  8:04 ` Barry Song
2010-05-20 14:32   ` Linus Torvalds
2010-05-20 19:10   ` Chris Metcalf
2010-05-21  4:52     ` Barry Song
2010-05-21 15:13       ` Chris Metcalf
2010-05-20 19:12   ` [PATCH] generic: make lowmem_page_address() use PFN_PHYS() for improved portability Chris Metcalf
2010-05-22  4:05 ` [PATCH] arch/tile: new multi-core architecture for Linux Chris Metcalf
2010-05-23 22:08   ` Arnd Bergmann
2010-05-24 15:29     ` Chris Metcalf
2010-05-24 18:53       ` Arnd Bergmann
2010-05-24 21:29         ` Chris Metcalf
2010-05-25 13:54         ` Chris Metcalf
2010-05-25 15:03           ` Arnd Bergmann
2010-05-25 15:13             ` Chris Metcalf
2010-05-25 15:30               ` Arnd Bergmann
2010-05-26  2:44             ` liqin.chen
2010-05-26  2:44               ` liqin.chen
2010-05-26 13:45               ` Chris Metcalf
     [not found]           ` <4BFBE005.2070500@tilera.com>
     [not found]             ` <201005251721.23782.arnd@arndb.de>
2010-05-26 23:05               ` Chris Metcalf
2010-05-26  5:02       ` Paul Mundt
2010-05-25 21:45     ` Arnd Bergmann
2010-05-27  0:58       ` Chris Metcalf
2010-05-27  8:41         ` Arnd Bergmann
2010-05-27 13:30           ` Chris Metcalf
2010-05-27 13:41             ` Geert Uytterhoeven
2010-05-27 13:48               ` Paul Mundt
2010-05-27 14:11             ` Arnd Bergmann [this message]
2010-05-27 14:35               ` Chris Metcalf
2010-05-27 15:02                 ` Arnd Bergmann
2010-05-27 15:04                   ` Chris Metcalf
2010-05-27 15:20                     ` Arnd Bergmann
2010-05-27 14:52               ` Marc Gauthier
2010-05-28 17:58                 ` Chris Metcalf
2010-05-27 15:03               ` Chris Metcalf
2010-05-27 20:34           ` Jamie Lokier
2010-05-27 20:53             ` Arnd Bergmann
2010-05-28 16:45       ` Chris Metcalf
2010-05-28 17:16         ` Arnd Bergmann
2010-05-28 17:28           ` Chris Metcalf
2011-05-16 18:23       ` [PATCH] arch/tile: support signal "exception-trace" hook Chris Metcalf
2011-05-18 18:14         ` Chris Metcalf
2011-05-17 20:26       ` [PATCH] arch/tile: add /proc/tile, /proc/sys/tile, and a sysfs cpu attribute Chris Metcalf
2011-05-19 13:41         ` Arnd Bergmann
2011-05-19 15:12           ` Chris Metcalf
2011-05-19 15:22             ` Arnd Bergmann
2011-05-19 15:22             ` Arnd Bergmann
2011-05-20 14:26               ` Chris Metcalf
2011-05-20 14:26               ` Chris Metcalf
2011-05-20 14:37                 ` Arnd Bergmann
2011-05-20 15:00                   ` Chris Metcalf
2011-05-20 15:00                   ` Chris Metcalf
2011-05-20 15:13                     ` Arnd Bergmann
2011-05-20 19:59                       ` Arnd Bergmann
2011-05-20 19:59                       ` Arnd Bergmann
2011-05-25 19:09                         ` Chris Metcalf
2011-05-25 19:17                         ` Chris Metcalf
2011-05-25 19:18                         ` Chris Metcalf
2011-05-25 20:20                           ` Arnd Bergmann
2011-05-25 20:20                           ` Arnd Bergmann
2011-05-25 20:31                             ` Chris Metcalf
2011-05-25 20:34                               ` Arnd Bergmann
2011-05-25 20:34                               ` Arnd Bergmann
2011-05-25 20:31                             ` Chris Metcalf
2011-05-26 16:40                             ` [PATCH v2] arch/tile: more /proc and /sys file support Chris Metcalf
2011-05-27 14:23                               ` Arnd Bergmann
2011-05-27 14:23                               ` Arnd Bergmann
2011-05-26 16:40                             ` Chris Metcalf
2011-05-25 19:18                         ` [PATCH] arch/tile: add /proc/tile, /proc/sys/tile, and a sysfs cpu attribute Chris Metcalf
2011-05-20 15:13                     ` Arnd Bergmann
2011-05-20 14:37                 ` Arnd Bergmann
2011-05-24 15:38               ` Arnd Bergmann
2011-05-24 15:38               ` Arnd Bergmann
2010-05-24 20:22 ` [PATCH] arch/tile: new multi-core architecture for Linux Sam Ravnborg
2010-05-24 21:30   ` Chris Metcalf
2010-05-25  5:02     ` Sam Ravnborg
2010-05-25 20:12 ` Thomas Gleixner
2010-05-26  1:57   ` Chris Metcalf
2010-05-26 16:22   ` Chris Metcalf
2010-05-26 17:09     ` Arnd Bergmann
2010-05-29  3:01 ` [PATCH 1/8] Fix up the "generic" unistd.h ABI to be more useful Chris Metcalf
2010-05-29  3:01 ` Chris Metcalf
2010-05-29  3:09 ` [PATCH 2/8] arch/tile: infrastructure and configuration-related files Chris Metcalf
2010-05-31  7:47   ` Paul Mundt
2010-06-03 17:54     ` Chris Metcalf
2010-05-29  3:09 ` Chris Metcalf
2010-05-29  3:10 ` [PATCH 3/8] arch/tile: header files for the Tile architecture Chris Metcalf
2010-05-31  2:58   ` FUJITA Tomonori
2010-06-03 21:32   ` [PATCH] arch/tile: respond to reviews of the second code submission Chris Metcalf
2010-06-04  0:50     ` Paul Mundt
2010-06-04  1:31     ` FUJITA Tomonori
2010-06-07  5:25       ` FUJITA Tomonori
2010-05-29  3:10 ` [PATCH 4/8] arch/tile: core kernel/ code Chris Metcalf
2010-05-31  2:58   ` FUJITA Tomonori
2010-05-29  3:11 ` [PATCH 5/8] arch/tile: the kernel/tile-desc_32.c file Chris Metcalf
2010-05-29  3:13 ` [PATCH 6/8] arch/tile: the mm/ directory Chris Metcalf
2010-05-29  3:16 ` [PATCH 7/8] arch/tile: lib/ directory Chris Metcalf
2010-05-29  3:16 ` Chris Metcalf
2010-05-29  3:17 ` [PATCH 8/8] arch/tile: hypervisor console driver Chris Metcalf
2010-05-29  3:17 ` Chris Metcalf
     [not found] ` <dVZMmBu$KHA.5388@exchange1.tad.internal.tilera.com>
2010-05-29  3:20   ` [PATCH 0/8] revised patch for arch/tile/ support Chris Metcalf
2010-05-29  3:20 ` Chris Metcalf
2010-05-29 11:29   ` Arnd Bergmann
2010-06-03 20:40     ` Arnd Bergmann
2010-06-03 21:48       ` Chris Metcalf
2010-06-04 21:32       ` Chris Metcalf
2010-06-05 12:56         ` Stephen Rothwell
2010-06-05 13:30           ` Chris Metcalf
2010-06-05 14:10             ` Stephen Rothwell
2010-05-29  3:20 ` Chris Metcalf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201005271611.47963.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=cmetcalf@tilera.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is 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.