Merge branch 'genodelabs:master' into master

This commit is contained in:
Michael Müller
2025-01-21 15:00:29 +01:00
committed by GitHub
568 changed files with 3244 additions and 5353 deletions

View File

@@ -1 +1 @@
2024-10-07 19deb3e25765c65bef7ec4b7dd7c657b0c63a49d
2024-12-10 408b474f632eefaaa19db35812a9aa94a48e6bdb

View File

@@ -1 +1 @@
2024-10-07 a906ce16359b301dda1031906fc6c9b3dd386d52
2024-12-10 4247239f4d3ce9a840be368ac9e054e8064c01c6

View File

@@ -1 +1 @@
2024-10-07 8f88c87b67888d3aedccf628ceb214ec7305b2eb
2024-12-10 39609d3553422b8c7c6acff2db845c67c5f8912b

View File

@@ -1 +1 @@
2024-10-07 f2d0f8e9e79f3c4a11498d1df055488910d87279
2024-12-10 7867db59531dc9086e76b74800125ee61ccc310e

View File

@@ -1 +1 @@
2024-10-07 af4a1a784fac28f321443a0659914f0aeb92e466
2024-12-10 3fc7c1b2cae2b9af835c97bf384b10411ec9c511

View File

@@ -1 +1 @@
2024-10-07 184b4030fb20c203ab996d46ddc029a1d6856f9c
2024-12-10 68ee5bc5640e1d32c33f46072256d5b1c71bef9b

View File

@@ -23,7 +23,8 @@
void Core::platform_add_local_services(Rpc_entrypoint &ep,
Sliced_heap &heap,
Registry<Service> &services,
Trace::Source_registry &trace_sources)
Trace::Source_registry &trace_sources,
Ram_allocator &)
{
static Vm_root vm_root(ep, heap, core_env().ram_allocator(),
core_env().local_rm(), trace_sources);

View File

@@ -1 +1 @@
2024-10-29 4bbe6a0fc64e242b3df0a4f888c69592a35c2c59
2024-12-10 ca4eabba0cf0313545712015ae6e9ebb4d968b2a

View File

@@ -1 +1 @@
2024-10-29 eb59e89aad9feb09d6a868c30f68e6295439f06a
2024-12-10 dad50ef2ab70aa5a7bd316ad116bfb1d59c5df5c

View File

@@ -1 +1 @@
2024-10-29 499d391798850ba3b784250d3b8a63bbb0ac27ab
2024-12-10 58d8cb90d04a52f53a9797d964568dc0d1e7c45d

View File

@@ -1 +1 @@
2024-10-29 bc12b6bd4fc27e351d863c79752fcdc1173797ce
2024-12-10 1a5d21d207bb12797d285e1c3173cdaec7559afe

View File

@@ -82,4 +82,11 @@ Core_region_map::attach(Dataspace_capability ds_cap, Attr const &attr)
}
void Core_region_map::detach(addr_t) { }
void Core_region_map::detach(addr_t core_local_addr)
{
size_t size = platform_specific().region_alloc_size_at((void *)core_local_addr);
unmap_local(core_local_addr, size >> get_page_size_log2());
platform().region_alloc().free((void *)core_local_addr);
}

View File

@@ -158,10 +158,8 @@ class Kernel::Signal_context
*
* \param r receiver that the context shall be assigned to
* \param imprint userland identification of the context
*
* \throw Assign_to_receiver_failed
*/
Signal_context(Signal_receiver & r, addr_t const imprint);
Signal_context(Signal_receiver &, addr_t const imprint);
/**
* Submit the signal

View File

@@ -33,45 +33,42 @@ extern "C" void _core_start(void);
using namespace Kernel;
void Thread::_ipc_alloc_recv_caps(unsigned cap_count)
Thread::Ipc_alloc_result Thread::_ipc_alloc_recv_caps(unsigned cap_count)
{
using Allocator = Genode::Allocator;
using Result = Ipc_alloc_result;
Allocator &slab = pd().platform_pd().capability_slab();
for (unsigned i = 0; i < cap_count; i++) {
if (_obj_id_ref_ptr[i] != nullptr)
continue;
slab.try_alloc(sizeof(Object_identity_reference)).with_result(
Result const result =
slab.try_alloc(sizeof(Object_identity_reference)).convert<Result>(
[&] (void *ptr) {
_obj_id_ref_ptr[i] = ptr; },
_obj_id_ref_ptr[i] = ptr;
return Result::OK; },
[&] (Allocator::Alloc_error e) {
switch (e) {
case Allocator::Alloc_error::DENIED:
/*
* Slab is exhausted, reflect condition to the client.
*/
throw Genode::Out_of_ram();
case Allocator::Alloc_error::OUT_OF_CAPS:
case Allocator::Alloc_error::OUT_OF_RAM:
/*
* These conditions cannot happen because the slab
* does not try to grow automatically. It is
* explicitely expanded by the client as response to
* the 'Out_of_ram' condition above.
*/
/*
* Conditions other than DENIED cannot happen because the slab
* does not try to grow automatically. It is explicitely
* expanded by the client as response to the EXHAUSTED return
* value.
*/
if (e != Allocator::Alloc_error::DENIED)
Genode::raw("unexpected recv_caps allocation failure");
}
return Result::EXHAUSTED;
}
);
if (result == Result::EXHAUSTED)
return result;
}
_ipc_rcv_caps = cap_count;
return Result::OK;
}
@@ -87,11 +84,20 @@ void Thread::_ipc_free_recv_caps()
}
void Thread::_ipc_init(Genode::Native_utcb &utcb, Thread &starter)
Thread::Ipc_alloc_result Thread::_ipc_init(Genode::Native_utcb &utcb, Thread &starter)
{
_utcb = &utcb;
_ipc_alloc_recv_caps((unsigned)(starter._utcb->cap_cnt()));
ipc_copy_msg(starter);
switch (_ipc_alloc_recv_caps((unsigned)(starter._utcb->cap_cnt()))) {
case Ipc_alloc_result::OK:
ipc_copy_msg(starter);
break;
case Ipc_alloc_result::EXHAUSTED:
return Ipc_alloc_result::EXHAUSTED;
}
return Ipc_alloc_result::OK;
}
@@ -330,7 +336,13 @@ void Thread::_call_start_thread()
/* join protection domain */
thread._pd = (Pd *) user_arg_3();
thread._ipc_init(*(Native_utcb *)user_arg_4(), *this);
switch (thread._ipc_init(*(Native_utcb *)user_arg_4(), *this)) {
case Ipc_alloc_result::OK:
break;
case Ipc_alloc_result::EXHAUSTED:
user_arg_0(-2);
return;
}
/*
* Sanity check core threads!
@@ -482,7 +494,14 @@ void Thread::_call_delete_pd()
void Thread::_call_await_request_msg()
{
if (_ipc_node.ready_to_wait()) {
_ipc_alloc_recv_caps((unsigned)user_arg_1());
switch (_ipc_alloc_recv_caps((unsigned)user_arg_1())) {
case Ipc_alloc_result::OK:
break;
case Ipc_alloc_result::EXHAUSTED:
user_arg_0(-2);
return;
}
_ipc_node.wait();
if (_ipc_node.waiting()) {
_become_inactive(AWAITS_IPC);
@@ -545,8 +564,14 @@ void Thread::_call_send_request_msg()
if (!_ipc_node.ready_to_send()) {
Genode::raw("IPC send request: bad state");
} else {
_ipc_alloc_recv_caps((unsigned)user_arg_2());
_ipc_capid = oir ? oir->capid() : cap_id_invalid();
switch (_ipc_alloc_recv_caps((unsigned)user_arg_2())) {
case Ipc_alloc_result::OK:
break;
case Ipc_alloc_result::EXHAUSTED:
user_arg_0(-2);
return;
}
_ipc_capid = oir ? oir->capid() : cap_id_invalid();
_ipc_node.send(dst->_ipc_node, help);
}
@@ -822,8 +847,6 @@ void Thread::_call_single_step() {
void Thread::_call()
{
try {
/* switch over unrestricted kernel calls */
unsigned const call_id = (unsigned)user_arg_0();
switch (call_id) {
@@ -907,25 +930,36 @@ void Thread::_call()
_die();
return;
}
} catch (Genode::Allocator::Out_of_memory &e) { user_arg_0(-2); }
}
void Thread::_mmu_exception()
{
using namespace Genode;
using Genode::log;
_become_inactive(AWAITS_RESTART);
_exception_state = MMU_FAULT;
Cpu::mmu_fault(*regs, _fault);
_fault.ip = regs->ip;
if (_fault.type == Thread_fault::UNKNOWN) {
Genode::raw(*this, " raised unhandled MMU fault ", _fault);
Genode::warning(*this, " raised unhandled MMU fault ", _fault);
return;
}
if (_type != USER)
Genode::raw(*this, " raised a fault, which should never happen ",
_fault);
if (_type != USER) {
error(*this, " raised a fault, which should never happen ",
_fault);
log("Register dump: ", *regs);
log("Backtrace:");
Const_byte_range_ptr const stack {
(char const*)Hw::Mm::core_stack_area().base,
Hw::Mm::core_stack_area().size };
regs->for_each_return_address(stack, [&] (void **p) {
log(*p); });
}
if (_pager && _pager->can_submit(1)) {
_pager->submit(1);

View File

@@ -322,9 +322,13 @@ class Kernel::Thread : private Kernel::Object, public Cpu_job, private Timeout
kobj.destruct();
}
void _ipc_alloc_recv_caps(unsigned rcv_cap_count);
enum Ipc_alloc_result { OK, EXHAUSTED };
[[nodiscard]] Ipc_alloc_result _ipc_alloc_recv_caps(unsigned rcv_cap_count);
void _ipc_free_recv_caps();
void _ipc_init(Genode::Native_utcb &utcb, Thread &callee);
[[nodiscard]] Ipc_alloc_result _ipc_init(Genode::Native_utcb &utcb, Thread &callee);
public:

View File

@@ -119,6 +119,18 @@ class Core::Platform : public Platform_generic
static addr_t core_page_table();
static Hw::Page_table::Allocator & core_page_table_allocator();
/**
* Determine size of a core local mapping required for a
* Core_region_map::detach().
*/
size_t region_alloc_size_at(void * addr)
{
using Size_at_error = Allocator_avl::Size_at_error;
return (_core_mem_alloc.virt_alloc())()->size_at(addr).convert<size_t>(
[ ] (size_t s) { return s; },
[ ] (Size_at_error) { return 0U; });
}
/********************************
** Platform_generic interface **

View File

@@ -60,6 +60,13 @@ bool Hw::Address_space::insert_translation(addr_t virt, addr_t phys,
_tt.insert_translation(virt, phys, size, flags, _tt_alloc);
return true;
} catch(Hw::Out_of_tables &) {
/* core/kernel's page-tables should never get flushed */
if (_tt_phys == Platform::core_page_table()) {
error("core's page-table allocator is empty!");
return false;
}
flush(platform().vm_start(), platform().vm_size());
}
}

View File

@@ -30,6 +30,79 @@
using namespace Core;
Ram_dataspace_capability Platform_thread::Utcb::_allocate_utcb(bool core_thread)
{
Ram_dataspace_capability ds;
if (core_thread)
return ds;
try {
ds = core_env().pd_session()->alloc(sizeof(Native_utcb), CACHED);
} catch (...) {
error("failed to allocate UTCB");
throw Out_of_ram();
}
return ds;
}
addr_t Platform_thread::Utcb::_core_local_address(addr_t utcb_addr,
bool core_thread)
{
if (core_thread)
return utcb_addr;
addr_t ret = 0;
Region_map::Attr attr { };
attr.writeable = true;
core_env().rm_session()->attach(_ds, attr).with_result(
[&] (Region_map::Range range) {
ret = range.start; },
[&] (Region_map::Attach_error) {
error("failed to attach UTCB of new thread within core"); });
return ret;
}
Platform_thread::Utcb::Utcb(addr_t pd_addr, bool core_thread)
:
_ds(_allocate_utcb(core_thread)),
_core_addr(_core_local_address(pd_addr, core_thread))
{
/*
* All non-core threads use the typical dataspace/rm_session
* mechanisms to allocate and attach its UTCB.
* But for the very first core threads, we need to use plain
* physical and virtual memory allocators to create/attach its
* UTCBs. Therefore, we've to allocate and map those here.
*/
if (core_thread) {
platform().ram_alloc().try_alloc(sizeof(Native_utcb)).with_result(
[&] (void *utcb_phys) {
map_local((addr_t)utcb_phys, _core_addr,
sizeof(Native_utcb) / get_page_size());
},
[&] (Range_allocator::Alloc_error) {
error("failed to allocate UTCB for core/kernel thread!");
throw Out_of_ram();
}
);
}
}
Platform_thread::Utcb::~Utcb()
{
/* detach UTCB from core/kernel */
core_env().rm_session()->detach((addr_t)_core_addr);
}
void Platform_thread::_init() { }
@@ -37,21 +110,6 @@ Weak_ptr<Address_space>& Platform_thread::address_space() {
return _address_space; }
Platform_thread::~Platform_thread()
{
/* detach UTCB of main threads */
if (_main_thread) {
Locked_ptr<Address_space> locked_ptr(_address_space);
if (locked_ptr.valid())
locked_ptr->flush((addr_t)_utcb_pd_addr, sizeof(Native_utcb),
Address_space::Core_local_addr{0});
}
/* free UTCB */
core_env().pd_session()->free(_utcb);
}
void Platform_thread::quota(size_t const quota)
{
_quota = (unsigned)quota;
@@ -64,26 +122,10 @@ Platform_thread::Platform_thread(Label const &label, Native_utcb &utcb)
_label(label),
_pd(_kernel_main_get_core_platform_pd()),
_pager(nullptr),
_utcb_core_addr(&utcb),
_utcb_pd_addr(&utcb),
_utcb((addr_t)&utcb, true),
_main_thread(false),
_location(Affinity::Location()),
_kobj(_kobj.CALLED_FROM_CORE, _label.string())
{
/* create UTCB for a core thread */
platform().ram_alloc().try_alloc(sizeof(Native_utcb)).with_result(
[&] (void *utcb_phys) {
map_local((addr_t)utcb_phys, (addr_t)_utcb_core_addr,
sizeof(Native_utcb) / get_page_size());
},
[&] (Range_allocator::Alloc_error) {
error("failed to allocate UTCB");
/* XXX distinguish error conditions */
throw Out_of_ram();
}
);
}
_kobj(_kobj.CALLED_FROM_CORE, _label.string()) { }
Platform_thread::Platform_thread(Platform_pd &pd,
@@ -96,33 +138,39 @@ Platform_thread::Platform_thread(Platform_pd &pd,
_label(label),
_pd(pd),
_pager(nullptr),
_utcb_pd_addr((Native_utcb *)utcb),
_utcb(utcb, false),
_priority(_scale_priority(virt_prio)),
_quota((unsigned)quota),
_main_thread(!pd.has_any_thread),
_location(location),
_kobj(_kobj.CALLED_FROM_CORE, _priority, _quota, _label.string())
{
try {
_utcb = core_env().pd_session()->alloc(sizeof(Native_utcb), CACHED);
} catch (...) {
error("failed to allocate UTCB");
throw Out_of_ram();
}
Region_map::Attr attr { };
attr.writeable = true;
core_env().rm_session()->attach(_utcb, attr).with_result(
[&] (Region_map::Range range) {
_utcb_core_addr = (Native_utcb *)range.start; },
[&] (Region_map::Attach_error) {
error("failed to attach UTCB of new thread within core"); });
_address_space = pd.weak_ptr();
pd.has_any_thread = true;
}
Platform_thread::~Platform_thread()
{
/* core/kernel threads have no dataspace, but plain memory as UTCB */
if (!_utcb._ds.valid()) {
error("UTCB of core/kernel thread gets destructed!");
return;
}
/* detach UTCB of main threads */
if (_main_thread) {
Locked_ptr<Address_space> locked_ptr(_address_space);
if (locked_ptr.valid())
locked_ptr->flush(user_utcb_main_thread(), sizeof(Native_utcb),
Address_space::Core_local_addr{0});
}
/* free UTCB */
core_env().pd_session()->free(_utcb._ds);
}
void Platform_thread::affinity(Affinity::Location const &)
{
/* yet no migration support, don't claim wrong location, e.g. for tracing */
@@ -147,16 +195,15 @@ void Platform_thread::start(void * const ip, void * const sp)
error("invalid RM client");
return -1;
};
_utcb_pd_addr = (Native_utcb *)user_utcb_main_thread();
Hw::Address_space * as = static_cast<Hw::Address_space*>(&*locked_ptr);
if (!as->insert_translation((addr_t)_utcb_pd_addr, dsc->phys_addr(),
if (!as->insert_translation(user_utcb_main_thread(), dsc->phys_addr(),
sizeof(Native_utcb), Hw::PAGE_FLAGS_UTCB)) {
error("failed to attach UTCB");
return -1;
}
return 0;
};
if (core_env().entrypoint().apply(_utcb, lambda))
if (core_env().entrypoint().apply(_utcb._ds, lambda))
return;
}
@@ -174,9 +221,9 @@ void Platform_thread::start(void * const ip, void * const sp)
utcb.cap_add(Capability_space::capid(_kobj.cap()));
if (_main_thread) {
utcb.cap_add(Capability_space::capid(_pd.parent()));
utcb.cap_add(Capability_space::capid(_utcb));
utcb.cap_add(Capability_space::capid(_utcb._ds));
}
Kernel::start_thread(*_kobj, cpu, _pd.kernel_pd(), *_utcb_core_addr);
Kernel::start_thread(*_kobj, cpu, _pd.kernel_pd(), *(Native_utcb*)_utcb._core_addr);
}

View File

@@ -55,13 +55,24 @@ class Core::Platform_thread : Noncopyable
using Label = String<32>;
struct Utcb
{
Ram_dataspace_capability _ds { }; /* UTCB ds of non-core threads */
addr_t const _core_addr; /* UTCB address within core/kernel */
Ram_dataspace_capability _allocate_utcb(bool core_thread);
addr_t _core_local_address(addr_t utcb_addr, bool core_thread);
Utcb(addr_t pd_addr, bool core_thread);
~Utcb();
};
Label const _label;
Platform_pd &_pd;
Weak_ptr<Address_space> _address_space { };
Pager_object * _pager;
Native_utcb * _utcb_core_addr { }; /* UTCB addr in core */
Native_utcb * _utcb_pd_addr; /* UTCB addr in pd */
Ram_dataspace_capability _utcb { }; /* UTCB dataspace */
Utcb _utcb;
unsigned _priority {0};
unsigned _quota {0};
@@ -241,7 +252,7 @@ class Core::Platform_thread : Noncopyable
Platform_pd &pd() const { return _pd; }
Ram_dataspace_capability utcb() const { return _utcb; }
Ram_dataspace_capability utcb() const { return _utcb._ds; }
};
#endif /* _CORE__PLATFORM_THREAD_H_ */

View File

@@ -22,6 +22,32 @@
using namespace Core;
void Arm_cpu::Context::print(Output &output) const
{
using namespace Genode;
using Genode::print;
print(output, "\n");
print(output, " r0 = ", Hex(r0), "\n");
print(output, " r1 = ", Hex(r1), "\n");
print(output, " r2 = ", Hex(r2), "\n");
print(output, " r3 = ", Hex(r3), "\n");
print(output, " r4 = ", Hex(r4), "\n");
print(output, " r5 = ", Hex(r5), "\n");
print(output, " r6 = ", Hex(r6), "\n");
print(output, " r7 = ", Hex(r7), "\n");
print(output, " r8 = ", Hex(r8), "\n");
print(output, " r9 = ", Hex(r9), "\n");
print(output, " r10 = ", Hex(r10), "\n");
print(output, " r11 = ", Hex(r11), "\n");
print(output, " r12 = ", Hex(r12), "\n");
print(output, " ip = ", Hex(ip), "\n");
print(output, " sp = ", Hex(sp), "\n");
print(output, " lr = ", Hex(lr), "\n");
print(output, " cpsr = ", Hex(cpsr));
}
Arm_cpu::Context::Context(bool privileged)
{
using Psr = Arm_cpu::Psr;

View File

@@ -49,6 +49,18 @@ struct Core::Arm_cpu : public Hw::Arm_cpu
struct alignas(8) Context : Cpu_state, Fpu_context
{
Context(bool privileged);
void print(Output &output) const;
void for_each_return_address(Const_byte_range_ptr const &stack,
auto const &fn)
{
void **fp = (void**)r11;
while (stack.contains(fp-1) && stack.contains(fp) && fp[0]) {
fn(fp);
fp = (void **) fp[-1];
}
}
};
/**

View File

@@ -35,7 +35,8 @@ extern addr_t hypervisor_exception_vector;
void Core::platform_add_local_services(Rpc_entrypoint &ep,
Sliced_heap &sh,
Registry<Service> &services,
Core::Trace::Source_registry &trace_sources)
Core::Trace::Source_registry &trace_sources,
Ram_allocator &)
{
map_local(Platform::core_phys_addr((addr_t)&hypervisor_exception_vector),
Hw::Mm::hypervisor_exception_vector().base,

View File

@@ -32,7 +32,8 @@ extern int monitor_mode_exception_vector;
void Core::platform_add_local_services(Rpc_entrypoint &ep,
Sliced_heap &sliced_heap,
Registry<Service> &local_services,
Core::Trace::Source_registry &trace_sources)
Core::Trace::Source_registry &trace_sources,
Ram_allocator &)
{
static addr_t const phys_base =
Platform::core_phys_addr((addr_t)&monitor_mode_exception_vector);

View File

@@ -22,6 +22,22 @@
using namespace Core;
void Cpu::Context::print(Output &output) const
{
using namespace Genode;
using Genode::print;
print(output, "\n");
for (unsigned i = 0; i < 31; i++)
print(output, " x", i, " = ", Hex(r[i]), "\n");
print(output, " ip = ", Hex(ip), "\n");
print(output, " sp = ", Hex(sp), "\n");
print(output, " esr = ", Hex(esr_el1), "\n");
print(output, " pstate = ", Hex(pstate), "\n");
print(output, " mdscr = ", Hex(mdscr_el1));
}
Cpu::Context::Context(bool privileged)
{
Spsr::El::set(pstate, privileged ? 1 : 0);

View File

@@ -79,6 +79,18 @@ struct Core::Cpu : Hw::Arm_64_cpu
Fpu_state fpu_state { };
Context(bool privileged);
void print(Output &output) const;
void for_each_return_address(Const_byte_range_ptr const &stack,
auto const &fn)
{
void **fp = (void**)r[29];
while (stack.contains(fp) && stack.contains(fp + 1) && fp[1]) {
fn(fp + 1);
fp = (void **) fp[0];
}
}
};
class Mmu_context

View File

@@ -25,6 +25,47 @@ using Mmu_context = Core::Cpu::Mmu_context;
using namespace Core;
void Cpu::Context::print(Output &output) const
{
using namespace Genode;
using Genode::print;
print(output, "\n");
print(output, " ip = ", Hex(ip), "\n");
print(output, " ra = ", Hex(ra), "\n");
print(output, " sp = ", Hex(sp), "\n");
print(output, " gp = ", Hex(gp), "\n");
print(output, " tp = ", Hex(tp), "\n");
print(output, " t0 = ", Hex(t0), "\n");
print(output, " t1 = ", Hex(t1), "\n");
print(output, " t2 = ", Hex(t2), "\n");
print(output, " s0 = ", Hex(s0), "\n");
print(output, " s1 = ", Hex(s1), "\n");
print(output, " a0 = ", Hex(a0), "\n");
print(output, " a1 = ", Hex(a1), "\n");
print(output, " a2 = ", Hex(a2), "\n");
print(output, " a3 = ", Hex(a3), "\n");
print(output, " a4 = ", Hex(a4), "\n");
print(output, " a5 = ", Hex(a5), "\n");
print(output, " a6 = ", Hex(a6), "\n");
print(output, " a7 = ", Hex(a7), "\n");
print(output, " s2 = ", Hex(s2), "\n");
print(output, " s3 = ", Hex(s3), "\n");
print(output, " s4 = ", Hex(s4), "\n");
print(output, " s5 = ", Hex(s5), "\n");
print(output, " s6 = ", Hex(s6), "\n");
print(output, " s7 = ", Hex(s7), "\n");
print(output, " s8 = ", Hex(s8), "\n");
print(output, " s9 = ", Hex(s9), "\n");
print(output, " s10 = ", Hex(s10), "\n");
print(output, " s11 = ", Hex(s11), "\n");
print(output, " t3 = ", Hex(t3), "\n");
print(output, " t4 = ", Hex(t4), "\n");
print(output, " t5 = ", Hex(t5), "\n");
print(output, " t6 = ", Hex(t6));
}
Cpu::Context::Context(bool)
{
/*

View File

@@ -56,6 +56,11 @@ class Core::Cpu : public Hw::Riscv_cpu
struct alignas(8) Context : Genode::Cpu_state
{
Context(bool);
void print(Output &output) const;
void for_each_return_address(Const_byte_range_ptr const &,
auto const &) { }
};
class Mmu_context

View File

@@ -37,6 +37,27 @@ struct Pseudo_descriptor
} __attribute__((packed));
void Cpu::Context::print(Output &output) const
{
using namespace Genode;
using Genode::print;
print(output, "\n");
print(output, " ip = ", Hex(ip), "\n");
print(output, " sp = ", Hex(sp), "\n");
print(output, " cs = ", Hex(cs), "\n");
print(output, " ss = ", Hex(ss), "\n");
print(output, " eflags = ", Hex(eflags), "\n");
print(output, " rax = ", Hex(rax), "\n");
print(output, " rbx = ", Hex(rbx), "\n");
print(output, " rcx = ", Hex(rcx), "\n");
print(output, " rdx = ", Hex(rdx), "\n");
print(output, " rdi = ", Hex(rdi), "\n");
print(output, " rsi = ", Hex(rsi), "\n");
print(output, " rbp = ", Hex(rbp));
}
Cpu::Context::Context(bool core)
{
eflags = EFLAGS_IF_SET;

View File

@@ -100,6 +100,18 @@ class Core::Cpu : public Hw::X86_64_cpu
};
Context(bool privileged);
void print(Output &output) const;
void for_each_return_address(Const_byte_range_ptr const &stack,
auto const &fn)
{
void **fp = (void**)rbp;
while (stack.contains(fp) && stack.contains(fp + 1) && fp[1]) {
fn(fp + 1);
fp = (void **) fp[0];
}
}
} __attribute__((packed));

View File

@@ -27,9 +27,10 @@
* Add x86 specific ioport and virtualization service
*/
void Core::platform_add_local_services(Rpc_entrypoint &ep,
Sliced_heap &sliced_heap,
Registry<Service> &local_services,
Trace::Source_registry &trace_sources)
Sliced_heap &sliced_heap,
Registry<Service> &local_services,
Trace::Source_registry &trace_sources,
Ram_allocator &)
{
static Io_port_root io_port_root(*core_env().pd_session(),
platform().io_port_alloc(), sliced_heap);

View File

@@ -1 +1 @@
2024-10-07 acb4a463ec1b2b6868f923900c2b04ee1a6487a8
2024-12-10 bcad5355367be159df49abba05f4975f8391ef4b

View File

@@ -22,5 +22,6 @@
void Core::platform_add_local_services(Rpc_entrypoint &,
Sliced_heap &,
Registry<Service> &,
Trace::Source_registry &)
Trace::Source_registry &,
Ram_allocator &)
{ }

View File

@@ -28,7 +28,8 @@ using namespace Core;
void Core::platform_add_local_services(Rpc_entrypoint &,
Sliced_heap &md,
Registry<Service> &reg,
Core::Trace::Source_registry &)
Core::Trace::Source_registry &,
Ram_allocator &)
{
if (!lx_iopl(3)) {
static Io_port_root io_port_root(*core_env().pd_session(),

View File

@@ -1 +1 @@
dd4d2aba9dd83ec08e956cb31274c62cbcaf91f6
d58086480d6a21a06bbd956e2d2e605d0f39b6b2

View File

@@ -4,7 +4,7 @@ DOWNLOADS := nova.git
# r10 branch
URL(nova) := https://github.com/alex-ab/NOVA.git
REV(nova) := 60419b83599fbe506308b0375371c49136e00985
REV(nova) := fc9ad04ecec3911302451fcbf6cd87063be66ad0
DIR(nova) := src/kernel/nova
PATCHES := $(sort $(wildcard $(REP_DIR)/patches/*.patch))

View File

@@ -1 +1 @@
2024-10-07 3fdd714b4cf479987b027a09aa2b470dfc46a92a
2024-12-10 bb446406fbb1173c3f243fe323d5cad8423ff958

View File

@@ -91,7 +91,6 @@ class Core::Pager_object : public Object_pool<Pager_object>::Entry
DEAD = 0x2U,
SINGLESTEP = 0x4U,
SIGNAL_SM = 0x8U,
DISSOLVED = 0x10U,
SUBMIT_SIGNAL = 0x20U,
BLOCKED_PAUSE_SM = 0x40U,
MIGRATE = 0x80U
@@ -115,9 +114,6 @@ class Core::Pager_object : public Object_pool<Pager_object>::Entry
inline void mark_signal_sm() { _status |= SIGNAL_SM; }
inline bool has_signal_sm() { return _status & SIGNAL_SM; }
inline void mark_dissolved() { _status |= DISSOLVED; }
inline bool dissolved() { return _status & DISSOLVED; }
inline bool to_submit() { return _status & SUBMIT_SIGNAL; }
inline void submit_signal() { _status |= SUBMIT_SIGNAL; }
inline void reset_submit() { _status &= (uint8_t)(~SUBMIT_SIGNAL); }

View File

@@ -523,8 +523,6 @@ uint8_t Pager_object::_unsynchronized_client_recall(bool get_state_and_block)
void Pager_object::cleanup_call()
{
_state.mark_dissolved();
/* revoke ec and sc cap of client before the sm cap */
if (_state.sel_client_ec != Native_thread::INVALID_INDEX)
revoke(Obj_crd(_state.sel_client_ec, 2));
@@ -750,10 +748,6 @@ void Pager_object::migrate(Affinity::Location location)
Pager_object::~Pager_object()
{
/* sanity check that object got dissolved already - otherwise bug */
if (!_state.dissolved())
nova_die();
/* revoke portal used for the cleanup call and sm cap for blocking state */
revoke(Obj_crd(_selectors, 2));
cap_map().remove(_selectors, 2, false);

View File

@@ -23,7 +23,8 @@
void Core::platform_add_local_services(Rpc_entrypoint &ep,
Sliced_heap &heap,
Registry<Service> &services,
Trace::Source_registry &trace_sources)
Trace::Source_registry &trace_sources,
Ram_allocator &)
{
static Vm_root vm_root(ep, heap, core_env().ram_allocator(),
core_env().local_rm(), trace_sources);

View File

@@ -1 +1 @@
2024-10-07 0dfc585477f27e02dbe67acf3a23f48718c113f7
2024-12-10 ed00306cd3e097b95bf2cbd0e9238ccb22d1f0c2

View File

@@ -1 +1 @@
2024-10-07 4ec8eaa528d706f5b2a267f95443a48430a87a91
2024-12-10 d6f79e327a46e48890b32d90d2eb8be604a8534d

View File

@@ -1 +1 @@
2024-10-07 b23d40bed9c8b9ed8fc8d8d1e2c5cac4e719580a
2024-12-10 4f6772b2b52b10c6462c2be4460981484d2f413f

View File

@@ -1 +1 @@
2024-10-07 9929145b5c04edaf41b0f726743eabb2de9cc832
2024-12-10 e10d664cb493e322f029ef8a4bb22dabb3276137

View File

@@ -23,7 +23,8 @@
void Core::platform_add_local_services(Rpc_entrypoint &ep,
Sliced_heap &heap,
Registry<Service> &services,
Core::Trace::Source_registry &trace_sources)
Core::Trace::Source_registry &trace_sources,
Ram_allocator &)
{
static Vm_root vm_root(ep, heap, core_env().ram_allocator(),
core_env().local_rm(), trace_sources);

View File

@@ -139,6 +139,8 @@ class Genode::Attached_ram_dataspace
*/
size_t size() const { return _size; }
void clear() { if (_at) memset((void *)_at, 0, _size); }
void swap(Attached_ram_dataspace &other)
{
_swap(_size, other._size);

View File

@@ -25,7 +25,10 @@ namespace Genode {
* \param size number of bytes to copy
*
* \return number of bytes not copied
*
* The compiler attribute prevents array-bounds warnings with gcc 12.3.
*/
__attribute((optimize("no-tree-loop-distribute-patterns")))
inline size_t memcpy_cpu(void * dst, const void * src, size_t size)
{
using word_t = unsigned long;

View File

@@ -130,7 +130,7 @@ namespace Genode {
/**
* Return length of null-terminated string in bytes
*/
__attribute((optimize("no-tree-loop-distribute-patterns")))
__attribute((optimize("no-tree-loop-distribute-patterns")))
inline size_t strlen(const char *s)
{
size_t res = 0;
@@ -190,6 +190,9 @@ namespace Genode {
*/
inline void *memcpy(void *dst, const void *src, size_t size)
{
if (!size)
return dst;
char *d = (char *)dst, *s = (char *)src;
size_t i;
@@ -281,7 +284,7 @@ namespace Genode {
* generation of a 'memset()' call in the 'while' loop
* with gcc 10.
*/
__attribute((optimize("no-tree-loop-distribute-patterns")))
__attribute((optimize("no-tree-loop-distribute-patterns")))
inline void *memset(void *dst, uint8_t i, size_t size)
{
using word_t = unsigned long;

View File

@@ -1 +1 @@
2024-10-07 513edfd85657a2cea7224093f02ad8f2525056f3
2024-12-10 679ce4322aa21ae89a006562d0b7ee2525f49f79

View File

@@ -1 +1 @@
2024-10-29 123419fe0f679a41e6e836a82f46be56644d36af
2024-12-10 3ffa5a2865cae514a74efae0db61d377b15d763c

View File

@@ -1 +1 @@
2024-10-29 4121baf09683470114b15c6768cb939b7b78de65
2024-12-10 bbe7bf0ec279122d824bee5c1195b01afc84dd4b

View File

@@ -1 +1 @@
2024-10-29 964df1f1eebb297399d37ffc42cd5b717f81ac65
2024-12-10 a7b0af32394148e425159d04d66eaf68d547e235

View File

@@ -1 +1 @@
2024-10-29 8acfdc522214ab48f3ba2662deca84562aedb62f
2024-12-10 2b25d7303e7618744a76789b0bd3b67e6ac6118c

View File

@@ -1 +1 @@
2024-10-29 511875353e93f226ff52c3a79be5e6847fa95c19
2024-12-10 53cd2f02ef23b3a499863c6d8ece98a34d5f6c1b

View File

@@ -1 +1 @@
2024-10-29 4eb04b36a4589581afe4b8e5c09cd1a8202e389e
2024-12-10 d598d8570fdf0fac3c44800df6d102a685fefd4f

View File

@@ -1 +1 @@
2024-10-29 ec0ee7597f35852ed2a1f0a3250ebc9de125141d
2024-12-10 a0c00bbc6afd51d935a027aac2f99c724b511475

View File

@@ -1 +1 @@
2024-10-29 2093c0cd6b5e73f07e682f8448abdf4bcc07ba90
2024-12-10 562d5813faeaea8af1f0d0113eaf8a34bac68278

View File

@@ -1 +1 @@
2024-10-29 ea454149147f8535060bf076432dd67d473658dd
2024-12-10 768c693ffc03d646b6d17db9dba0e09b5824831a

View File

@@ -1 +1 @@
2024-10-29 dde16843a89b11f0c76e73ab66906ccc68d65a0c
2024-12-10 b0c035bf11e2c58d7d1d63bf419f77f10bb5029c

View File

@@ -1 +1 @@
2024-10-29 0816774e285a09f371e1c7b11c661aeb9925e4dc
2024-12-10 aa6bb600bf3fa65d998647297a92bfd156bac23a

View File

@@ -1 +1 @@
2024-10-29 1d173f7880db1f1252ab54cea4d8e6ba8e7ea77c
2024-12-10 4f8eed217aacbb49e55c92f4a3478e6480ab7d44

View File

@@ -1 +1 @@
2024-10-29 50994e52f5f229a19d33169d3ae3aa1e1b06a83a
2024-12-10 4446fdee68a430143a7f3fad9967cce025313cda

View File

@@ -1 +1 @@
2024-10-29 54f3e743c82cc972eebb16023de863fa5e539812
2024-12-10 86c625e9f1ee148ca591133b949201eb8e35bd62

View File

@@ -1 +1 @@
2024-10-29 5fde64bdb410c3b1d31e97f0d21cf3d064bbc2ce
2024-12-10 4a3be510164139564f2c0fee666b2a44440c1b63

View File

@@ -1 +1 @@
2024-10-29 f5a700f137cf815f7ce15b3fa9f5634b7828425e
2024-12-10 ca74ef5ce15156297109d276e4c84de0eb53ea1a

View File

@@ -1 +1 @@
2024-10-29 d326468bba3e8af5f49179103fb74567410c016b
2024-12-10 78cfc1241bbeb91375ea7d868dc643da2cb15fdd

View File

@@ -1 +1 @@
2024-10-29 f5aa7c4c7928b4aa750133798ab5ced2862627ef
2024-12-10 87328a1454e601631109593eea99f67d67f6cb58

View File

@@ -1 +1 @@
2024-10-29 0c302928b9f742d2dca1a7a7392217afc7d99518
2024-12-10 24326fce4a9a146c83a56b39ac47225704842e77

View File

@@ -1 +1 @@
2024-10-29 778c0e244d381f663a04913e3fd490c9029454e7
2024-12-10 ca7dc59df2e889b786ba71945267bc2312921aa2

View File

@@ -1 +1 @@
2024-10-07 a6a04c7c48e562c4450603757520e447af6ba3b7
2024-12-10 4c5fdf8c9ec55ce700941db5e92e762b59eadf9d

View File

@@ -1 +1 @@
2024-10-07 c65f3e117d0576e35c93be32795ae44e40905806
2024-12-10 4b2f31583181dd5ea91853d185a3891b5de51991

View File

@@ -1 +1 @@
2024-10-07 fd12392cdb6e8a73927eddb831b5a4a03f1dba99
2024-12-10 4ce6ec42b350c805f049a20a150de0bdb9450870

View File

@@ -1 +1 @@
2024-10-07 2d27a4ea191a544959688dddebc99c0158a2cc87
2024-12-10 97a0bfdbe1db15c82b063e3db2047e4b0137951d

View File

@@ -1 +1 @@
2024-10-07 a2f19169350426a2c92bfa82cd57ea1126ff40f9
2024-12-10 19da5bfd961e5bd3388a6bf771e902edf8720fcc

View File

@@ -1 +1 @@
2024-10-07 fdd7695261277dcba03643f98bb2804c30c0cf04
2024-12-10 0f5f88878de68adcbadca0ff916f6550fe166691

View File

@@ -1 +1 @@
2024-10-07 45ffa221854a16794e7325d8ed6d6b5ce90635a5
2024-12-10 c462994f5183b4fa2e7b510953c61a47758efc8f

View File

@@ -1 +1 @@
2024-10-07 96b39a93b70d6732cd2f6a7e30ac3404f4f017d5
2024-12-10 73f1c2695f605e5ffb4b436ba46861408a1808f5

View File

@@ -1 +1 @@
2024-10-07 9843a171d4e781aec5597ce0b48ccc17431918d7
2024-12-10 edb8428080fb555fce9b579b27d5f1a7b64ba98d

View File

@@ -1 +1 @@
2024-10-07 b3d5f7577d058fd7d3a34846af555ba2ffec842b
2024-12-10 58e5fe045c8f3364f940b1f279b00feb3a490b31

View File

@@ -1 +1 @@
2024-10-07 40512d1349569b95538ce6c61613c295cf7f9487
2024-12-10 ae413cc25fbcced7f064f2ec3483c85e2add1043

View File

@@ -1 +1 @@
2024-10-07 4725441ba5bbe72651a38e5e13ac2ed3bda4af37
2024-12-10 4721bcab9444c1e20213fc97332435c6a8003c4d

View File

@@ -1 +1 @@
2024-10-07 5c9f35640dd353fe429cac6d93c022a99a609fb5
2024-12-10 192c06392264f53e181c6f92a5bbcb86273e3918

View File

@@ -1 +1 @@
2024-10-07 635ede2b3116c2dd4817b120ba9c346f72032fae
2024-12-10 30d45f61656e670e8cb5e18b060a14f356b88ace

View File

@@ -1 +1 @@
2024-10-07 a1eb033228bdbe39301dd2fae6502870c3162b26
2024-12-10 99611181980e7a782fd155eaf36525218350abd2

View File

@@ -1 +1 @@
2024-10-07 f4fc22ec46e47ed91c121beb24657d911f6b7411
2024-12-10 d6fa422e41e40f7da917ea6fc4eb75896945c7ec

View File

@@ -1 +1 @@
2024-10-07 83118776eba8117187854ababa680cb1fe4b2b77
2024-12-10 380e2f625f1289606d0b1366829b640e0805eb7c

View File

@@ -1 +1 @@
2024-10-07 b1c7aacfa16f9ecbd103e3df98a0a2bb36bae272
2024-12-10 906f19242a142f336c9abec8924594920cb68dcd

View File

@@ -1 +1 @@
2024-10-07 472cfb4a2918d0ecb9251eba8cd3b624275a94ab
2024-12-10 da695ee628e068a05af6e85177612a94409573a5

View File

@@ -1 +1 @@
2024-10-07 17a0ac2f692ff963d89fab0ae111606a837bcaaf
2024-12-10 1510f2592e0579d9e404288e020b2096d652e465

View File

@@ -15,6 +15,7 @@
#define _CORE__INCLUDE__PLATFORM_SERVICES_H_
/* core includes */
#include "base/ram_allocator.h"
#include <core_service.h>
#include <trace/source_registry.h>
@@ -38,7 +39,8 @@ namespace Core {
void platform_add_local_services(Rpc_entrypoint &ep,
Sliced_heap &md,
Registry<Service> &reg,
Trace::Source_registry &trace);
Trace::Source_registry &trace,
Ram_allocator &core_ram_alloc);
}
#endif /* _CORE__INCLUDE__PLATFORM_SERVICES_H_ */

View File

@@ -289,7 +289,7 @@ void Genode::bootstrap_component(Genode::Platform &)
static Core_service<Trace_session_component> trace_service (services, trace_root);
/* make platform-specific services known to service pool */
platform_add_local_services(ep, sliced_heap, services, Core::Trace::sources());
platform_add_local_services(ep, sliced_heap, services, Core::Trace::sources(), core_ram_alloc);
size_t const avail_ram_quota = core_pd.avail_ram().value;
size_t const avail_cap_quota = core_pd.avail_caps().value;

View File

@@ -17,4 +17,5 @@
void Core::platform_add_local_services(Rpc_entrypoint &, Sliced_heap &,
Registry<Service> &,
Trace::Source_registry &) { }
Trace::Source_registry &,
Ram_allocator &) { }

View File

@@ -27,7 +27,8 @@
void Core::platform_add_local_services(Rpc_entrypoint &,
Sliced_heap &sliced_heap,
Registry<Service> &local_services,
Trace::Source_registry &)
Trace::Source_registry &,
Ram_allocator &)
{
static Io_port_root io_port_root(*core_env().pd_session(),
platform().io_port_alloc(), sliced_heap);

View File

@@ -1 +1 @@
2024-10-07 49864c449ff2a8f7de7d54b6231c62ff4ad75dcd
2024-12-10 19af2857787095f29ff1156ca12921a84b8c2c88

View File

@@ -1 +1 @@
2024-10-07 9c7c095fe94c898d473c97596e50a29d1cfaa088
2024-12-10 0cb59fb39e1ef2c557804fe74904f262e7cc990d

View File

@@ -1 +1 @@
2024-10-07 ebc62d24f7c3bae4d285d96732c5c76a9d06da73
2024-12-10 89e83d53d29fe7dd5d37b53d53715e2e8370c517

View File

@@ -1 +1 @@
2024-10-07 11b76ee4b6ed52235d29283e1d8f377c65e71630
2024-12-10 88ed31a9ac73fdb34464241cd03d308382dc9b19

View File

@@ -0,0 +1,28 @@
intel_fb: avoid pagefault, since gt not setup by our port
--- src/linux/drivers/gpu/drm/i915/i915_gem_evict.c
+++ src/linux/drivers/gpu/drm/i915/i915_gem_evict.c
@@ -187,8 +187,9 @@
if (i915_is_ggtt(vm)) {
struct i915_ggtt *ggtt = i915_vm_to_ggtt(vm);
- list_for_each_entry(gt, &ggtt->gt_list, ggtt_link)
- intel_gt_retire_requests(gt);
+ if (gt)
+ list_for_each_entry(gt, &ggtt->gt_list, ggtt_link)
+ intel_gt_retire_requests(gt);
} else {
intel_gt_retire_requests(vm->gt);
}
@@ -353,8 +354,9 @@
struct i915_ggtt *ggtt = i915_vm_to_ggtt(vm);
struct intel_gt *gt;
- list_for_each_entry(gt, &ggtt->gt_list, ggtt_link)
- intel_gt_retire_requests(gt);
+ if (gt)
+ list_for_each_entry(gt, &ggtt->gt_list, ggtt_link)
+ intel_gt_retire_requests(gt);
} else {
intel_gt_retire_requests(vm->gt);
}

View File

@@ -1 +1 @@
501de7d0dc5363c9f271c2cd853b963b2a881438
5e77186d61fe216b38cf516c5a40babcfdbd50ad

View File

@@ -10,6 +10,7 @@ DIR(linux) := src/linux
# Patches
#
PATCH_FILES := i915_irq.patch \
i915_ggtt.patch \
iwlwifi_break_busy_loop.patch \
iwlwifi_enable_irq_before_pnvm.patch \
iwlwifi_limit_rx_bufs.patch \

View File

@@ -1 +1 @@
2024-10-29 a0f80d05ac5f5d87e619cd2041ef4fab8f2c906f
2024-11-19 456f1dc7b465e43a487e98cae063f4b292ab14d0

Some files were not shown because too many files have changed in this diff Show More