CPU Pinning tells the Hypervisor which Threads should be prioritized to the VM and not shared between the host and guest.
This will not Isolate the Threads from the host system, for isolating read this.
With lscpu -e you can check which Core belongs to which CPU Block, if you never heard of this please read this Wiki
For my Ryzen 9 7950X the XML config would look like this, if I want to pin the first 16 Threads but use all my 32 Threads if needed:
...
<vcpu placement="static">32</vcpu>
<iothreads>1</iothreads>
<cputune>
<vcpupin vcpu="0" cpuset="0"/>
<vcpupin vcpu="1" cpuset="1"/>
<vcpupin vcpu="2" cpuset="2"/>
<vcpupin vcpu="3" cpuset="3"/>
<vcpupin vcpu="4" cpuset="4"/>
<vcpupin vcpu="5" cpuset="5"/>
<vcpupin vcpu="6" cpuset="6"/>
<vcpupin vcpu="7" cpuset="7"/>
<vcpupin vcpu="8" cpuset="8"/>
<vcpupin vcpu="9" cpuset="9"/>
<vcpupin vcpu="10" cpuset="10"/>
<vcpupin vcpu="11" cpuset="11"/>
<vcpupin vcpu="12" cpuset="12"/>
<vcpupin vcpu="13" cpuset="13"/>
<vcpupin vcpu="14" cpuset="14"/>
<vcpupin vcpu="15" cpuset="15"/>
<emulatorpin cpuset="0,1"/>
<iothreadpin iothread="1" cpuset="0,1"/>
</cputune>
...
To enable Multithreading on AMD CPUs for the KVM, edit the config:
...
<cpu mode='host-passthrough' check='none' migratable="on">
<cache mode="passthrough"/>
...
<feature policy="require" name="invtsc"/>
<feature policy='require' name='topoext'/>
</cpu>
...
To hide the fact that the Machine is Virtualized, adjust the config:
...
<os firmware="efi">
...
<smbios mode="host"/>
</os>
<sysinfo type="smbios">
<bios>
<entry name="vendor">American Megatrends Inc.</entry>
<entry name="version">F11d</entry>
<entry name="date">09/14/2023</entry>
</bios>
<system>
<entry name="manufacturer">Gigabyte Technology Co., Ltd.</entry>
<entry name="product">X670 AORUS ELITE AX</entry>
<entry name="version">x.x</entry>
<entry name="serial">Default string</entry>
<entry name="uuid"> (The KVM UUID from under Domain) </entry>
<entry name="sku">Default string</entry>
<entry name="family">X670 MB</entry>
</system>
</sysinfo>
<features>
...
<hyperv mode="passthrough">
<relaxed state="on"/>
<vapic state="on"/>
<spinlocks state="on" retries="8191"/>
<vpindex state="on"/>
<runtime state="on"/>
<synic state="on"/>
<stimer state="on">
<direct state="on"/>
</stimer>
<reset state="on"/>
<vendor_id state="on" value="FckYouBudge"/>
<frequencies state="on"/>
<reenlightenment state="on"/>
<tlbflush state="on"/>
<ipi state="on"/>
<evmcs state="off"/>
</hyperv>
<kvm>
<hidden state="on"/>
</kvm>
...
</features>
...
<cpu>
...
<feature policy="disable" name="hypervisor"/>
<feature policy="require" name="svm"/> for AMD or <feature policy="require" name="vmx"/> for INTEL
</cpu>
...
<clock offset="utc">
<timer name="pit" tickpolicy="delay"/>
<timer name="rtc" tickpolicy="catchup" track="guest"/>
<timer name="hpet" present="no"/>
<timer name="tsc" present="yes" mode="native"/>
<timer name="hypervclock" present="yes"/>
</clock>
...
Enable a feature called "CPUID faulting"
CPUID faulting allows a hypervisor or virtual machine to intercept and handle certain CPUID instructions that are typically used by guest operating systems to detect and manage virtualization. By intercepting these instructions, the hypervisor can provide more efficient and secure virtualization, as well as hide information about the underlying hardware from the guest.
For this, add clearcpuid=514 to your Kernel Parameter.
Open /etc/default/grub in a File editor and at the Parameter

/etc/default/grub
Regenerate your Grub Config!sudo grub-mkconfig -o /boot/grub/grub.cfg ← This command depends on your distro and setup!
https://wiki.archlinux.org/title/PCI_passthrough_via_OVMF
https://docs.vrchat.com/docs/using-vrchat-in-a-virtual-machine
Reddit → r/vfio