All of lore.kernel.org
 help / color / mirror / Atom feed
From: Santosh Shilimkar <santosh.shilimkar@ti.com>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christoffer Dall <christoffer.dall@linaro.org>,
	linux-omap <linux-omap@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Marc Zyngier <Marc.Zyngier@arm.com>,
	Tony Lindgren <tony@atomide.com>,
	Will Deacon <Will.Deacon@arm.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	"rob.herring@calxeda.com" <rob.herring@calxeda.com>,
	Arnd Bergmann <arnd@arndb.de>, Olof Johansson <olof@lixom.net>
Subject: Re: HYP Kernel boot requirements
Date: Tue, 26 Nov 2013 09:47:13 -0500	[thread overview]
Message-ID: <5294B471.7020205@ti.com> (raw)
In-Reply-To: <20131126141346.GA692@arm.com>

On Tuesday 26 November 2013 09:13 AM, Catalin Marinas wrote:
> On Mon, Nov 25, 2013 at 07:44:08PM +0000, Santosh Shilimkar wrote:
>> On Monday 25 November 2013 12:28 PM, Catalin Marinas wrote:
>>> On Mon, Nov 25, 2013 at 04:59:16PM +0000, Santosh Shilimkar wrote:
>>>> What I am saying is the platforms like OMAP5 already support PM in
>>>> mainline kernel and we can't break that for KVM. Boot-loaders
>>>> would be thrashed after boot so you need something which runs
>>>> in Kernel or along with Kernel to have equivalent of hyp
>>>> switching.
>>>>
>>>> Am not challenging the agreed direction but we need to solve the
>>>> PM problem as well before making "all CPU runs boot-loader for
>>>> HYP kernels" as a must have. At least its is a change in boot
>>>> strategy from existing kernels.
>>>
>>> Of course I recommend PSCI which covers both hotplug and suspend ;), but
>>> I guess it's not the case for OMAP5. Since OMAP has its own secondary
>>> booting protocol and CPU hotplug re-entry, can you not just use
>>> different entry point when the primary CPU was initially started in Hyp
>>> mode (e.g. omap5_hyp_secondary_startup)?
>>>
>> How will that solve the guest secondary boot failure case when using
>> the same kernel binary for guest-boot ? Even for primary CPU which
>> will be suspended it needs to resume already in HYP mode and its not
>> going to go through boot-loader. So the low power code needs to have
>> HYP switch code so that CPU resumes in HYP mode.
> 
> Is it late to rewrite the OMAP5 firmware?
> 
Well its ROM'ed unfortunately so no choice. OMAP5 ROM did implement
a secure API which lets you enter into HYP mode and thats the only
thing can be used.

> What I meant is that you have the same kernel binary but with two sets
> of entry points, or maybe a single set of entry points and some global
> variable that you set during cold boot if the primary CPU is entered in
> Hyp mode. So you change the boot loader to switch to Hyp before it
> starts the kernel and leave the additional switching to be done by the
> secondary entry points (or PM code) based on the variable you set during
> cold boot. But I would recommend rewriting the firmware.
> 
>> I will look at PSCI more closely and see what can be done here.
> 
> PSCI has a different secondary start-up and hotplug/suspend protocol and
> CPUs wake up in Hyp if available. But this requires changing your
> firmware, PSCI is not a kernel-only thing. Do you need to support both
> older and newer kernels with the OMAP5 firmware (and possibly same DT)?
>
Hmmm.. So thats rules out PSCI for OMAP5 then.

Keystone actually has nice way to deal with the problem since the
boot-monitor code can be patched up and hence I had no trouble
implementing the "CPU starts in HYP mode" requirement on it.

Regards,
Santosh


 


WARNING: multiple messages have this Message-ID (diff)
From: santosh.shilimkar@ti.com (Santosh Shilimkar)
To: linux-arm-kernel@lists.infradead.org
Subject: HYP Kernel boot requirements
Date: Tue, 26 Nov 2013 09:47:13 -0500	[thread overview]
Message-ID: <5294B471.7020205@ti.com> (raw)
In-Reply-To: <20131126141346.GA692@arm.com>

On Tuesday 26 November 2013 09:13 AM, Catalin Marinas wrote:
> On Mon, Nov 25, 2013 at 07:44:08PM +0000, Santosh Shilimkar wrote:
>> On Monday 25 November 2013 12:28 PM, Catalin Marinas wrote:
>>> On Mon, Nov 25, 2013 at 04:59:16PM +0000, Santosh Shilimkar wrote:
>>>> What I am saying is the platforms like OMAP5 already support PM in
>>>> mainline kernel and we can't break that for KVM. Boot-loaders
>>>> would be thrashed after boot so you need something which runs
>>>> in Kernel or along with Kernel to have equivalent of hyp
>>>> switching.
>>>>
>>>> Am not challenging the agreed direction but we need to solve the
>>>> PM problem as well before making "all CPU runs boot-loader for
>>>> HYP kernels" as a must have. At least its is a change in boot
>>>> strategy from existing kernels.
>>>
>>> Of course I recommend PSCI which covers both hotplug and suspend ;), but
>>> I guess it's not the case for OMAP5. Since OMAP has its own secondary
>>> booting protocol and CPU hotplug re-entry, can you not just use
>>> different entry point when the primary CPU was initially started in Hyp
>>> mode (e.g. omap5_hyp_secondary_startup)?
>>>
>> How will that solve the guest secondary boot failure case when using
>> the same kernel binary for guest-boot ? Even for primary CPU which
>> will be suspended it needs to resume already in HYP mode and its not
>> going to go through boot-loader. So the low power code needs to have
>> HYP switch code so that CPU resumes in HYP mode.
> 
> Is it late to rewrite the OMAP5 firmware?
> 
Well its ROM'ed unfortunately so no choice. OMAP5 ROM did implement
a secure API which lets you enter into HYP mode and thats the only
thing can be used.

> What I meant is that you have the same kernel binary but with two sets
> of entry points, or maybe a single set of entry points and some global
> variable that you set during cold boot if the primary CPU is entered in
> Hyp mode. So you change the boot loader to switch to Hyp before it
> starts the kernel and leave the additional switching to be done by the
> secondary entry points (or PM code) based on the variable you set during
> cold boot. But I would recommend rewriting the firmware.
> 
>> I will look at PSCI more closely and see what can be done here.
> 
> PSCI has a different secondary start-up and hotplug/suspend protocol and
> CPUs wake up in Hyp if available. But this requires changing your
> firmware, PSCI is not a kernel-only thing. Do you need to support both
> older and newer kernels with the OMAP5 firmware (and possibly same DT)?
>
Hmmm.. So thats rules out PSCI for OMAP5 then.

Keystone actually has nice way to deal with the problem since the
boot-monitor code can be patched up and hence I had no trouble
implementing the "CPU starts in HYP mode" requirement on it.

Regards,
Santosh


 

  reply	other threads:[~2013-11-26 14:47 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-24  0:07 [PATCH 0/2] ARM: OMAP5: Couple of patches for KVM Santosh Shilimkar
2013-11-24  0:07 ` Santosh Shilimkar
2013-11-24  0:07 ` [PATCH 1/2] ARM: dts: OMAP5: Add maintenance interrupt for virtualisation Santosh Shilimkar
2013-11-24  0:07   ` Santosh Shilimkar
2013-11-24  0:38   ` Santosh Shilimkar
2013-11-24  0:38     ` Santosh Shilimkar
2013-11-24  0:07 ` [PATCH 2/2] ARM: OMAP5: Add HYP mode entry support for secondary CPUs Santosh Shilimkar
2013-11-24  0:07   ` Santosh Shilimkar
2013-11-25 15:09   ` Christoffer Dall
2013-11-25 15:09     ` Christoffer Dall
2013-11-25 16:28     ` Santosh Shilimkar
2013-11-25 16:28       ` Santosh Shilimkar
2013-11-25 16:33       ` Christoffer Dall
2013-11-25 16:33         ` Christoffer Dall
2013-11-25 16:59         ` HYP Kernel boot requirements [Was ...Re: [PATCH 2/2] ARM: OMAP5: Add HYP mode entry support for secondary CPUs] Santosh Shilimkar
2013-11-25 16:59           ` Santosh Shilimkar
2013-11-25 17:28           ` Catalin Marinas
2013-11-25 17:28             ` Catalin Marinas
2013-11-25 19:44             ` HYP Kernel boot requirements Santosh Shilimkar
2013-11-25 19:44               ` Santosh Shilimkar
2013-11-26 14:13               ` Catalin Marinas
2013-11-26 14:13                 ` Catalin Marinas
2013-11-26 14:47                 ` Santosh Shilimkar [this message]
2013-11-26 14:47                   ` Santosh Shilimkar
2013-11-26 17:37                   ` Dave Martin
2013-11-26 17:37                     ` Dave Martin
2013-11-26 21:49                     ` Santosh Shilimkar
2013-11-26 21:49                       ` Santosh Shilimkar
2013-11-27 14:38                       ` Lorenzo Pieralisi
2013-11-27 14:38                         ` Lorenzo Pieralisi
2013-11-25 16:42       ` [PATCH 2/2] ARM: OMAP5: Add HYP mode entry support for secondary CPUs Marc Zyngier
2013-11-25 16:42         ` Marc Zyngier
2013-11-25 17:02         ` Santosh Shilimkar
2013-11-25 17:02           ` Santosh Shilimkar

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=5294B471.7020205@ti.com \
    --to=santosh.shilimkar@ti.com \
    --cc=Marc.Zyngier@arm.com \
    --cc=Will.Deacon@arm.com \
    --cc=arnd@arndb.de \
    --cc=catalin.marinas@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=olof@lixom.net \
    --cc=rob.herring@calxeda.com \
    --cc=tony@atomide.com \
    /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.