Discussion:
Genode Scheduling TrustZone Demo
Stefan Brenner
2016-07-15 14:43:09 UTC
Permalink
Hi,

we are using inject_irq() from Martin Stein to inject interrupts into
the normal world VM running Linux.

When measuring the time between issuing inject_irq() and actually
arriving at the ISR in normal world (using CPU performance counters in
CPU cycles granularity) we can see that this always requires at least 10
million cycles, which is 10ms at 1Ghz and exactly what is defined as
cpu_fill_ms in base-hw/src/core/include/kernel/configuration.h.

If we set cpu_fill_ms to 1, we can measure that it only requires 1
million cycles. Apparently it is not possible to set values below 1
(some assertion fails on compile).

Is there another option, probably a more elegant one, that allows the
acceleration of interrupt injection?

Best, Stefan.
--
M.Sc. Stefan Brenner
Institute of Operating Systems and Computer Networks
Distributed Systems Group
TU Braunschweig

www: https://www.ibr.cs.tu-bs.de/users/brenner
mail: ***@ibr.cs.tu-bs.de
xmpp: ***@jabber.ibr.cs.tu-bs.de
Stefan Kalkowski
2016-07-25 14:13:05 UTC
Permalink
Hi Stefan,
Post by Stefan Brenner
Hi,
we are using inject_irq() from Martin Stein to inject interrupts into
the normal world VM running Linux.
When measuring the time between issuing inject_irq() and actually
arriving at the ISR in normal world (using CPU performance counters in
CPU cycles granularity) we can see that this always requires at least 10
million cycles, which is 10ms at 1Ghz and exactly what is defined as
cpu_fill_ms in base-hw/src/core/include/kernel/configuration.h.
If we set cpu_fill_ms to 1, we can measure that it only requires 1
million cycles. Apparently it is not possible to set values below 1
(some assertion fails on compile).
Is there another option, probably a more elegant one, that allows the
acceleration of interrupt injection?
Normally, as long as no other component is runable and scheduled, you
should immediately receive the interrupt after calling inject_irq(...).
Are you sure that no other component is actively polling or otherwise
consuming a lot of cpu time?

Regards
Stefan
Post by Stefan Brenner
Best, Stefan.
--
Stefan Kalkowski
Genode Labs

https://github.com/skalk ยท http://genode.org/
Martin Stein
2016-08-01 13:31:30 UTC
Permalink
As an addition to Stefans answer:

Be aware that calling vm->inject_irq(X) does not explicitely request the
kernel to do an injection but merely marks the VM context as "Injection
of interrupt X requested". The caller of vm->inject_irq(X) must not
enter the kernel for that and so, the operation does not necessarily
trigger any scheduling. The injection is not executed before you enter
the kernel again and the VM is the next job in your schedule. Both
depends on your individual Genode setup.

Cheers,
Martin
Post by Stefan Kalkowski
Hi Stefan,
Post by Stefan Brenner
Hi,
we are using inject_irq() from Martin Stein to inject interrupts into
the normal world VM running Linux.
When measuring the time between issuing inject_irq() and actually
arriving at the ISR in normal world (using CPU performance counters in
CPU cycles granularity) we can see that this always requires at least 10
million cycles, which is 10ms at 1Ghz and exactly what is defined as
cpu_fill_ms in base-hw/src/core/include/kernel/configuration.h.
If we set cpu_fill_ms to 1, we can measure that it only requires 1
million cycles. Apparently it is not possible to set values below 1
(some assertion fails on compile).
Is there another option, probably a more elegant one, that allows the
acceleration of interrupt injection?
Normally, as long as no other component is runable and scheduled, you
should immediately receive the interrupt after calling inject_irq(...).
Are you sure that no other component is actively polling or otherwise
consuming a lot of cpu time?
Regards
Stefan
Post by Stefan Brenner
Best, Stefan.
------------------------------------------------------------------------------
Loading...