All of lore.kernel.org
 help / color / mirror / Atom feed
* some question about monitor mode support in arm
@ 2013-03-14  9:43 loody
  2013-03-14 13:37 ` Christopher Covington
  2013-04-08 16:13 ` Dave Martin
  0 siblings, 2 replies; 5+ messages in thread
From: loody @ 2013-03-14  9:43 UTC (permalink / raw)
  To: linux-arm-kernel

Hi all:
Does linux kernel support monitor mode handling?
I grep the keyword 'smc' but it only show how switch to, such as
mach-highbank/smc.S,
but not seem where to handle it.


-- 
Regards,

^ permalink raw reply	[flat|nested] 5+ messages in thread

* some question about monitor mode support in arm
  2013-03-14  9:43 some question about monitor mode support in arm loody
@ 2013-03-14 13:37 ` Christopher Covington
  2013-03-18  9:38   ` loody
  2013-04-08 16:13 ` Dave Martin
  1 sibling, 1 reply; 5+ messages in thread
From: Christopher Covington @ 2013-03-14 13:37 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On 03/14/2013 05:43 AM, loody wrote:
> Hi all:
> Does linux kernel support monitor mode handling?

It does not, but hypervisor mode support was recently added, which has pretty
similar mechanics.

> I grep the keyword 'smc' but it only show how switch to, such as
> mach-highbank/smc.S,
> but not seem where to handle it.

You can take a look at __hyp_set_vectors in arch/arm/kernel/hyp-stub.S for one
example of setting up exception vectors.

Cheers,
Christopher

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by
the Linux Foundation

^ permalink raw reply	[flat|nested] 5+ messages in thread

* some question about monitor mode support in arm
  2013-03-14 13:37 ` Christopher Covington
@ 2013-03-18  9:38   ` loody
  2013-03-18 16:46     ` Christopher Covington
  0 siblings, 1 reply; 5+ messages in thread
From: loody @ 2013-03-18  9:38 UTC (permalink / raw)
  To: linux-arm-kernel

hi Christopher:

2013/3/14 Christopher Covington <cov@codeaurora.org>:
> Hi,
>
> On 03/14/2013 05:43 AM, loody wrote:
>> Hi all:
>> Does linux kernel support monitor mode handling?
>
> It does not, but hypervisor mode support was recently added, which has pretty
> similar mechanics.
>
>> I grep the keyword 'smc' but it only show how switch to, such as
>> mach-highbank/smc.S,
>> but not seem where to handle it.
>
> You can take a look at __hyp_set_vectors in arch/arm/kernel/hyp-stub.S for one
> example of setting up exception vectors.
I grep what you mentioned.
But it seems nothing about __hyp_set_vectors you described
in arch/arm/kernel/hyp-stub.S
ENTRY(__hyp_set_vectors)
        __HVC(0)
        mov     pc, lr
ENDPROC(__hyp_set_vectors)


-- 
Thanks for your help,

^ permalink raw reply	[flat|nested] 5+ messages in thread

* some question about monitor mode support in arm
  2013-03-18  9:38   ` loody
@ 2013-03-18 16:46     ` Christopher Covington
  0 siblings, 0 replies; 5+ messages in thread
From: Christopher Covington @ 2013-03-18 16:46 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On 03/18/2013 05:38 AM, loody wrote:
> hi Christopher:
> 
> 2013/3/14 Christopher Covington <cov@codeaurora.org>:
>> Hi,
>>
>> On 03/14/2013 05:43 AM, loody wrote:
>>> Hi all:
>>> Does linux kernel support monitor mode handling?
>>
>> It does not, but hypervisor mode support was recently added, which has pretty
>> similar mechanics.
>>
>>> I grep the keyword 'smc' but it only show how switch to, such as
>>> mach-highbank/smc.S,
>>> but not seem where to handle it.
>>
>> You can take a look at __hyp_set_vectors in arch/arm/kernel/hyp-stub.S for one
>> example of setting up exception vectors.
> I grep what you mentioned.
> But it seems nothing about __hyp_set_vectors you described
> in arch/arm/kernel/hyp-stub.S
> ENTRY(__hyp_set_vectors)
>         __HVC(0)
>         mov     pc, lr
> ENDPROC(__hyp_set_vectors)

I don't think I understand your question, so I'll try to elaborate in hopes of
answering it nevertheless. __hyp_set_vectors may have not been the best label
to start off at, but it looked good at the time because of the nice big
comment above it.

During early boot, assuming a couple sanity checks pass, the hypervisor vector
base is set to __hyp_stub_vectors.

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/kernel/hyp-stub.S?id=refs/tags/v3.9-rc3#n128

You'll notice that __hyp_stub_vectors is mostly dummy infinite loop entries
except for __hyp_stub_trap, which branches to __hyp_stub_do_trap.

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/kernel/hyp-stub.S?id=refs/tags/v3.9-rc3#n207

The HVC call in __hyp_set_vectors should follow the
HVBAR->__hyp_stub_trap->__hyp_stub_do_trap path.

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/arch/arm/kernel/hyp-stub.S?id=refs/tags/v3.9-rc3#n162

At this point the hypervisor exception vectors are swapped out for whatever
the caller specified.

Regards,
Christopher

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by
the Linux Foundation

^ permalink raw reply	[flat|nested] 5+ messages in thread

* some question about monitor mode support in arm
  2013-03-14  9:43 some question about monitor mode support in arm loody
  2013-03-14 13:37 ` Christopher Covington
@ 2013-04-08 16:13 ` Dave Martin
  1 sibling, 0 replies; 5+ messages in thread
From: Dave Martin @ 2013-04-08 16:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Mar 14, 2013 at 05:43:30PM +0800, loody wrote:
> Hi all:
> Does linux kernel support monitor mode handling?

No.  In theory the kernel could make use of TrustZone if it is not
locked down by vendor firmware ... but it is hard to make effective
use of it in a large general-purpose software stack like the Linux
kernel.

In consumer devices, TrustZone is often locked down by vendor
firmware, and then Linux can't play with it anyway.


> I grep the keyword 'smc' but it only show how switch to, such as
> mach-highbank/smc.S,
> but not seem where to handle it.

What are you trying to achieve?

Cheers
---Dave

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-04-08 16:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-14  9:43 some question about monitor mode support in arm loody
2013-03-14 13:37 ` Christopher Covington
2013-03-18  9:38   ` loody
2013-03-18 16:46     ` Christopher Covington
2013-04-08 16:13 ` Dave Martin

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.