All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Fedorov <serge.fdrv@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Sergey Sorokin <afarallax@yandex.ru>,
	qemu-arm <qemu-arm@nongnu.org>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-arm] [Qemu-devel] [PATCH] target-arm: Fix translation level on early translation faults
Date: Thu, 3 Mar 2016 19:37:17 +0300	[thread overview]
Message-ID: <56D8683D.1080004@gmail.com> (raw)
In-Reply-To: <CAFEAcA9Sp5282BfXFK8W9x8N0HJCbmxZBNL7Cxof7cYRsp8FgA@mail.gmail.com>

On 03.03.2016 17:55, Peter Maydell wrote:
> On 3 March 2016 at 14:48, Sergey Fedorov <serge.fdrv@gmail.com> wrote:
>> On 03.03.2016 16:49, Peter Maydell wrote:
>>> On 2 March 2016 at 19:19, Sergey Fedorov <serge.fdrv@gmail.com> wrote:
>>>> On 02.03.2016 21:04, Sergey Sorokin wrote:
>>>>> Qemu reports translation fault on 1st level instead of 0th level in case of
>>>>> AArch64 address translation if the translation table walk is disabled or
>>>>> the address is in the gap between the two regions.
>>>> It's probably not a very clear description in the commit message. IIUC,
>>>> level 0 fault is reported in case of any fault from TTBR in AArch64 state.
>>> Yes (though you mean "under an AArch64 translation regime"). Conversely, the
>>> only fault reported at level 0 under an AArch32 translation regime is
>>> the AddressSize fault (for bad addresses in TTBR0/1), which we don't
>>> currently implement.
>>>
>>> There's also a code path later in the function that does
>>>     level = va_size == 64 ? 0 : 1;
>>>
>>> but I'm not sure it's worth rearranging that code to avoid the
>>> duplication of "what level do we report this kind of fault at?".
>> Right, but actually I think this patch is going to fix the two "goto
>> do_fault" cases which can happen before this "level = va_size == 64 ? 0
>> : 1", namely the EDP check and the check for virtual address which is in
>> the gap between TTBR0 and TTBR1 regions.
> Yes, this patch is definitely fixing a bug; I'm just mentioning that other
> code path because it seems to be the result of previously fixing the bug
> for a particular special case...
>
>

Ah, right, I think I understand you :) So we'd better remove these lines:

            /* AArch64 reports these as level 0 faults.
             * AArch32 reports these as level 1 faults.
             */
            level = va_size == 64 ? 0 : 1;
            fault_type = translation_fault;

Kind regards,
Sergey

WARNING: multiple messages have this Message-ID (diff)
From: Sergey Fedorov <serge.fdrv@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Sergey Sorokin <afarallax@yandex.ru>,
	qemu-arm <qemu-arm@nongnu.org>,
	QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [Qemu-arm] [PATCH] target-arm: Fix translation level on early translation faults
Date: Thu, 3 Mar 2016 19:37:17 +0300	[thread overview]
Message-ID: <56D8683D.1080004@gmail.com> (raw)
In-Reply-To: <CAFEAcA9Sp5282BfXFK8W9x8N0HJCbmxZBNL7Cxof7cYRsp8FgA@mail.gmail.com>

On 03.03.2016 17:55, Peter Maydell wrote:
> On 3 March 2016 at 14:48, Sergey Fedorov <serge.fdrv@gmail.com> wrote:
>> On 03.03.2016 16:49, Peter Maydell wrote:
>>> On 2 March 2016 at 19:19, Sergey Fedorov <serge.fdrv@gmail.com> wrote:
>>>> On 02.03.2016 21:04, Sergey Sorokin wrote:
>>>>> Qemu reports translation fault on 1st level instead of 0th level in case of
>>>>> AArch64 address translation if the translation table walk is disabled or
>>>>> the address is in the gap between the two regions.
>>>> It's probably not a very clear description in the commit message. IIUC,
>>>> level 0 fault is reported in case of any fault from TTBR in AArch64 state.
>>> Yes (though you mean "under an AArch64 translation regime"). Conversely, the
>>> only fault reported at level 0 under an AArch32 translation regime is
>>> the AddressSize fault (for bad addresses in TTBR0/1), which we don't
>>> currently implement.
>>>
>>> There's also a code path later in the function that does
>>>     level = va_size == 64 ? 0 : 1;
>>>
>>> but I'm not sure it's worth rearranging that code to avoid the
>>> duplication of "what level do we report this kind of fault at?".
>> Right, but actually I think this patch is going to fix the two "goto
>> do_fault" cases which can happen before this "level = va_size == 64 ? 0
>> : 1", namely the EDP check and the check for virtual address which is in
>> the gap between TTBR0 and TTBR1 regions.
> Yes, this patch is definitely fixing a bug; I'm just mentioning that other
> code path because it seems to be the result of previously fixing the bug
> for a particular special case...
>
>

Ah, right, I think I understand you :) So we'd better remove these lines:

            /* AArch64 reports these as level 0 faults.
             * AArch32 reports these as level 1 faults.
             */
            level = va_size == 64 ? 0 : 1;
            fault_type = translation_fault;

Kind regards,
Sergey

  reply	other threads:[~2016-03-03 16:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02 18:04 [Qemu-devel] [PATCH] target-arm: Fix translation level on early translation faults Sergey Sorokin
2016-03-02 19:19 ` [Qemu-arm] " Sergey Fedorov
2016-03-02 19:19   ` Sergey Fedorov
2016-03-03 13:49   ` [Qemu-arm] " Peter Maydell
2016-03-03 13:49     ` Peter Maydell
2016-03-03 14:48     ` [Qemu-arm] " Sergey Fedorov
2016-03-03 14:48       ` Sergey Fedorov
2016-03-03 14:55       ` [Qemu-arm] " Peter Maydell
2016-03-03 14:55         ` [Qemu-devel] [Qemu-arm] " Peter Maydell
2016-03-03 16:37         ` Sergey Fedorov [this message]
2016-03-03 16:37           ` Sergey Fedorov
2016-03-03 16:54           ` [Qemu-arm] [Qemu-devel] " Peter Maydell
2016-03-03 16:54             ` [Qemu-devel] [Qemu-arm] " Peter Maydell
2016-03-04 15:03             ` [Qemu-arm] [Qemu-devel] " Sergey Sorokin
2016-03-04 15:03               ` [Qemu-devel] [Qemu-arm] " Sergey Sorokin
2016-03-04 15:18               ` [Qemu-arm] [Qemu-devel] " Peter Maydell
2016-03-04 15:18                 ` [Qemu-devel] [Qemu-arm] " Peter Maydell
2016-03-02 21:36 ` [Qemu-arm] [Qemu-devel] " Sergey Fedorov
2016-03-02 21:36   ` Sergey Fedorov

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=56D8683D.1080004@gmail.com \
    --to=serge.fdrv@gmail.com \
    --cc=afarallax@yandex.ru \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.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 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.