linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: FP register corruption in Exynos 4210 (Cortex-A9)
Date: Wed, 8 Oct 2014 09:27:06 +0100	[thread overview]
Message-ID: <20141008082705.GC5182@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <5434F387.804@gmail.com>

On Wed, Oct 08, 2014 at 05:19:19AM -0300, Lanchon wrote:
>
> On 10/07/2014 07:44 PM, Russell King - ARM Linux wrote:
>> On Tue, Oct 07, 2014 at 07:35:14PM -0300, Lanchon wrote:
>>>> I hope this helps; I didn't answer your specific questions because it
>>>> seemed I would just end up repeating what I've said above.
>>>>
>>> actually no, answers to my very specific questions would help me
>>> understand this: if we had a close-source driver (ISR or kernel thread)
>>> that touched the FPU, how would the kernel react?
>> I already covered this.  It would corrupt the VFP state, thereby
>> corrupting the VFP state which userspace sees.
>>
>> Hence why I said:
>>
>> 	Which means that the kernel itself must /never/ make use of floating
>> 	point itself - if it does, it /will/ corrupt the user state in the way
>> 	               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>> 	you are seeing.
>> 	^^^^^^^^^^^^^^^
>>
>> How can I make that more clear?
>
> no, actually you did not answer my questions. you stated that the end  
> result would be corruption of user FP state, which i already know. i am  
> inquiring as to *how* the process of corruption comes about exactly, not  
> the end result.

It is really /very/ simple.

1. ISR changes VFP registers.
2. Userspace sees changed VFP registers.
3. Userspace state is corrupted.

For some reason, you think that there's more going on here than that.
There isn't.  The kernel sees the very same set of registers as
userspace sees.  Any changes which the kernel makes to those registers
will be visible to userspace.

Hence, using VFP instructions in the kernel will result in VFP registers
changing.  Userspace will then see the changed VFP registers.  The
userspace state will then be corrupted.

Simple.  Really.

-- 
FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up
according to speedtest.net.

  reply	other threads:[~2014-10-08  8:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-07 21:48 FP register corruption in Exynos 4210 (Cortex-A9) Lanchon
2014-10-07 22:15 ` Russell King - ARM Linux
2014-10-08  7:58   ` Lanchon
2014-10-08  8:19   ` Lanchon
2014-10-08  8:27     ` Russell King - ARM Linux [this message]
2014-10-08  8:35     ` Russell King - ARM Linux
2014-10-08  8:53       ` Ard Biesheuvel
2014-10-08  9:22         ` Ard Biesheuvel
2014-10-08  9:55           ` Russell King - ARM Linux
2014-10-08 10:32             ` Ard Biesheuvel
2014-10-09 22:36           ` Lanchon
2014-10-09 22:20         ` Lanchon
2014-10-09 22:32           ` Russell King - ARM Linux
2014-10-10  9:45             ` Arnd Bergmann
2014-10-10 10:01               ` Russell King - ARM Linux
2014-12-22 22:46                 ` Lanchon
2014-12-22 23:29                   ` Russell King - ARM Linux
2014-12-22 23:42                     ` Lanchon
2014-12-22 23:50                       ` Russell King - ARM Linux
2014-12-23  8:45                   ` Ard Biesheuvel

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=20141008082705.GC5182@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --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).