From: Julien Grall <julien.grall@linaro.org>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Stefano.Stabellini@eu.citrix.com, Tim Deegan <tim@xen.org>,
patches@linaro.org, xen-devel@lists.xen.org
Subject: Re: [PATCH v2 3/3] xen/arm: errata 766422: decode thumb store during data abort
Date: Wed, 31 Jul 2013 11:19:53 +0100 [thread overview]
Message-ID: <51F8E4C9.5070000@linaro.org> (raw)
In-Reply-To: <1375260446.32691.86.camel@kazak.uk.xensource.com>
On 07/31/2013 09:47 AM, Ian Campbell wrote:
> On Tue, 2013-07-30 at 18:37 +0100, Julien Grall wrote:
>> On 07/29/2013 04:15 PM, Ian Campbell wrote:
>>> On Thu, 2013-07-25 at 16:21 +0100, Julien Grall wrote:
>
>>>> + /* Retrieve the transfer register from the instruction */
>>>> + if ( dabt.len )
>>>> + /* With 32-bit store instruction, the register is in [12..15] */
>>>> + info.dabt.reg = (instr & 0xf000) >> 12;
>>>> + else
>>>> + /* With 16-bit store instruction, the register is in [0..3] */
>>>> + info.dabt.reg = instr & 0x7;
>>>
>>> Encoding T2 (store via imm8 offset from sp) has it in 8..10.
>>
>> Right but ... from ARM DDI 0406C.b B3-1432: an instruction is valid if
>> it "is not using the PC as its destination register". So this
>> instruction is consider as invalid and will go to "bad_data_abort".
>
> I'm not sure what this has to do with the encoding I pointed to.
>
> A8.8.203 STR (immediate, Thumb), Encoding T2:
> STR<c> <Rt>, [SP, #<imm>]
> is:
> 1001 0ttt mmmm mmmm (ttt=Rt, mmmm mmmm=imm)
>
Oh right, I read 'pc' instead of 'sp'.
> So Rt is in bits 8..10 which != 0..3 which is all you handle above. I
> can't see any reason why you wouldn't need to handle this case, it is
> certainly a valid instruction.
>
> I think it would be safest to explicitly check for known opcode patterns
> and handle those while logging any which we don't recognise. This might
> be doable with a lookup table but it may be too sparse. If we were doing
> a more full featured instruction decoder then it might be worth it, not
> sure about this very specific case.
As discussed with Ian, I will create a function decode_instruction. It
will decode and fill the HSR.
--
Julien
prev parent reply other threads:[~2013-07-31 10:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-25 15:21 [PATCH v2 0/3] Add support for THUMB guest kernel Julien Grall
2013-07-25 15:21 ` [PATCH v2 1/3] xen/arm: Don't emulate the MMIO access if the instruction syndrome is invalid Julien Grall
2013-07-29 15:57 ` Ian Campbell
2013-07-25 15:21 ` [PATCH v2 2/3] xen/arm: Allow secondary cpus to start in THUMB Julien Grall
2013-07-29 15:57 ` Ian Campbell
2013-07-25 15:21 ` [PATCH v2 3/3] xen/arm: errata 766422: decode thumb store during data abort Julien Grall
2013-07-29 15:15 ` Ian Campbell
2013-07-30 17:37 ` Julien Grall
2013-07-31 8:47 ` Ian Campbell
2013-07-31 10:19 ` Julien Grall [this message]
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=51F8E4C9.5070000@linaro.org \
--to=julien.grall@linaro.org \
--cc=Ian.Campbell@citrix.com \
--cc=Stefano.Stabellini@eu.citrix.com \
--cc=patches@linaro.org \
--cc=tim@xen.org \
--cc=xen-devel@lists.xen.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).