xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: xen-devel@lists.xenproject.org, tim@xen.org,
	stefano.stabellini@citrix.com
Subject: Re: [PATCH v2] xen/arm: Correctly support WARN_ON
Date: Tue, 09 Sep 2014 11:31:47 -0700	[thread overview]
Message-ID: <540F4793.8080603@linaro.org> (raw)
In-Reply-To: <1410254228.8217.50.camel@kazak.uk.xensource.com>

Hi Ian,

On 09/09/14 02:17, Ian Campbell wrote:
> On Mon, 2014-09-08 at 12:19 -0700, Julien Grall wrote:
>> Hi Ian,
>>
>> On 08/09/14 06:01, Ian Campbell wrote:
>>>> +    /* PC is always 4-byte align, as Xen is using ARM instruction set */
>>>
>>> "aligned"
>>
>> Ok.
>>
>>> Is it worth a check here? I presume the nested fault if PC were
>>> misaligned would be pretty exciting, print+goto die would seem
>>> appropriate.
>>
>> I don't think so. The "undefined instruction" is only used when the
>> processor is unable to decode the instruction. If it fails to load the
>> instruction (because a wrong memory address, pc misaligned), Xen would
>> have received a "prefetch abort".
>
> I was thinking of something either wrongly or rightly transitioning to
> thumb mode. It'd have to be something horrible like a broken firmware
> returning from a PSCI call in the wrong mode or something like that
> though.

The thumb mode is stored in SPSR which is a banked registers. Your use 
case can only happen if the secure mode decides to modify the registers 
of the hypervisor. It would be very stupid from the firmware and other 
bad things could happen.

>>>>    }> +#ifdef CONFIG_ARM_64
>>>> +static void do_trap_brk(struct cpu_user_regs *regs, union hsr hsr)
>>>> +{
>>>> +    /* HCR_EL2.TGE and MDCR_EL2.TDE are not set so we never receive
>>>> +     * software breakpoint exception for EL1 and EL0 here
>>>> +     */
>>>
>>> BUG_ON? ;-O
>>
>> Sounds a good plan.
>
> Just be careful that it won't recurse ;-)

Panic should never go in exception mode, so I will use it instead.

Regards,

-- 
Julien Grall

  reply	other threads:[~2014-09-09 18:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-05 16:32 [PATCH v2] xen/arm: Correctly support WARN_ON Julien Grall
2014-09-08 13:01 ` Ian Campbell
2014-09-08 19:19   ` Julien Grall
2014-09-08 19:24     ` Julien Grall
2014-09-09  9:19       ` Ian Campbell
2014-09-09 20:25         ` Julien Grall
2014-09-09  9:17     ` Ian Campbell
2014-09-09 18:31       ` Julien Grall [this message]
2014-09-10  9:35         ` Ian Campbell
2014-09-10 19:02           ` Julien Grall

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=540F4793.8080603@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.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).