linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hch@infradead.org (Christoph Hellwig)
To: linux-riscv@lists.infradead.org
Subject: [PATCH] RISC-V: Add futex support.
Date: Mon, 15 Oct 2018 09:09:49 -0700	[thread overview]
Message-ID: <20181015160949.GA26588@infradead.org> (raw)
In-Reply-To: <20181015160103.GA19517@infradead.org>

On Mon, Oct 15, 2018 at 09:01:03AM -0700, Christoph Hellwig wrote:
> On Mon, Oct 15, 2018 at 08:57:24AM -0700, Jim Wilson wrote:
> > __riscv_atomic is a predefined macro from the compiler.  It is defined
> > when the target has atomic instructions, e.g. -march=rv64ia.  It is
> > not defined when the target has no atomic instructions, e.g.
> > -march=rv64i.  The idea here was that we only used atomic instructions
> > if the target has them.  I didn't think to check for a more proper
> > kernel solution.  I see that there is a CONFIG_RISCV_ISA_A so it looks
> > like I should be testing that instead.
> 
> Actually CONFIG_RISCV_ISA_A is dead code as well.  We assume A
> extensions in the kernel, so there should be no conditionals.

Actually we don't require the A extension for UP kernels, which
makes sense.

But that means we should keep using the asm-generic version for
the UP !CONFIG_RISCV_ISA_A case.

e.g.

#ifndef CONFIG_RISCV_ISA_A
/* 
 * Use the generic interrupt disabling versions if the A extension
 * is not supported.
 */
#ifdef CONFIG_SMP
#error "Can't support generic futex calls with A extension on SMP"
#endif
#include <asm-generic/futex.h>
#else
<rest of your new file>
#endif

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@infradead.org>
To: Jim Wilson <jimw@sifive.com>
Cc: hch@infradead.org, linux-riscv@lists.infradead.org
Subject: Re: [PATCH] RISC-V: Add futex support.
Date: Mon, 15 Oct 2018 09:09:49 -0700	[thread overview]
Message-ID: <20181015160949.GA26588@infradead.org> (raw)
Message-ID: <20181015160949.eocpzzGS31Z9wOtoIPa93Hw7N0enwQsmBwwTojoIWZ4@z> (raw)
In-Reply-To: <20181015160103.GA19517@infradead.org>

On Mon, Oct 15, 2018 at 09:01:03AM -0700, Christoph Hellwig wrote:
> On Mon, Oct 15, 2018 at 08:57:24AM -0700, Jim Wilson wrote:
> > __riscv_atomic is a predefined macro from the compiler.  It is defined
> > when the target has atomic instructions, e.g. -march=rv64ia.  It is
> > not defined when the target has no atomic instructions, e.g.
> > -march=rv64i.  The idea here was that we only used atomic instructions
> > if the target has them.  I didn't think to check for a more proper
> > kernel solution.  I see that there is a CONFIG_RISCV_ISA_A so it looks
> > like I should be testing that instead.
> 
> Actually CONFIG_RISCV_ISA_A is dead code as well.  We assume A
> extensions in the kernel, so there should be no conditionals.

Actually we don't require the A extension for UP kernels, which
makes sense.

But that means we should keep using the asm-generic version for
the UP !CONFIG_RISCV_ISA_A case.

e.g.

#ifndef CONFIG_RISCV_ISA_A
/* 
 * Use the generic interrupt disabling versions if the A extension
 * is not supported.
 */
#ifdef CONFIG_SMP
#error "Can't support generic futex calls with A extension on SMP"
#endif
#include <asm-generic/futex.h>
#else
<rest of your new file>
#endif

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply	other threads:[~2018-10-15 16:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-12 20:03 [PATCH] RISC-V: Add futex support Jim Wilson
2018-10-12 20:03 ` Jim Wilson
2018-10-15  8:34 ` Christoph Hellwig
2018-10-15  8:34   ` Christoph Hellwig
2018-10-15 15:57   ` Jim Wilson
2018-10-15 15:57     ` Jim Wilson
2018-10-15 16:01     ` Christoph Hellwig
2018-10-15 16:01       ` Christoph Hellwig
2018-10-15 16:09       ` Christoph Hellwig [this message]
2018-10-15 16:09         ` Christoph Hellwig

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=20181015160949.GA26588@infradead.org \
    --to=hch@infradead.org \
    --cc=linux-riscv@lists.infradead.org \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).