KVM: arm64: Stop mapping current thread_info at EL2
authorMarc Zyngier <maz@kernel.org>
Thu, 21 Oct 2021 13:18:00 +0000 (14:18 +0100)
committerMarc Zyngier <maz@kernel.org>
Mon, 22 Nov 2021 16:01:39 +0000 (16:01 +0000)
Now that we can track an equivalent of TIF_FOREIGN_FPSTATE, drop
the mapping of current's thread_info at EL2.

Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/fpsimd.c
arch/arm64/kvm/hyp/include/hyp/switch.h
arch/arm64/kvm/hyp/nvhe/switch.c
arch/arm64/kvm/hyp/vhe/switch.c

index 9f1703e..dd5810e 100644 (file)
@@ -26,7 +26,6 @@
 #include <asm/fpsimd.h>
 #include <asm/kvm.h>
 #include <asm/kvm_asm.h>
-#include <asm/thread_info.h>
 
 #define __KVM_HAVE_ARCH_INTC_INITIALIZED
 
@@ -321,7 +320,6 @@ struct kvm_vcpu_arch {
        struct kvm_guest_debug_arch vcpu_debug_state;
        struct kvm_guest_debug_arch external_debug_state;
 
-       struct thread_info *host_thread_info;   /* hyp VA */
        struct user_fpsimd_state *host_fpsimd_state;    /* hyp VA */
 
        struct {
index a18b9c1..b5b59b9 100644 (file)
@@ -7,7 +7,6 @@
  */
 #include <linux/irqflags.h>
 #include <linux/sched.h>
-#include <linux/thread_info.h>
 #include <linux/kvm_host.h>
 #include <asm/fpsimd.h>
 #include <asm/kvm_asm.h>
@@ -28,17 +27,9 @@ int kvm_arch_vcpu_run_map_fp(struct kvm_vcpu *vcpu)
 {
        int ret;
 
-       struct thread_info *ti = &current->thread_info;
        struct user_fpsimd_state *fpsimd = &current->thread.uw.fpsimd_state;
 
-       /*
-        * Make sure the host task thread flags and fpsimd state are
-        * visible to hyp:
-        */
-       ret = create_hyp_mappings(ti, ti + 1, PAGE_HYP);
-       if (ret)
-               goto error;
-
+       /* Make sure the host task fpsimd state is visible to hyp: */
        ret = create_hyp_mappings(fpsimd, fpsimd + 1, PAGE_HYP);
        if (ret)
                goto error;
@@ -54,7 +45,6 @@ int kvm_arch_vcpu_run_map_fp(struct kvm_vcpu *vcpu)
                        goto error;
        }
 
-       vcpu->arch.host_thread_info = kern_hyp_va(ti);
        vcpu->arch.host_fpsimd_state = kern_hyp_va(fpsimd);
 error:
        return ret;
index a243a2a..11e8580 100644 (file)
@@ -29,7 +29,6 @@
 #include <asm/fpsimd.h>
 #include <asm/debug-monitors.h>
 #include <asm/processor.h>
-#include <asm/thread_info.h>
 
 struct kvm_exception_table_entry {
        int insn, fixup;
index c0e3fed..329c706 100644 (file)
@@ -25,7 +25,6 @@
 #include <asm/fpsimd.h>
 #include <asm/debug-monitors.h>
 #include <asm/processor.h>
-#include <asm/thread_info.h>
 
 #include <nvhe/fixed_config.h>
 #include <nvhe/mem_protect.h>
index 5a2cb5d..1d162b9 100644 (file)
@@ -24,7 +24,6 @@
 #include <asm/fpsimd.h>
 #include <asm/debug-monitors.h>
 #include <asm/processor.h>
-#include <asm/thread_info.h>
 
 /* VHE specific context */
 DEFINE_PER_CPU(struct kvm_host_data, kvm_host_data);