linux/arch/x86/kvm/vmx
Peter Xu ff5a983cbb KVM: X86: Don't track dirty for KVM_SET_[TSS_ADDR|IDENTITY_MAP_ADDR]
Originally, we have three code paths that can dirty a page without
vcpu context for X86:

  - init_rmode_identity_map
  - init_rmode_tss
  - kvmgt_rw_gpa

init_rmode_identity_map and init_rmode_tss will be setup on
destination VM no matter what (and the guest cannot even see them), so
it does not make sense to track them at all.

To do this, allow __x86_set_memory_region() to return the userspace
address that just allocated to the caller.  Then in both of the
functions we directly write to the userspace address instead of
calling kvm_write_*() APIs.

Another trivial change is that we don't need to explicitly clear the
identity page table root in init_rmode_identity_map() because no
matter what we'll write to the whole page with 4M huge page entries.

Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <20201001012044.5151-4-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-11-15 09:49:12 -05:00
..
capabilities.h KVM: VMX: Rename RDTSCP secondary exec control name to insert "ENABLE" 2020-09-28 07:57:30 -04:00
evmcs.c KVM: x86: hyper-v: allow KVM_GET_SUPPORTED_HV_CPUID as a system ioctl 2020-11-15 09:49:11 -05:00
evmcs.h KVM: VMX: eVMCS: make evmcs_sanitize_exec_ctrls() work again 2020-10-31 10:27:58 -04:00
nested.c KVM: x86: emulate wait-for-SIPI and SIPI-VMExit 2020-11-15 09:49:09 -05:00
nested.h KVM: nVMX: check for required but missing VMCS12 in KVM_SET_NESTED_STATE 2020-07-27 09:04:49 -04:00
pmu_intel.c KVM: x86: move MSR_IA32_PERF_CAPABILITIES emulation to common x86 code 2020-07-10 12:52:56 -04:00
posted_intr.c KVM: vmx: rename pi_init to avoid conflict with paride 2020-10-24 04:09:54 -04:00
posted_intr.h KVM: vmx: rename pi_init to avoid conflict with paride 2020-10-24 04:09:54 -04:00
vmcs12.c KVM: nVMX: Remove non-functional "support" for CR3 target values 2020-04-21 09:13:09 -04:00
vmcs12.h KVM: nVMX: Remove non-functional "support" for CR3 target values 2020-04-21 09:13:09 -04:00
vmcs_shadow_fields.h KVM: Fix some out-dated function names in comment 2020-01-21 13:57:27 +01:00
vmcs.h KVM: VMX: Add a helper to test for a valid error code given an intr info 2020-09-28 07:57:50 -04:00
vmenter.S KVM: VMX: Move IRQ invocation to assembly subroutine 2020-09-28 07:57:20 -04:00
vmx_ops.h KVM: VMX: Rename ops.h to vmx_ops.h 2020-09-28 07:57:38 -04:00
vmx.c KVM: X86: Don't track dirty for KVM_SET_[TSS_ADDR|IDENTITY_MAP_ADDR] 2020-11-15 09:49:12 -05:00
vmx.h KVM: x86: Move vendor CR4 validity check to dedicated kvm_x86_ops hook 2020-11-15 09:49:07 -05:00