Atish Patra
f1e58583b9
RISC-V: Support cpu hotplug
This patch enable support for cpu hotplug in RISC-V. It uses SBI HSM
extension to online/offline any hart. As a result, the harts are
returned to firmware once they are offline. If the harts are brought
online afterwards, they re-enter Linux kernel as if a secondary hart
booted for the first time. All booting requirements are honored during
this process.
Tested both on QEMU and HighFive Unleashed board with. Test result follows.
---------------------------------------------------
Offline cpu 2
---------------------------------------------------
$ echo 0 > /sys/devices/system/cpu/cpu2/online
[ 32.828684] CPU2: off
$ cat /proc/cpuinfo
processor : 0
hart : 0
isa : rv64imafdcsu
mmu : sv48
processor : 1
hart : 1
isa : rv64imafdcsu
mmu : sv48
processor : 3
hart : 3
isa : rv64imafdcsu
mmu : sv48
processor : 4
hart : 4
isa : rv64imafdcsu
mmu : sv48
processor : 5
hart : 5
isa : rv64imafdcsu
mmu : sv48
processor : 6
hart : 6
isa : rv64imafdcsu
mmu : sv48
processor : 7
hart : 7
isa : rv64imafdcsu
mmu : sv48
---------------------------------------------------
online cpu 2
---------------------------------------------------
$ echo 1 > /sys/devices/system/cpu/cpu2/online
$ cat /proc/cpuinfo
processor : 0
hart : 0
isa : rv64imafdcsu
mmu : sv48
processor : 1
hart : 1
isa : rv64imafdcsu
mmu : sv48
processor : 2
hart : 2
isa : rv64imafdcsu
mmu : sv48
processor : 3
hart : 3
isa : rv64imafdcsu
mmu : sv48
processor : 4
hart : 4
isa : rv64imafdcsu
mmu : sv48
processor : 5
hart : 5
isa : rv64imafdcsu
mmu : sv48
processor : 6
hart : 6
isa : rv64imafdcsu
mmu : sv48
processor : 7
hart : 7
isa : rv64imafdcsu
mmu : sv48
Signed-off-by: Atish Patra <atish.patra@wdc.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
2020-03-31 11:28:30 -07:00
..
2020-01-18 13:22:13 -08:00
2017-09-26 15:26:49 -07:00
2019-11-05 09:20:42 -08:00
2019-06-05 17:36:37 +02:00
2019-11-17 15:17:39 -08:00
2020-03-31 11:28:30 -07:00
2020-03-31 11:25:56 -07:00
2020-03-31 11:27:50 -07:00
2020-03-31 11:28:30 -07:00
2019-10-28 11:13:59 -07:00
2019-10-28 00:46:01 -07:00
2020-03-03 10:33:21 -08:00
2019-11-05 09:20:42 -08:00
2020-03-26 09:24:55 -07:00
2019-10-28 00:46:00 -07:00
2020-03-31 11:27:50 -07:00
2020-01-04 21:48:59 -08:00
2020-03-31 11:28:30 -07:00
2018-04-02 19:59:13 -07:00
2018-10-22 17:38:12 -07:00
2019-10-28 00:46:01 -07:00
2019-10-18 10:48:36 +02:00
2018-04-02 20:00:54 -07:00
2020-03-26 09:24:52 -07:00
2019-11-05 09:20:42 -08:00
2019-05-16 20:42:11 -07:00
2019-09-05 00:48:58 -07:00
2020-03-03 10:28:13 -08:00
2019-11-30 17:23:16 -08:00
2019-11-13 13:22:52 -08:00
2020-01-22 13:09:58 -08:00
2020-03-31 11:26:00 -07:00
2020-03-31 11:28:30 -07:00
2019-11-17 15:17:39 -08:00
2019-11-17 15:17:39 -08:00
2020-03-31 11:27:50 -07:00
2020-03-03 10:28:13 -08:00
2019-06-05 17:36:37 +02:00
2019-10-28 00:46:01 -07:00
2019-10-28 00:46:01 -07:00
2020-03-31 11:27:50 -07:00
2019-10-28 00:46:01 -07:00
2020-03-31 11:25:50 -07:00