[PATCH v3 1/3] kvm, vmx: move CR2 context switch out of assembly path

2018-11-01 Thread Julian Stecklina
The VM entry/exit path is a giant inline assembly statement. Simplify it by doing CR2 context switching in plain C. Move CR2 restore behind IBRS clearing, so we reduce the amount of code we execute with IBRS on. Using {read,write}_cr2() means KVM will use pv_mmu_ops instead of open coding

[PATCH v3 1/3] kvm, vmx: move CR2 context switch out of assembly path

2018-11-01 Thread Julian Stecklina
The VM entry/exit path is a giant inline assembly statement. Simplify it by doing CR2 context switching in plain C. Move CR2 restore behind IBRS clearing, so we reduce the amount of code we execute with IBRS on. Using {read,write}_cr2() means KVM will use pv_mmu_ops instead of open coding