All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Burton <paul.burton@mips.com>
To: Dengcheng Zhu <dzhu@wavecomp.com>
Cc: Paul Burton <pburton@wavecomp.com>,
	"ralf@linux-mips.org" <ralf@linux-mips.org>,
	"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
	"rachel.mozes@intel.com" <rachel.mozes@intel.com>
Subject: Re: [PATCH v4 0/6] MIPS: kexec/kdump: Fix smp reboot and other issues
Date: Fri, 7 Sep 2018 16:11:54 -0700	[thread overview]
Message-ID: <20180907231154.hnnhi2kns77hdnr2@pburton-laptop> (raw)
In-Reply-To: <CO2PR0801MB2151111E37EDDB45D93F0F64A2000@CO2PR0801MB2151.namprd08.prod.outlook.com>

On Fri, Sep 07, 2018 at 03:21:10PM -0700, Dengcheng Zhu wrote:
> Hi Paul,
> 
> 
> > The problem is that the "only CPU0 will use reboot_code_buffer" part
> isn't true because CPU0 might not be the one that writes to it.
> 
> [Dengcheng]: I didn't say CPU0 is always the one running machine_kexec().
> Actually, in my testing, I intentionally did something like:
> 
> taskset -c 3 echo c > /proc/sysrq-trigger

Well, if CPU 0 isn't running machine_kexec() then some other CPU is
doing the write to reboot_code_buffer and therefore CPU 0 isn't the only
one accessing/using it.

As I walked through in an earlier email, the safe way for this to happen
is for the machine_kexec() CPU to write back its dcache as far as needed
for a remote CPU's icache to observe the stores. Having CPU 0 be the
only one to do any cache maintenance will not achieve that.

As I mentioned before, if you're testing on I6x00 then you probably got
away with it because the icache fills from the dcache. You'd probably
also get away with having CPU 0 be the only one to do cache maintenance
since the CM globalizes hit cache ops. But not all MIPS CPUs would be so
lucky.

> And for "either halted or powered down", do you have any idea/plan for
> Octeon, Loognson and bmips?

Well like I said before if we add a callback to struct plat_smp_ops to
stop other CPUs, at least in the crash case, then we can check that &
refuse to kexec() on systems that haven't implemented it.

Octeon right now has kexec, so any changes like this should bring Octeon
along for the ride by implementing the new callback there. Loongson has
a patch pending [1] so that should probably be taken into account too.
bmips would just be left alone, and wouldn't support kexec until someone
implements the new callback.

[1] https://patchwork.linux-mips.org/patch/20432/

Thanks,
    Paul

  reply	other threads:[~2018-09-07 23:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-05 15:59 [PATCH v4 0/6] MIPS: kexec/kdump: Fix smp reboot and other issues Dengcheng Zhu
2018-09-05 15:59 ` [PATCH v4 1/6] MIPS: Make play_dead() work for kexec Dengcheng Zhu
2018-09-05 15:59 ` [PATCH v4 2/6] MIPS: kexec: Let the new kernel handle all CPUs Dengcheng Zhu
2018-09-05 15:59 ` [PATCH v4 3/6] MIPS: kexec: Deprecate (relocated_)kexec_smp_wait Dengcheng Zhu
2018-09-05 15:59 ` [PATCH v4 4/6] MIPS: kexec: Do not flush system wide caches in machine_kexec() Dengcheng Zhu
2018-09-05 15:59 ` [PATCH v4 5/6] MIPS: kexec: Relax memory restriction Dengcheng Zhu
2018-09-05 15:59 ` [PATCH v4 6/6] MIPS: kexec: Use prepare method from Generic for UHI platforms Dengcheng Zhu
2018-09-05 22:54 ` [PATCH v4 0/6] MIPS: kexec/kdump: Fix smp reboot and other issues Paul Burton
2018-09-06 19:19   ` Dengcheng Zhu
2018-09-06 20:34     ` Paul Burton
2018-09-06 22:23       ` Dengcheng Zhu
2018-09-06 23:21         ` Paul Burton
2018-09-07 19:47           ` Dengcheng Zhu
2018-09-07 19:47             ` Dengcheng Zhu
2018-09-07 21:42             ` Paul Burton
2018-09-07 22:21               ` Dengcheng Zhu
2018-09-07 22:21                 ` Dengcheng Zhu
2018-09-07 23:11                 ` Paul Burton [this message]
2018-09-07 23:31                   ` Dengcheng Zhu
2018-09-07 23:31                     ` Dengcheng Zhu

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=20180907231154.hnnhi2kns77hdnr2@pburton-laptop \
    --to=paul.burton@mips.com \
    --cc=dzhu@wavecomp.com \
    --cc=linux-mips@linux-mips.org \
    --cc=pburton@wavecomp.com \
    --cc=rachel.mozes@intel.com \
    --cc=ralf@linux-mips.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.