mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
Add initial symmetric multi-processing (SMP) support to UML. With this support enabled, users can tell UML to start multiple virtual processors, each represented as a separate host thread. In UML, kthreads and normal threads (when running in kernel mode) can be scheduled and executed simultaneously on different virtual processors. However, the userspace code of normal threads still runs within their respective single-threaded stubs. That is, SMP support is currently available both within the kernel and across different processes, but still remains limited within threads of the same process in userspace. Signed-off-by: Tiwei Bie <tiwei.btw@antgroup.com> Link: https://patch.msgid.link/20251027001815.1666872-6-tiwei.bie@linux.dev Signed-off-by: Johannes Berg <johannes.berg@intel.com>
21 lines
369 B
C
21 lines
369 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __UM_SHARED_SMP_H
|
|
#define __UM_SHARED_SMP_H
|
|
|
|
#if IS_ENABLED(CONFIG_SMP)
|
|
|
|
extern int uml_ncpus;
|
|
|
|
int uml_curr_cpu(void);
|
|
void uml_start_secondary(void *opaque);
|
|
void uml_ipi_handler(int vector);
|
|
|
|
#else /* !CONFIG_SMP */
|
|
|
|
#define uml_ncpus 1
|
|
#define uml_curr_cpu() 0
|
|
|
|
#endif /* CONFIG_SMP */
|
|
|
|
#endif /* __UM_SHARED_SMP_H */
|