Hello Nathan,

On Wed, Mar 06, 2024 at 21:15:47 CET, [email protected] wrote:
> I was working on a project and noticed that the only kernel fault
> core allows a component to handle is a page fault. Is there a
> particular reason that core only allows page faults to be handled
> and not all kernel faults? If there is a problem with receiving all
> faults I would love to know the issue! thanks in advance for all
> your help. 

A feature to monitor CPU exceptions is existent but quite underused in
Genode beyond the GDB monitor AFAIK.

The CPU session [1] permits to set an exception handler (signal
capability) for one or all threads of the session [2] [3]. The
thread's state can then be requested from components possessing the
thread capability via 'Thread_state Cpu_thread::state()' and contains
the current exception in 'Cpu_state::trapno' for x86 [5],
'Cpu_state::cpu_exception' for arm v6/v7 [6], and seems to be missing
for arm v8.

To control how the thread that triggered the exception should proceed,
the handler may use `Cpu_thread::state(Thread_state const &)`.

[1] 
https://genode.org/documentation/genode-foundations/23.05/functional_specification/Session_interfaces_of_the_base_API.html#CPU_session_interface
[2] 
https://github.com/genodelabs/genode/blob/716579b12f9c3425cd8533cc61d1af32905d02a0/repos/base/include/cpu_thread/cpu_thread.h#L74-L81
[3] 
https://github.com/genodelabs/genode/blob/716579b12f9c3425cd8533cc61d1af32905d02a0/repos/base/include/cpu_session/cpu_session.h#L114-L123
[4] 
https://github.com/genodelabs/genode/blob/716579b12f9c3425cd8533cc61d1af32905d02a0/repos/base/include/cpu_thread/cpu_thread.h#L58-L64
[5] 
https://github.com/genodelabs/genode/blob/716579b12f9c3425cd8533cc61d1af32905d02a0/repos/base/include/spec/x86_64/cpu/cpu_state.h#L53
[6] 
https://github.com/genodelabs/genode/blob/716579b12f9c3425cd8533cc61d1af32905d02a0/repos/base/include/spec/arm/cpu/cpu_state.h#L70

Regards
-- 
Christian Helmuth
Genode Labs

https://www.genode-labs.com/ · https://genode.org/
https://floss.social/@genode · https://genodians.org/

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
_______________________________________________
users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Archived at 
https://lists.genode.org/mailman3/hyperkitty/list/[email protected]/message/65A32BJI2CYOOCS6M2H4PABYOYFHHZHP/

Reply via email to