From: Michael Ellerman <mpe@ellerman.id.au>
To: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>,
Denis Kirjanov <kda@linux-powerpc.org>
Cc: ego@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] rtas: Validate rtas entry before calling enter_rtas
Date: Mon, 19 Oct 2015 20:41:53 +1100 [thread overview]
Message-ID: <1445247713.30407.6.camel@ellerman.id.au> (raw)
In-Reply-To: <5621CFB8.2050306@linux.vnet.ibm.com>
On Sat, 2015-10-17 at 10:04 +0530, Vasant Hegde wrote:
> On 10/16/2015 11:49 PM, Denis Kirjanov wrote:
> > On 10/16/15, Vasant Hegde <hegdevasant@linux.vnet.ibm.com> wrote:
> > > On 10/16/2015 04:02 PM, Denis Kirjanov wrote:
> > > > On 10/16/15, Vasant Hegde <hegdevasant@linux.vnet.ibm.com> wrote:
> > > > > Currently we do not validate rtas entry before calling enter_rtas().
> > > >
> > > > have you figured out why we have null entry?
> > > Yes... On PowerNV platform we don't have RTAS.. Hence it's not initialized.
> > But why do we have CONFIG_PPC_RTAS on OPAL machines then?
> Today we use single config to build kernel for both PowerNV and PAPR guest. So
> that same ISO can be used in different environment (PAPR LPAR, PowerNV host,
> guest). I believe most distro also following this method. Hence we need this
> validation.
Yes that's right.
Many of our platforms can coexist. So for example you can build a 64-bit big
endian kernel with support for G5, pSeries, Powernv, PS3, IBM Cell Blades,
Pasemi, & Maple (Bimini).
That means code that is #ifdef'ed to depend on one of those platforms, may end
up running on another platform. So we usually also need a runtime check to make
sure code doesn't run in the wrong places.
You'll see a lot of initcalls are machine_xxx_initcalls(), which means they
only run if the correct platform was detected. There's also
firmware_has_feature() checks, and then also device tree based detection.
This one seems to have slipped through the cracks because the tools that call
sys_rtas() are not used on powernv machines, so no one has though to call that
syscall. And on pseries machines rtas is always present, though obviously the
code should have still checked rtas.entry to be safe.
cheers
prev parent reply other threads:[~2015-10-19 9:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-16 10:23 [PATCH] rtas: Validate rtas entry before calling enter_rtas Vasant Hegde
2015-10-16 10:32 ` Denis Kirjanov
2015-10-16 15:14 ` Vasant Hegde
2015-10-16 18:19 ` Denis Kirjanov
2015-10-17 4:34 ` Vasant Hegde
2015-10-19 9:41 ` Michael Ellerman [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=1445247713.30407.6.camel@ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=ego@linux.vnet.ibm.com \
--cc=hegdevasant@linux.vnet.ibm.com \
--cc=kda@linux-powerpc.org \
--cc=linuxppc-dev@lists.ozlabs.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).