It is possible to set a CPU to offline or online mode through
sysfs while system running.
You can set
online variable to
0 for each of the cpu cores which you want to make offline:
echo 0 > /sys/devices/system/cpu/cpu2/online
Think about what will be happen if you set all of the cpu cores to offline