userspace: fix x86 issue with adding partitions
On x86, if a supervisor thread belonging to a memory domain adds a new partition to that domain, subsequent context switches to another thread in the same domain, or dropping itself to user mode, does not have the correct setup in the page tables. Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
c5592de5ae
commit
6dc3fd8e50
5 changed files with 79 additions and 33 deletions
|
@ -178,6 +178,13 @@ void k_mem_domain_add_partition(struct k_mem_domain *domain,
|
|||
|
||||
domain->num_partitions++;
|
||||
|
||||
/* Handle architecture-specific remove
|
||||
* only if it is the current thread.
|
||||
*/
|
||||
if (_current->mem_domain_info.mem_domain == domain) {
|
||||
_arch_mem_domain_partition_add(domain, p_idx);
|
||||
}
|
||||
|
||||
k_spin_unlock(&lock, key);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue