All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [Bug 1806824] [NEW] SIE-200 (TrustZone) MPC: BLK_MAX returns an incorrect value
@ 2018-12-05  6:43 YVT
  2018-12-05 11:05 ` [Qemu-devel] [Bug 1806824] " Alex Bennée
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: YVT @ 2018-12-05  6:43 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

Version: 
$ qemu-system-arm --version
QEMU emulator version 3.0.92 (v3.1.0-rc2-31-gd522fba244)

Arm SIE-200 Technical Reference Manual describes that BLK_MAX indicates
the maximum value of "block based index register" (BLK_IDX). For
example, the value 1 would indicate that BLK_IDX can be 0 or 1.
According to my experiments, the AN505 FPGA image apparently follows
this behavior.

In the current implementation of QEMU, it appears to indicate the number
of possible values for BLK_IDX, i.e., one plus the value it's supposed
to return.

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1806824

Title:
  SIE-200 (TrustZone) MPC: BLK_MAX returns an incorrect value

Status in QEMU:
  New

Bug description:
  Version: 
  $ qemu-system-arm --version
  QEMU emulator version 3.0.92 (v3.1.0-rc2-31-gd522fba244)

  Arm SIE-200 Technical Reference Manual describes that BLK_MAX
  indicates the maximum value of "block based index register" (BLK_IDX).
  For example, the value 1 would indicate that BLK_IDX can be 0 or 1.
  According to my experiments, the AN505 FPGA image apparently follows
  this behavior.

  In the current implementation of QEMU, it appears to indicate the
  number of possible values for BLK_IDX, i.e., one plus the value it's
  supposed to return.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1806824/+subscriptions

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [Bug 1806824] Re: SIE-200 (TrustZone) MPC: BLK_MAX returns an incorrect value
  2018-12-05  6:43 [Qemu-devel] [Bug 1806824] [NEW] SIE-200 (TrustZone) MPC: BLK_MAX returns an incorrect value YVT
@ 2018-12-05 11:05 ` Alex Bennée
  2018-12-13 16:08 ` YVT
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Alex Bennée @ 2018-12-05 11:05 UTC (permalink / raw)
  To: qemu-devel

As per https://www.qemu.org/contribute/report-a-bug/ could you please
provide:

  - the command line you are using
  - details about the guest you are running (or test case)


** Tags added: arm

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1806824

Title:
  SIE-200 (TrustZone) MPC: BLK_MAX returns an incorrect value

Status in QEMU:
  New

Bug description:
  Version: 
  $ qemu-system-arm --version
  QEMU emulator version 3.0.92 (v3.1.0-rc2-31-gd522fba244)

  Arm SIE-200 Technical Reference Manual describes that BLK_MAX
  indicates the maximum value of "block based index register" (BLK_IDX).
  For example, the value 1 would indicate that BLK_IDX can be 0 or 1.
  According to my experiments, the AN505 FPGA image apparently follows
  this behavior.

  In the current implementation of QEMU, it appears to indicate the
  number of possible values for BLK_IDX, i.e., one plus the value it's
  supposed to return.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1806824/+subscriptions

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [Bug 1806824] Re: SIE-200 (TrustZone) MPC: BLK_MAX returns an incorrect value
  2018-12-05  6:43 [Qemu-devel] [Bug 1806824] [NEW] SIE-200 (TrustZone) MPC: BLK_MAX returns an incorrect value YVT
  2018-12-05 11:05 ` [Qemu-devel] [Bug 1806824] " Alex Bennée
@ 2018-12-13 16:08 ` YVT
  2018-12-13 18:35 ` Peter Maydell
  2019-04-24  5:33 ` Thomas Huth
  3 siblings, 0 replies; 8+ messages in thread
From: YVT @ 2018-12-13 16:08 UTC (permalink / raw)
  To: qemu-devel

Command line:

    $ qemu-system-arm -kernel Image.elf -machine mps2-an505 -nographic
-d guest_errors -s -semihosting

The guest I'm running is an unreleased program for a research purpose.
I'm not aware of any publicly-known application or operating system that
make use of the hardware register concerned by this issue.

The attached program is an artificial example that reproduces the issue.
The program writes a random value to every LUT block within [0,
BLK_MAX]. After that, it examines the content of every LUT block to see
if it has the intended value or not.

With the AN505 FPGA image, you get the following output (via UART1,
115200 baud):

    ==== The test program has started ====
     LUT[0x00000000] = 07345a3f
     LUT[0x00000001] = 020c7cc6
    ==== The test program has completed ====

With QEMU, you get the following output because the LUT index 0x00000040 doesn't actually exist and is wrapped around to the first block:
    
    $ make qemu
    qemu-system-arm -kernel Image.elf -machine mps2-an505 -nographic -d guest_errors -s -semihosting
    ==== The test program has started ====
     LUT[0x00000000] = 07345a3f
     LUT[0x00000001] = 020c7cc6
     ...
     LUT[0x0000003f] = ce3b657b
     LUT[0x00000040] = f01ed211
    [ERROR] Verify failed at 0x00000000 - expected 0x07345a3f, got 0xf01ed211.
    ==== The test program has completed ====

** Attachment added: "An artificial example that reproduces the issue"
   https://bugs.launchpad.net/qemu/+bug/1806824/+attachment/5222023/+files/qemu-1806824-test.tar.gz

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1806824

Title:
  SIE-200 (TrustZone) MPC: BLK_MAX returns an incorrect value

Status in QEMU:
  New

Bug description:
  Version: 
  $ qemu-system-arm --version
  QEMU emulator version 3.0.92 (v3.1.0-rc2-31-gd522fba244)

  Arm SIE-200 Technical Reference Manual describes that BLK_MAX
  indicates the maximum value of "block based index register" (BLK_IDX).
  For example, the value 1 would indicate that BLK_IDX can be 0 or 1.
  According to my experiments, the AN505 FPGA image apparently follows
  this behavior.

  In the current implementation of QEMU, it appears to indicate the
  number of possible values for BLK_IDX, i.e., one plus the value it's
  supposed to return.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1806824/+subscriptions

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [Bug 1806824] Re: SIE-200 (TrustZone) MPC: BLK_MAX returns an incorrect value
  2018-12-05  6:43 [Qemu-devel] [Bug 1806824] [NEW] SIE-200 (TrustZone) MPC: BLK_MAX returns an incorrect value YVT
  2018-12-05 11:05 ` [Qemu-devel] [Bug 1806824] " Alex Bennée
  2018-12-13 16:08 ` YVT
@ 2018-12-13 18:35 ` Peter Maydell
  2018-12-14 13:53   ` Alex Bennée
  2019-04-24  5:33 ` Thomas Huth
  3 siblings, 1 reply; 8+ messages in thread
From: Peter Maydell @ 2018-12-13 18:35 UTC (permalink / raw)
  To: qemu-devel

Thanks for the bug report and the test program. The fix seems straightforward -- just adjust what we return for the register value. I've sent a patch:
http://patchwork.ozlabs.org/patch/1013034/


** Changed in: qemu
       Status: New => In Progress

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1806824

Title:
  SIE-200 (TrustZone) MPC: BLK_MAX returns an incorrect value

Status in QEMU:
  In Progress

Bug description:
  Version: 
  $ qemu-system-arm --version
  QEMU emulator version 3.0.92 (v3.1.0-rc2-31-gd522fba244)

  Arm SIE-200 Technical Reference Manual describes that BLK_MAX
  indicates the maximum value of "block based index register" (BLK_IDX).
  For example, the value 1 would indicate that BLK_IDX can be 0 or 1.
  According to my experiments, the AN505 FPGA image apparently follows
  this behavior.

  In the current implementation of QEMU, it appears to indicate the
  number of possible values for BLK_IDX, i.e., one plus the value it's
  supposed to return.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1806824/+subscriptions

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [Bug 1806824] Re: SIE-200 (TrustZone) MPC: BLK_MAX returns an incorrect value
  2018-12-13 18:35 ` Peter Maydell
@ 2018-12-14 13:53   ` Alex Bennée
  2018-12-14 14:23     ` Peter Maydell
  0 siblings, 1 reply; 8+ messages in thread
From: Alex Bennée @ 2018-12-14 13:53 UTC (permalink / raw)
  To: Bug 1806824; +Cc: qemu-devel


Peter Maydell <peter.maydell@linaro.org> writes:

> Thanks for the bug report and the test program. The fix seems straightforward -- just adjust what we return for the register value. I've sent a patch:
> http://patchwork.ozlabs.org/patch/1013034/

I know you had a bunch of M-profile test cases. Once we get tcg system
tests enabled would it be worth porting some of those into the QEMU src
tree?

There is already one other ARM system test pending for the microbit
tests.


>
>
> ** Changed in: qemu
>        Status: New => In Progress


--
Alex Bennée

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [Bug 1806824] Re: SIE-200 (TrustZone) MPC: BLK_MAX returns an incorrect value
  2018-12-14 13:53   ` Alex Bennée
@ 2018-12-14 14:23     ` Peter Maydell
  2018-12-14 14:58       ` Alex Bennée
  0 siblings, 1 reply; 8+ messages in thread
From: Peter Maydell @ 2018-12-14 14:23 UTC (permalink / raw)
  To: Alex Bennée; +Cc: 1806824, QEMU Developers

On Fri, 14 Dec 2018 at 13:56, Alex Bennée <alex.bennee@linaro.org> wrote:
>
>
> Peter Maydell <peter.maydell@linaro.org> writes:
>
> > Thanks for the bug report and the test program. The fix seems straightforward -- just adjust what we return for the register value. I've sent a patch:
> > http://patchwork.ozlabs.org/patch/1013034/
>
> I know you had a bunch of M-profile test cases. Once we get tcg system
> tests enabled would it be worth porting some of those into the QEMU src
> tree?

I don't have anything suitable -- unless we have
support for "system test of this guest kernel", in which case
we could add the arm trusted firmware boot/selftests.

thanks
-- PMM

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Qemu-devel] [Bug 1806824] Re: SIE-200 (TrustZone) MPC: BLK_MAX returns an incorrect value
  2018-12-14 14:23     ` Peter Maydell
@ 2018-12-14 14:58       ` Alex Bennée
  0 siblings, 0 replies; 8+ messages in thread
From: Alex Bennée @ 2018-12-14 14:58 UTC (permalink / raw)
  To: Peter Maydell; +Cc: 1806824, QEMU Developers


Peter Maydell <peter.maydell@linaro.org> writes:

> On Fri, 14 Dec 2018 at 13:56, Alex Bennée <alex.bennee@linaro.org> wrote:
>>
>>
>> Peter Maydell <peter.maydell@linaro.org> writes:
>>
>> > Thanks for the bug report and the test program. The fix seems straightforward -- just adjust what we return for the register value. I've sent a patch:
>> > http://patchwork.ozlabs.org/patch/1013034/
>>
>> I know you had a bunch of M-profile test cases. Once we get tcg system
>> tests enabled would it be worth porting some of those into the QEMU src
>> tree?
>
> I don't have anything suitable -- unless we have
> support for "system test of this guest kernel", in which case
> we could add the arm trusted firmware boot/selftests.

That's the next step, enabling the building of a known good test case
from an external tree and depositing the images in the right place so we
can use them as tests.

Things like LTP, kvm-unit-tests and various kernels.

>
> thanks
> -- PMM


--
Alex Bennée

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Qemu-devel] [Bug 1806824] Re: SIE-200 (TrustZone) MPC: BLK_MAX returns an incorrect value
  2018-12-05  6:43 [Qemu-devel] [Bug 1806824] [NEW] SIE-200 (TrustZone) MPC: BLK_MAX returns an incorrect value YVT
                   ` (2 preceding siblings ...)
  2018-12-13 18:35 ` Peter Maydell
@ 2019-04-24  5:33 ` Thomas Huth
  3 siblings, 0 replies; 8+ messages in thread
From: Thomas Huth @ 2019-04-24  5:33 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1806824

Title:
  SIE-200 (TrustZone) MPC: BLK_MAX returns an incorrect value

Status in QEMU:
  Fix Released

Bug description:
  Version: 
  $ qemu-system-arm --version
  QEMU emulator version 3.0.92 (v3.1.0-rc2-31-gd522fba244)

  Arm SIE-200 Technical Reference Manual describes that BLK_MAX
  indicates the maximum value of "block based index register" (BLK_IDX).
  For example, the value 1 would indicate that BLK_IDX can be 0 or 1.
  According to my experiments, the AN505 FPGA image apparently follows
  this behavior.

  In the current implementation of QEMU, it appears to indicate the
  number of possible values for BLK_IDX, i.e., one plus the value it's
  supposed to return.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1806824/+subscriptions

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-04-24  5:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-05  6:43 [Qemu-devel] [Bug 1806824] [NEW] SIE-200 (TrustZone) MPC: BLK_MAX returns an incorrect value YVT
2018-12-05 11:05 ` [Qemu-devel] [Bug 1806824] " Alex Bennée
2018-12-13 16:08 ` YVT
2018-12-13 18:35 ` Peter Maydell
2018-12-14 13:53   ` Alex Bennée
2018-12-14 14:23     ` Peter Maydell
2018-12-14 14:58       ` Alex Bennée
2019-04-24  5:33 ` Thomas Huth

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.