Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hw: review signal semantics in comparison to the generic implementation #1781

Closed
chelmuth opened this issue Nov 18, 2015 · 3 comments
Closed

Comments

@chelmuth
Copy link
Member

With the changes in #1738 esp. e32c19b, we revealed a gap between the generic signal-implementation semantics and the interpretation in base-hw. The generic implementation ensures correct reference counting in Signal_context according to the life time of Signal objects to support safe destruction of contexts. In base-hw, the Signal life time also triggers Kernel::ack_signal() if the last reference to the linked context is dropped. Unfortunately, the generic Signal_context object stores the current pending signal as a member of type Signal::Data which is just a plain data object not connected to the reference counting. In base-hw, we now have the challenge to demarshal the occuring signal from the UTCB in Signal_receiver::block_for_signal(), store it in Signal_context::_curr_signal, and only acknowledge at the kernel after is was retrieved from _curr_signal in Signal_receiver::pending_signal().

From my investigation, the current issues with run/nic_loopback and run/blk_cache (at least) on staging originate from the described gap. @m-stein please add any information a missed from our offline discussion yesterday.

@chelmuth chelmuth added the bug label Nov 18, 2015
chelmuth added a commit to chelmuth/genode that referenced this issue Nov 18, 2015
@chelmuth chelmuth changed the title hw: review signal semantics in comparison the the generic implementation hw: review signal semantics in comparison to the generic implementation Nov 23, 2015
m-stein added a commit to m-stein/genode that referenced this issue Nov 24, 2015
* Use Kernel::kill_signal/ack_signal only for demarshalling from UTCB
* Use Signal_context::_destroy_lock and Kernel::kill_signal for destruction sync
* Use Signal_receiver::block_for_signal/pending_signal to implement
  Signal_receiver::wait_for_signal
* Move more stuff from specific signal/signal.cc to generic signal/common.cc
* Use Signal_receiver::_contexts to find pending signals
* Remove deprecated syscall Kernel::signal_pending

Ref genodelabs#1738
Ref genodelabs#1781
@m-stein m-stein added the fixed label Nov 24, 2015
@m-stein
Copy link
Member

m-stein commented Nov 24, 2015

There are some more open issues in the signal framework like the redundancy of Signal_context::_pending and Signal_context::_curr_signal (may both be raplaced by Signal_context::_num) or that Signal_context::submit/Signal_receiver::local_submit shouldn't be public but I would vote for opening separate issues for them.

m-stein added a commit that referenced this issue Nov 24, 2015
* Use Kernel::kill_signal/ack_signal only for demarshalling from UTCB
* Use Signal_context::_destroy_lock and Kernel::kill_signal for destruction sync
* Use Signal_receiver::block_for_signal/pending_signal to implement
  Signal_receiver::wait_for_signal
* Move more stuff from specific signal/signal.cc to generic signal/common.cc
* Use Signal_receiver::_contexts to find pending signals
* Remove deprecated syscall Kernel::signal_pending

Ref #1738
Ref #1781
@chelmuth
Copy link
Member Author

chelmuth commented Dec 1, 2015

@m-stein should we close this issue or remove the fixed label?

@m-stein
Copy link
Member

m-stein commented Dec 2, 2015

I forgot to add a "Fixed". Thanks.

@m-stein m-stein closed this as completed Dec 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants