linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: PSCI reset support - specification
Date: Fri, 3 Mar 2017 15:06:18 +0000	[thread overview]
Message-ID: <20170303150617.GC12945@leverpostej> (raw)
In-Reply-To: <c460a695-1ed3-8926-68c6-09bafb582064@monstr.eu>

On Fri, Mar 03, 2017 at 01:09:51PM +0100, Michal Simek wrote:
> Hi,

Hi,

> I have read psci 1.0 specification available here.
> http://infocenter.arm.com/help/topic/com.arm.doc.den0022c/DEN0022C_Power_State_Coordination_Interface.pdf
> 
> I have looked at SYSTEM_RESET where only the first parameter is setup
> which is Function ID (0x8400 0009) and the rest of parameters are not
> setup.

The PSCI SYSTEM_RESET call only has the Function ID parameter, and no
other parameters.

It's not so much that they're not set up, but rather that they do not
exist.

> In Linux kernel we have psci_sys_reset
> 
> static void psci_sys_reset(enum reboot_mode reboot_mode, const char *cmd)
> {
> 	invoke_psci_fn(PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
> }
> 
> where others parameters are zeros.
> Is this done by purpose that these zeros are there?

The zeroes are simply an implementation detail of the Linux-internal
invoke_psci_fn() API. As SYSTEM_RESET takes no parameters other than the
Function ID, a PSCI implementation must not treat the remaining
parameter passing register values as meaningful.

It is entirely valid for the above to be changed to:

static void psci_sys_reset(enum reboot_mode reboot_mode, const char *cmd)
{
	invoke_psci_fn(PSCI_0_2_FN_SYSTEM_RESET,
	               get_random_long(),
		       get_random_long(),
		       get_random_long());
}

No compliant PSCI implementation should be affected by this.

> Because based on spec these are not used and value is not specified.
> 
> For example u-boot is allocating regs on the stack and others parameters
> have random values.

This is correct. The remaining parameter-passing registers are unused,
and are permitted to contain any value whatsoever when the call is made.

Thanks,
Mark.

      reply	other threads:[~2017-03-03 15:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-03 12:09 PSCI reset support - specification Michal Simek
2017-03-03 15:06 ` Mark Rutland [this message]

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=20170303150617.GC12945@leverpostej \
    --to=mark.rutland@arm.com \
    --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;
as well as URLs for NNTP newsgroup(s).