From 9135630c00a56e81022dc990d93c9d3a14acdfe3 Mon Sep 17 00:00:00 2001 From: Michael Mueller Date: Tue, 25 Feb 2025 10:26:48 +0100 Subject: [PATCH] Notify hypervisor that core affinities were changed in CIP. This is necessary because the hypervisor has to update the ownership of the cell's CPU core resources. --- repos/base-tukija/include/spec/64bit/tukija/syscalls.h | 5 +++++ repos/base-tukija/include/tukija/syscall-generic.h | 9 +++++++++ repos/base-tukija/src/core/include/cell_component.h | 1 + 3 files changed, 15 insertions(+) diff --git a/repos/base-tukija/include/spec/64bit/tukija/syscalls.h b/repos/base-tukija/include/spec/64bit/tukija/syscalls.h index b1edb5630f..72876114dc 100644 --- a/repos/base-tukija/include/spec/64bit/tukija/syscalls.h +++ b/repos/base-tukija/include/spec/64bit/tukija/syscalls.h @@ -411,6 +411,11 @@ namespace Tukija { return syscall_5(NOVA_PD_CTRL, Pd_op::PD_DEBUG, pd, limit, usage); } + ALWAYS_INLINE + inline uint8_t cell_ctrl(mword_t pd, Cell_control const op) + { + return syscall_0(TUKIJA_CELL_CTRL, op, pd); + } ALWAYS_INLINE inline uint8_t assign_pci(mword_t pd, mword_t mem, mword_t rid) diff --git a/repos/base-tukija/include/tukija/syscall-generic.h b/repos/base-tukija/include/tukija/syscall-generic.h index 9189084924..8e0a6cf93a 100644 --- a/repos/base-tukija/include/tukija/syscall-generic.h +++ b/repos/base-tukija/include/tukija/syscall-generic.h @@ -71,6 +71,15 @@ namespace Tukija { NOVA_PD_CTRL = 0xf, TUKIJA_CREATE_CELL = 0x10, TUKIJA_ALLOCATE = 0x11, + TUKIJA_CELL_CTRL = 0x12, + }; + + /** + * Tukija operations + */ + enum Cell_control + { + UPDATE_AFFINITY = 0, }; /** diff --git a/repos/base-tukija/src/core/include/cell_component.h b/repos/base-tukija/src/core/include/cell_component.h index 4f4d795573..8071259e72 100644 --- a/repos/base-tukija/src/core/include/cell_component.h +++ b/repos/base-tukija/src/core/include/cell_component.h @@ -101,6 +101,7 @@ class Ealan::Cell_component : public Genode::Rpc_object, /* TODO: implement */ Genode::log("Changing cell's affinity to ", affinity); _calculate_mask_for_location(&_cip->cores_reserved, affinity.location()); + Tukija::cell_ctrl(_native_pd.sel(), Tukija::Cell_control::UPDATE_AFFINITY); } bool is_brick() override {