linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: cov@codeaurora.org (Christopher Covington)
To: linux-arm-kernel@lists.infradead.org
Subject: some question about monitor mode support in arm
Date: Mon, 18 Mar 2013 12:46:01 -0400	[thread overview]
Message-ID: <514744C9.7070505@codeaurora.org> (raw)
In-Reply-To: <CANudz+u2kEJRu0P1oVv84AhuGXM8RW-inr=LrPp4WJSKYQ3iJQ@mail.gmail.com>

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

  reply	other threads:[~2013-03-18 16:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2013-04-08 16:13 ` Dave Martin

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=514744C9.7070505@codeaurora.org \
    --to=cov@codeaurora.org \
    --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).