All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Martin <dave.martin@linaro.org>
To: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>,
	sen wang <wangchendu@gmail.com>,
	David Brown <davidb@codeaurora.org>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: questions about arm trustzone
Date: Tue, 25 Jan 2011 12:24:13 +0000	[thread overview]
Message-ID: <AANLkTi=vZSZkN2k1gZD0F-C74b_jFWX5HhDhr7BiPhN7@mail.gmail.com> (raw)
In-Reply-To: <bb0c3855a121603232d022b4062752a6@mail.gmail.com>

On Tue, Jan 25, 2011 at 11:46 AM, Santosh Shilimkar
<santosh.shilimkar@ti.com> wrote:
>> -----Original Message-----
>> From: linux-arm-kernel-bounces@lists.infradead.org [mailto:linux-
>> arm-kernel-bounces@lists.infradead.org] On Behalf Of Russell King -
>> ARM Linux
>> Sent: Tuesday, January 25, 2011 3:57 PM
>> To: sen wang
>> Cc: David Brown; linux-kernel@vger.kernel.org; linux-arm-
>> kernel@lists.infradead.org
>> Subject: Re: questions about arm trustzone
>>
>> On Tue, Jan 25, 2011 at 05:19:16PM +0800, sen wang wrote:
>> > It seems linux run in the normal world, and the "scm.c"  is the
>> path
>> > to the monitor mode.
>> > where can I find the example code for monitor and secure world?
>>
>> OMAP also uses smc: arch/arm/mach-omap2/omap44xx-smc.S
>>
>> There's no interface defined for smc because it's highly vendor and
>> implementation specific.  It's just like a SWI (or svc) where it
>> causes entry via a vector into a priviledged mode, which can be
>> thought of being similar to a branch to a vector with a mode switch.
>>
> The code above won't give major details of how the monitor mode is
> implemented.  But as Russell said, it's pretty much vendor specific.
>
> On OMAP, We have standard API interfaces to enter into monitor
> world. One of the parameter denotes the kind of service, is
> requested.

I'm going off on a bit of a tangent here, but do you know whether the
Secure World code on OMAP can cope with being called from Thumb?  In
particular, if the Secure World tries to read the comment field from
the SMC instruction (which I notice is non-zero in some cases for
OMAP), it would need to be specifically coded to cope with the Thumb
case for this to work.

Avoiding this complexity is one of the motivations for using r7 for
the syscall number with CONFIG_EABI (instead of using the SVC comment
field).

Currently in my efforts to get the OMAP kernel working in Thumb-2, I
have assumed for simplicity that the Secure World will choke on SMCs
from Thumb code, but it would be nice to minimise the amount of code
which we need to build as ARM in the CONFIG_THUMB2_KERNEL case.  In
principle, everything could be Thumb code, now that the SWP
instruction usage is gone.

Cheers
---Dave

WARNING: multiple messages have this Message-ID (diff)
From: dave.martin@linaro.org (Dave Martin)
To: linux-arm-kernel@lists.infradead.org
Subject: questions about arm trustzone
Date: Tue, 25 Jan 2011 12:24:13 +0000	[thread overview]
Message-ID: <AANLkTi=vZSZkN2k1gZD0F-C74b_jFWX5HhDhr7BiPhN7@mail.gmail.com> (raw)
In-Reply-To: <bb0c3855a121603232d022b4062752a6@mail.gmail.com>

On Tue, Jan 25, 2011 at 11:46 AM, Santosh Shilimkar
<santosh.shilimkar@ti.com> wrote:
>> -----Original Message-----
>> From: linux-arm-kernel-bounces at lists.infradead.org [mailto:linux-
>> arm-kernel-bounces at lists.infradead.org] On Behalf Of Russell King -
>> ARM Linux
>> Sent: Tuesday, January 25, 2011 3:57 PM
>> To: sen wang
>> Cc: David Brown; linux-kernel at vger.kernel.org; linux-arm-
>> kernel at lists.infradead.org
>> Subject: Re: questions about arm trustzone
>>
>> On Tue, Jan 25, 2011 at 05:19:16PM +0800, sen wang wrote:
>> > It seems linux run in the normal world, and the "scm.c" ?is the
>> path
>> > to the monitor mode.
>> > where can I find the example code for monitor and secure world?
>>
>> OMAP also uses smc: arch/arm/mach-omap2/omap44xx-smc.S
>>
>> There's no interface defined for smc because it's highly vendor and
>> implementation specific. ?It's just like a SWI (or svc) where it
>> causes entry via a vector into a priviledged mode, which can be
>> thought of being similar to a branch to a vector with a mode switch.
>>
> The code above won't give major details of how the monitor mode is
> implemented. ?But as Russell said, it's pretty much vendor specific.
>
> On OMAP, We have standard API interfaces to enter into monitor
> world. One of the parameter denotes the kind of service, is
> requested.

I'm going off on a bit of a tangent here, but do you know whether the
Secure World code on OMAP can cope with being called from Thumb?  In
particular, if the Secure World tries to read the comment field from
the SMC instruction (which I notice is non-zero in some cases for
OMAP), it would need to be specifically coded to cope with the Thumb
case for this to work.

Avoiding this complexity is one of the motivations for using r7 for
the syscall number with CONFIG_EABI (instead of using the SVC comment
field).

Currently in my efforts to get the OMAP kernel working in Thumb-2, I
have assumed for simplicity that the Secure World will choke on SMCs
from Thumb code, but it would be nice to minimise the amount of code
which we need to build as ARM in the CONFIG_THUMB2_KERNEL case.  In
principle, everything could be Thumb code, now that the SWP
instruction usage is gone.

Cheers
---Dave

  parent reply	other threads:[~2011-01-25 12:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-25  2:15 questions about arm trustzone sen wang
2011-01-25  2:15 ` sen wang
2011-01-25  7:49 ` David Brown
2011-01-25  7:49   ` David Brown
2011-01-25  9:19   ` sen wang
2011-01-25  9:19     ` sen wang
2011-01-25 10:26     ` Russell King - ARM Linux
2011-01-25 10:26       ` Russell King - ARM Linux
2011-01-25 11:46       ` Santosh Shilimkar
2011-01-25 11:46         ` Santosh Shilimkar
2011-01-25 12:00         ` Russell King - ARM Linux
2011-01-25 12:00           ` Russell King - ARM Linux
2011-01-25 12:24         ` Dave Martin [this message]
2011-01-25 12:24           ` Dave Martin
2011-01-25 12:45           ` Russell King - ARM Linux
2011-01-25 12:45             ` Russell King - ARM Linux
2011-01-25 13:25             ` Dave Martin
2011-01-25 13:25               ` Dave Martin
2011-03-11 13:02         ` shiraz hashim
2011-03-11 13:02           ` shiraz hashim

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='AANLkTi=vZSZkN2k1gZD0F-C74b_jFWX5HhDhr7BiPhN7@mail.gmail.com' \
    --to=dave.martin@linaro.org \
    --cc=davidb@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=santosh.shilimkar@ti.com \
    --cc=wangchendu@gmail.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.