public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: geoff@infradead.org (Geoff Levand)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] Arm64: convert soft_restart() to assembly code
Date: Fri, 15 Aug 2014 11:53:19 -0700	[thread overview]
Message-ID: <1408128799.22761.47.camel@smoke> (raw)
In-Reply-To: <20140815182157.GD21908@leverpostej>

Hi Mark,

On Fri, 2014-08-15 at 19:21 +0100, Mark Rutland wrote:
> On Fri, Aug 15, 2014 at 06:20:21PM +0100, Geoff Levand wrote:
> > For the cpu-ops shutdown I'm working on I need a call to move the
> > secondary processors to an identity mapped spin loop after the identity
> > map is enabled.  I want to do this in C code, so it needs to happen
> > after the identity map is enabled, and before the dcache is disabled.
> > 
> > I think to do this we can keep the existing soft_restart(addr) routine
> > with something like this:
> > 
> > void soft_restart(unsigned long addr)
> > {
> > 	setup_mm_for_reboot();
> > 
> > #if defined(CONFIG_SMP)
> > 	smp_secondary_shutdown();
> > #endif
> > 
> > 	cpu_soft_restart(addr);
> > 
> > 	/* Should never get here */
> > 	BUG();
> > }
> > 
> 
> I don't follow why you need a hook in the middle of soft_restart. That
> sounds like a layering violation to me.
> 
> I assume this is for implementing the spin-table cpu-return-addr idea?

Yes.

> If so, what's wrong with something like:

> void spin_table_cpu_die(unsigned int cpu)
> {
> 	unsigned long release_addr = per_cpu(return_addr, cpu);
> 	
> 	/*
> 	 * We should have a local_disable(DBG|ASYNC|FIQ|IRQ) function or
> 	 * something similar as these are all context synchronising and
> 	 * therefore expensive.
> 	 */
> 	local_dbg_disable();
> 	local_async_disable();
> 	local_fiq_disable();
> 	arch_local_irq_disable();
> 
> 	soft_restart(release_addr);
> }

OK, this is a much simpler way than what I was thinking, which
was to have the secondaries spin in the kernel until the main
cpu shutdown.  I'll switch over to this, thanks.

-Geoff

  reply	other threads:[~2014-08-15 18:53 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-12 12:42 [PATCH] Arm64: convert soft_restart() to assembly code Arun Chandran
2014-08-12 14:05 ` Mark Rutland
2014-08-13  4:57   ` Arun Chandran
2014-08-13  7:43 ` [PATCH] Arm64: convert part of soft_restart() to assembly Arun Chandran
2014-08-13 10:58   ` Mark Rutland
2014-08-13 11:17     ` Arun Chandran
2014-08-13 11:21       ` Mark Rutland
2014-08-15 17:20 ` [PATCH] Arm64: convert soft_restart() to assembly code Geoff Levand
2014-08-15 18:21   ` Mark Rutland
2014-08-15 18:53     ` Geoff Levand [this message]
2014-08-18 16:02       ` Mark Rutland
2014-08-18 17:33         ` Christoffer Dall
2014-08-19  1:10           ` Geoff Levand
2014-08-20 10:48           ` Mark Rutland
2014-08-20 10:54             ` Christoffer Dall
2014-08-20 11:21               ` Mark Rutland
2014-08-25 11:04         ` Arun Chandran
2014-08-25 14:14         ` Arun Chandran
2014-08-26 15:22           ` Mark Rutland
2014-08-26 16:14             ` Arun Chandran
2014-08-18  6:43     ` Arun Chandran
2014-08-19  9:04     ` Arun Chandran
2014-08-20 10:28     ` Arun Chandran
2014-08-20 10:54       ` Mark Rutland
2014-08-20 13:57         ` Arun Chandran
2014-08-20 14:16           ` Mark Rutland
2014-08-21 13:34             ` Arun Chandran
2014-08-21 14:31               ` Mark Rutland
2014-08-22 11:11                 ` Arun Chandran
2014-08-22 13:15                   ` Mark Rutland
2014-08-23 19:50                     ` Arun Chandran
2014-08-26 13:00                 ` Arun Chandran
2014-08-26 14:08                   ` Mark Rutland

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=1408128799.22761.47.camel@smoke \
    --to=geoff@infradead.org \
    --cc=linux-arm-kernel@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