Commit 6dd0f06a authored by Yicong Yang's avatar Yicong Yang Committed by Jie Liu
Browse files

arch_topology: Support basic SMT control for the driver

kunpeng inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I8TAPW
CVE: NA

Reference: https://lore.kernel.org/all/20231121092602.47792-1-yangyicong@huawei.com/



----------------------------------------------------------------------

The core CPU control framework supports runtime SMT control which
is not yet supported by arch_topology driver and thus arch_topology
based architectures. This patch implements it in the following aspects:

- implement topology_is_primary_thread() to indicate the primary thread,
  required by the framework
- architecture code can get/set the SMT thread number by
  topology_smt_{get, set}_num_threads()
- update the SMT thread number for the framework after the topology
  enumerated on arm64, which is also required by the framework

For disabling SMT we'll offline all the secondary threads and
only leave the primary thread. Since we don't have restriction
for primary thread selection, the first thread is chosen as the
primary thread in this implementation.

This patch only implements the basic support for SMT control, which
needs to collabrate with ACPI/OF based topology building to fully
enable the feature. The SMT control will be enabled unless the
correct SMT thread number is set and HOTPLUG_SMT kconfig is selected.

Signed-off-by: default avatarYicong Yang <yangyicong@hisilicon.com>
Signed-off-by: default avatarJie Liu <liujie375@h-partners.com>
parent 45c76c86
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment