base: remove deprecated cancel_blocking() support

for threads.

Fixes #3806
This commit is contained in:
Alexander Boettcher 2020-07-06 16:09:44 +02:00 committed by Norman Feske
parent ce6f4dffe5
commit f3efbe50bb
49 changed files with 3 additions and 343 deletions

View File

@ -102,11 +102,6 @@ namespace Genode {
*/
void resume();
/**
* Cancel currently blocking operation
*/
void cancel_blocking();
/**
* This thread is about to be bound
*

View File

@ -142,17 +142,6 @@ Thread_state Platform_thread::state()
}
void Platform_thread::cancel_blocking()
{
l4_umword_t dummy;
l4_threadid_t invalid = L4_INVALID_ID;
l4_inter_task_ex_regs(_l4_thread_id, ~0UL, ~0UL,
&invalid, &invalid, &invalid,
&dummy, &dummy, &dummy, 0, l4_utcb_get());
}
Platform_thread::Platform_thread(size_t, const char *name, unsigned,
Affinity::Location, addr_t)
: _l4_thread_id(L4_INVALID_ID), _name(name) { }

View File

@ -49,14 +49,6 @@ void Thread::start()
}
void Thread::cancel_blocking()
{
/*
* Within core, we never need to unblock threads
*/
}
void Thread::_deinit_platform_thread()
{
/* destruct platform thread */

View File

@ -116,11 +116,6 @@ namespace Genode {
*/
void resume();
/**
* Cancel currently blocking operation
*/
void cancel_blocking();
/**
* This thread is about to be bound
*

View File

@ -219,12 +219,6 @@ Foc_thread_state Platform_thread::state()
}
void Platform_thread::cancel_blocking()
{
l4_irq_trigger(_irq.local.data()->kcap());
}
void Platform_thread::affinity(Affinity::Location location)
{
_location = location;

View File

@ -110,11 +110,3 @@ void Thread::start()
new (platform().core_mem_alloc()) Core_trace_source(Trace::sources(),
*this, pt);
}
void Thread::cancel_blocking()
{
/*
* Within core, we never need to unblock threads
*/
}

View File

@ -102,9 +102,3 @@ void Thread::start()
Cpu_thread_client cpu_thread(_thread_cap);
cpu_thread.start((addr_t)_thread_start, _stack->top());
}
void Thread::cancel_blocking()
{
Cpu_thread_client(_thread_cap).cancel_blocking();
}

View File

@ -59,8 +59,7 @@ namespace Kernel
constexpr Call_arg call_id_ack_irq() { return 120; }
constexpr Call_arg call_id_new_obj() { return 121; }
constexpr Call_arg call_id_delete_obj() { return 122; }
constexpr Call_arg call_id_cancel_thread_blocking() { return 123; }
constexpr Call_arg call_id_new_core_thread() { return 124; }
constexpr Call_arg call_id_new_core_thread() { return 123; }
/**
* Invalidate TLB entries for the `pd` in region `addr`, `sz`
@ -140,27 +139,6 @@ namespace Kernel
}
/**
* Cancel blocking of a thread if it is in a cancelable blocking state
*
* \param thread pointer to thread kernel object
*
* Does cleanly cancel a cancelable blocking thread state (IPC, signalling,
* stopped). The thread whose blocking was cancelled goes back to the
* 'active' thread state. If needed, it receives a syscall return value
* that reflects the cancellation. This syscall doesn't affect the pause
* state of the thread (see the 'pause_thread' syscall) which means that
* the thread may still be not allowed for scheduling. The syscall is
* core-restricted and may target any thread. It is actually used to
* limit the time a parent waits for a server when closing a session
* of one of its children.
*/
inline void cancel_thread_blocking(Thread & thread)
{
call(call_id_cancel_thread_blocking(), (Call_arg)&thread);
}
/**
* Set or unset the handler of an event that can be triggered by a thread
*

View File

@ -346,12 +346,6 @@ bool Thread::_restart()
}
void Thread::_call_cancel_thread_blocking()
{
reinterpret_cast<Thread*>(user_arg_1())->_cancel_blocking();
}
void Thread::_cancel_blocking()
{
switch (_state) {
@ -768,7 +762,6 @@ void Thread::_call()
case call_id_delete_thread(): _call_delete_thread(); return;
case call_id_start_thread(): _call_start_thread(); return;
case call_id_resume_thread(): _call_resume_thread(); return;
case call_id_cancel_thread_blocking(): _call_cancel_thread_blocking(); return;
case call_id_thread_pager(): _call_pager(); return;
case call_id_invalidate_tlb(): _call_invalidate_tlb(); return;
case call_id_new_pd():

View File

@ -220,7 +220,6 @@ class Kernel::Thread : private Kernel::Object, public Cpu_job, private Timeout
void _call_stop_thread();
void _call_pause_thread();
void _call_resume_thread();
void _call_cancel_thread_blocking();
void _call_restart_thread();
void _call_yield_thread();
void _call_delete_thread();

View File

@ -162,12 +162,6 @@ namespace Genode {
*/
void resume() { Kernel::resume_thread(*_kobj); }
/**
* Cancel currently blocking operation
*/
void cancel_blocking() {
Kernel::cancel_thread_blocking(*_kobj); }
/**
* Set CPU quota of the thread to 'quota'
*/

View File

@ -77,12 +77,6 @@ void Thread::start()
}
void Thread::cancel_blocking()
{
native_thread().platform_thread->cancel_blocking();
}
void Thread::_deinit_platform_thread()
{
/* destruct platform thread */

View File

@ -100,9 +100,3 @@ void Thread::start()
/* start thread with its initial IP and aligned SP */
Cpu_thread_client(_thread_cap).start((addr_t)_thread_start, _stack->top());
}
void Thread::cancel_blocking()
{
Cpu_thread_client(_thread_cap).cancel_blocking();
}

View File

@ -80,11 +80,6 @@ namespace Genode {
~Platform_thread();
/**
* Cancel currently blocking operation
*/
void cancel_blocking();
/**
* Pause this thread
*/

View File

@ -89,12 +89,6 @@ Platform_thread::~Platform_thread()
}
void Platform_thread::cancel_blocking()
{
lx_tgkill(_pid, _tid, LX_SIGUSR1);
}
void Platform_thread::pause()
{
warning(__func__, "not implemented");

View File

@ -69,6 +69,3 @@ void Thread::start()
native_thread().tid = lx_create_thread(Thread::_thread_start, stack_top(), this);
native_thread().pid = lx_getpid();
}
void Thread::cancel_blocking() { }

View File

@ -166,9 +166,3 @@ void Thread::start()
/* wait until the 'thread_start' function got entered */
startup_lock().block();
}
void Thread::cancel_blocking()
{
Cpu_thread_client(_thread_cap).cancel_blocking();
}

View File

@ -531,14 +531,6 @@ Thread::Thread(Env &env, Name const &name, size_t stack_size)
: Thread(env, name, stack_size, Location(), Weight(), env.cpu()) { }
void Thread::cancel_blocking()
{
/*
* XXX implement interaction with CPU session
*/
}
Thread::~Thread()
{
bool const needs_join = (pthread_cancel(native_thread().meta_data->pt) == 0);

View File

@ -51,9 +51,6 @@ struct Genode::Cpu_thread_client : Rpc_client<Cpu_thread>
void resume() override {
call<Rpc_resume>(); }
void cancel_blocking() override {
call<Rpc_cancel_blocking>(); }
Thread_state state() override {
return call<Rpc_get_state>(); }

View File

@ -256,12 +256,6 @@ namespace Genode {
return true;
}
/**
* Cancel blocking in a lock so that recall exception can take
* place.
*/
void client_cancel_blocking();
uint8_t client_recall(bool get_state_and_block);
void client_set_ec(addr_t ec) { _state.sel_client_ec = ec; }

View File

@ -123,11 +123,6 @@ namespace Genode {
*/
void resume();
/**
* Cancel currently blocking operation
*/
void cancel_blocking();
/**
* Override thread state with 's'
*

View File

@ -450,21 +450,6 @@ void Pager_object::wake_up()
}
void Pager_object::client_cancel_blocking()
{
uint8_t res = sm_ctrl(exc_pt_sel_client() + SM_SEL_EC, SEMAPHORE_UP);
if (res != NOVA_OK)
warning("canceling blocked client failed (thread sm)");
if (!_state.has_signal_sm())
return;
res = sm_ctrl(exc_pt_sel_client() + PT_SEL_STARTUP, SEMAPHORE_UP);
if (res != NOVA_OK)
warning("canceling blocked client failed (signal sm)");
}
uint8_t Pager_object::client_recall(bool get_state_and_block)
{
Mutex::Guard _state_lock_guard(_state_lock);

View File

@ -278,14 +278,6 @@ void Platform_thread::state(Thread_state s)
}
void Platform_thread::cancel_blocking()
{
if (!_pager) return;
_pager->client_cancel_blocking();
}
void Platform_thread::single_step(bool on)
{
if (!_pager) return;

View File

@ -150,12 +150,3 @@ void Thread::start()
new (platform().core_mem_alloc())
Core_trace_source(Trace::sources(), *this);
}
void Thread::cancel_blocking()
{
using namespace Nova;
if (sm_ctrl(native_thread().exc_pt_sel + SM_SEL_EC, SEMAPHORE_UP))
nova_die();
}

View File

@ -198,12 +198,3 @@ void Thread::start()
/* request creation of SC to let thread run*/
cpu_thread.resume();
}
void Thread::cancel_blocking()
{
using namespace Nova;
if (sm_ctrl(native_thread().exc_pt_sel + SM_SEL_EC, SEMAPHORE_UP))
nova_die();
}

View File

@ -99,11 +99,6 @@ namespace Genode {
*/
void resume();
/**
* Cancel currently blocking operation
*/
void cancel_blocking();
/**
* This thread is about to be bound
*

View File

@ -143,27 +143,6 @@ void Platform_thread::unbind()
}
void Platform_thread::cancel_blocking()
{
L4_Word_t dummy;
L4_ThreadId_t dummy_tid;
/*
* For more details, please refer to the corresponding implementation in
* the 'base-pistachio' repository.
*/
/* reset value for the thread's user-defined handle */
enum { USER_DEFINED_HANDLE_ZERO = 0 };
L4_ExchangeRegisters(_l4_thread_id,
L4_ExReg_Resume | L4_ExReg_AbortOperation | L4_ExReg_user,
0, 0, 0, USER_DEFINED_HANDLE_ZERO, L4_nilthread,
&dummy, &dummy, &dummy, &dummy, &dummy,
&dummy_tid);
}
unsigned long Platform_thread::pager_object_badge() const
{
return native_thread_id().raw;

View File

@ -46,14 +46,6 @@ void Thread::start()
}
void Thread::cancel_blocking()
{
/*
* Within core, we never need to unblock threads
*/
}
void Thread::_deinit_platform_thread()
{
/* destruct platform thread */

View File

@ -115,11 +115,6 @@ namespace Genode {
*/
void resume();
/**
* Cancel currently blocking operation
*/
void cancel_blocking();
/**
* This thread is about to be bound
*

View File

@ -189,40 +189,6 @@ Thread_state Platform_thread::state()
}
void Platform_thread::cancel_blocking()
{
L4_Word_t dummy;
L4_ThreadId_t dummy_tid;
/*
* XXX: This implementation is not safe because it only cancels
* a currently executed blocking operation but it has no
* effect when the thread is executing user code and going
* to block soon. To solve this issue, we would need signalling
* semantics, which means that we flag the thread to being
* canceled the next time it enters the kernel.
*/
/* control flags for 'L4_ExchangeRegisters' */
enum {
CANCEL_SEND = 1 << 2,
CANCEL_RECV = 1 << 1,
CANCEL_IPC = CANCEL_SEND | CANCEL_RECV,
USER_DEFINED_HANDLE = 1 << 6,
RESUME = 1 << 8,
};
/* reset value for the thread's user-defined handle */
enum { USER_DEFINED_HANDLE_ZERO = 0 };
L4_ExchangeRegisters(_l4_thread_id,
CANCEL_IPC | RESUME | USER_DEFINED_HANDLE,
0, 0, 0, USER_DEFINED_HANDLE_ZERO, L4_nilthread,
&dummy, &dummy, &dummy, &dummy, &dummy,
&dummy_tid);
}
Platform_thread::~Platform_thread()
{
/*

View File

@ -49,14 +49,6 @@ void Thread::start()
}
void Thread::cancel_blocking()
{
/*
* Within core, we never need to unblock threads
*/
}
void Thread::_deinit_platform_thread()
{
/* destruct platform thread */

View File

@ -119,11 +119,6 @@ class Genode::Platform_thread : public List<Platform_thread>::Element
*/
void resume();
/**
* Cancel currently blocking operation
*/
void cancel_blocking();
/**
* Override thread state with 's'
*

View File

@ -205,12 +205,6 @@ void Platform_thread::state(Thread_state)
}
void Platform_thread::cancel_blocking()
{
seL4_Signal(_info.lock_sel.value());
}
bool Platform_thread::install_mapping(Mapping const &mapping)
{
return _pd->install_mapping(mapping, name());

View File

@ -143,12 +143,6 @@ void Thread::start()
}
void Thread::cancel_blocking()
{
warning(__func__, " not implemented");
}
Native_utcb *Thread::utcb()
{
if (!_stack)

View File

@ -492,13 +492,6 @@ class Genode::Rpc_entrypoint : Thread, public Object_pool<Rpc_object_base>
* This method is solely needed on Linux.
*/
bool is_myself() const;
/**
* Required outside of core. E.g. launchpad needs it to forcefully kill
* a client which blocks on a session opening request where the service
* is not up yet.
*/
void cancel_blocking() { Thread::cancel_blocking(); }
};

View File

@ -330,14 +330,6 @@ class Genode::Thread
*/
Thread_capability cap() const { return _thread_cap; }
/**
* Cancel currently blocking operation
*
* \deprecated
* \noapi
*/
void cancel_blocking();
/**
* Return kernel-specific thread meta data
*/

View File

@ -37,9 +37,6 @@ struct Genode::Cpu_thread_client : Rpc_client<Cpu_thread>
void resume() override {
call<Rpc_resume>(); }
void cancel_blocking() override {
call<Rpc_cancel_blocking>(); }
Thread_state state() override {
return call<Rpc_get_state>(); }

View File

@ -55,14 +55,6 @@ struct Genode::Cpu_thread : Interface
*/
virtual void resume() = 0;
/**
* Cancel a currently blocking operation
*
* \deprecated
* \noapi
*/
virtual void cancel_blocking() = 0;
/**
* Get the current thread state
*
@ -144,7 +136,6 @@ struct Genode::Cpu_thread : Interface
GENODE_RPC(Rpc_start, void, start, addr_t, addr_t);
GENODE_RPC(Rpc_pause, void, pause);
GENODE_RPC(Rpc_resume, void, resume);
GENODE_RPC(Rpc_cancel_blocking, void, cancel_blocking);
GENODE_RPC_THROW(Rpc_get_state, Thread_state, state,
GENODE_TYPE_LIST(State_access_failed));
GENODE_RPC_THROW(Rpc_set_state, void, state,
@ -158,7 +149,7 @@ struct Genode::Cpu_thread : Interface
GENODE_RPC(Rpc_trace_policy, Dataspace_capability, trace_policy);
GENODE_RPC_INTERFACE(Rpc_utcb, Rpc_start, Rpc_pause, Rpc_resume,
Rpc_cancel_blocking, Rpc_set_state, Rpc_get_state,
Rpc_set_state, Rpc_get_state,
Rpc_exception_sigh, Rpc_single_step, Rpc_affinity,
Rpc_trace_control_index, Rpc_trace_buffer,
Rpc_trace_policy);

View File

@ -295,7 +295,6 @@ _ZN6Genode6SignalD2Ev T
_ZN6Genode6SignalaSERKS0_ T
_ZN6Genode6Thread10stack_sizeEm T
_ZN6Genode6Thread13native_threadEv T
_ZN6Genode6Thread15cancel_blockingEv T
_ZN6Genode6Thread18stack_virtual_sizeEv T
_ZN6Genode6Thread20free_secondary_stackEPv T
_ZN6Genode6Thread21alloc_secondary_stackEPKcm T

View File

@ -63,12 +63,6 @@ void Cpu_thread_component::resume()
}
void Cpu_thread_component::cancel_blocking()
{
_platform_thread.cancel_blocking();
}
Thread_state Cpu_thread_component::state()
{
return _platform_thread.state();

View File

@ -224,7 +224,6 @@ class Genode::Cpu_thread_component : public Rpc_object<Cpu_thread>,
void pause() override;
void resume() override;
void single_step(bool) override;
void cancel_blocking() override;
Thread_state state() override;
void state(Thread_state const &) override;
void exception_sigh(Signal_context_capability) override;

View File

@ -80,9 +80,3 @@ void Thread::start()
/* start execution at initial instruction pointer and stack pointer */
Cpu_thread_client(_thread_cap).start((addr_t)_thread_start, _stack->top());
}
void Thread::cancel_blocking()
{
Cpu_thread_client(_thread_cap).cancel_blocking();
}

View File

@ -32,9 +32,6 @@ _ZN11Cpu_sampler21Cpu_session_component19_cleanup_native_cpuEv T
_ZN6Genode13Avl_node_baseC2Ev U
_ZN6Genode14Rpc_entrypoint7_manageEPNS_15Rpc_object_baseE U
_ZN6Genode14Rpc_entrypoint9_dissolveEPNS_15Rpc_object_baseE U
_ZN6Genode15Cancelable_lock4lockEv U
_ZN6Genode15Cancelable_lock6unlockEv U
_ZN6Genode15Cancelable_lockC2ENS0_5StateE U
_ZN6Genode17Native_capability4_decEv U
_ZN6Genode17Native_capability4_incEv U
_ZN6Genode17Native_capabilityC1Ev U

View File

@ -166,12 +166,6 @@ void Cpu_sampler::Cpu_thread_component::single_step(bool enable)
}
void Cpu_sampler::Cpu_thread_component::cancel_blocking()
{
_parent_cpu_thread.cancel_blocking();
}
Thread_state Cpu_sampler::Cpu_thread_component::state()
{
return _parent_cpu_thread.state();

View File

@ -84,7 +84,6 @@ class Cpu_sampler::Cpu_thread_component : public Rpc_object<Cpu_thread>
void pause() override;
void resume() override;
void single_step(bool) override;
void cancel_blocking() override;
Thread_state state() override;
void state(Thread_state const &) override;
void exception_sigh(Signal_context_capability) override;

View File

@ -99,9 +99,6 @@ _ZN11Gdb_monitor21Cpu_session_component9thread_epEv U
_ZN6Genode13Avl_node_baseC2Ev U
_ZN6Genode14Rpc_entrypoint7_manageEPNS_15Rpc_object_baseE U
_ZN6Genode14Rpc_entrypoint9_dissolveEPNS_15Rpc_object_baseE U
_ZN6Genode15Cancelable_lock4lockEv U
_ZN6Genode15Cancelable_lock6unlockEv U
_ZN6Genode15Cancelable_lockC2ENS0_5StateE U
_ZN6Genode17Native_capability4_decEv U
_ZN6Genode17Native_capability4_incEv U
_ZN6Genode17Native_capabilityC1Ev U

View File

@ -292,8 +292,7 @@ if {![have_spec arm]} {
send "bt\n"
run_genode_until {\(gdb\)} 20 $gdb_id
if {![regexp {Genode::Cancelable_lock::lock} $output] ||
![regexp {Genode::Signal_receiver::block_for_signal} $output] ||
if {![regexp {Genode::Signal_receiver::block_for_signal} $output] ||
![regexp {Genode::Entrypoint::_wait_and_dispatch_one_io_signal} $output] ||
![regexp {Libc::Kernel::run} $output] } {

View File

@ -253,12 +253,6 @@ void Cpu_thread_component::single_step(bool enable)
}
void Cpu_thread_component::cancel_blocking()
{
_parent_cpu_thread.cancel_blocking();
}
void Cpu_thread_component::state(Thread_state const &state)
{
_parent_cpu_thread.state(state);

View File

@ -131,7 +131,6 @@ class Gdb_monitor::Cpu_thread_component : public Rpc_object<Cpu_thread>,
void pause() override;
void resume() override;
void single_step(bool) override;
void cancel_blocking() override;
Thread_state state() override;
void state(Thread_state const &) override;
void exception_sigh(Signal_context_capability) override;