In make the file /usr/share/qubes/templates/libvirt/xen-user.xml
With the content
{% extends 'libvirt/xen.xml' %}
{% block basic %}
<vcpu cpuset="1-8">{{ vm.vcpus }}</vcpu>
{{ super() }}
{% endblock %}
If you have more than 8 cores, you need to adjust the cpuset.
Try starting a qube before rebooting, to make sure everything is working.
You can use the command xl vcpu-list
to check that the affinity is set to 1-8.