Add fp/simd context switch function callable from host kernel mode.
Signed-off-by: Mario Smarduch
---
arch/arm/kvm/Makefile| 2 +-
arch/arm/kvm/fpsimd_switch.S | 47
2 files changed, 48 insertions(+), 1 deletion(-)
Current lazy fp/simd implementation switches hardware context on guest access
and again on exit to host, otherwise context switch is skipped. This patch
set builds on that functionality and executes a hardware context switch on
first time access and when vCPU is scheduled out or returns to user
Add helper functions to enable access to fp/smid on guest entry and save host
fpexc on vcpu put, check if fp/simd registers are dirty and add new vcpu
fields.
Signed-off-by: Mario Smarduch
---
arch/arm/include/asm/kvm_emulate.h | 42
Enable armv7 enhanced fp/simd context switch. Guest and host registers are only
context switched on first access and vcpu put.
Signed-off-by: Mario Smarduch
---
arch/arm/include/asm/kvm_host.h | 2 ++
arch/arm/kernel/asm-offsets.c | 1 +
arch/arm/kvm/arm.c
set_hcptr is no longer used so delete it.
Signed-off-by: Mario Smarduch
---
arch/arm/kvm/interrupts_head.S | 29 -
1 file changed, 29 deletions(-)
diff --git a/arch/arm/kvm/interrupts_head.S b/arch/arm/kvm/interrupts_head.S
index
Similar to armv7 add helper functions to enable access to fp/smid registers on
guest entry. Save guest fpexc32_el2 on vcpu_put, check if guest is 32 bit.
Save guest and restore host registers from host kernel, and check
if fp/simd registers are dirty, lastly add cptr_el2 vcpu field.
Enable armv8 enhanced fp/simd context switch. Guest and host registers are only
context switched on first access and vcpu put.
Signed-off-by: Mario Smarduch
---
arch/arm/kvm/arm.c | 13 +++--
arch/arm64/kernel/asm-offsets.c | 1 +