lkml.org 
[lkml]   [2021]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RESEND PATCH ] KVM: VMX: Enable/disable PML when dirty logging gets enabled/disabled
Date
On 10/02/21 22:23, Makarand Sonare wrote:
> +void vmx_update_pml_in_vmcs(struct kvm_vcpu *vcpu)
> +{
> + if (cpu_has_secondary_exec_ctrls()) {
> + if (is_guest_mode(vcpu)) {
> + to_vmx(vcpu)->nested.deferred_update_pml_vmcs = true;
> + return;
> + }
> +
> + if (vcpu->kvm->arch.pml_enabled)
> + vmcs_set_bits(SECONDARY_VM_EXEC_CONTROL,
> + SECONDARY_EXEC_ENABLE_PML);
> + else
> + vmcs_clear_bits(SECONDARY_VM_EXEC_CONTROL,
> + SECONDARY_EXEC_ENABLE_PML);
> + }
> +}


Since the execution controls are shadowed, they can be read quite
efficiently. This means that there's no need for
vcpu->kvm->arch.pml_enabled, and also that the copy can be done
unconditionally in prepare_vmcs02 and nested_vmx_vmexit.

If the above is not true, we should at least combine
change_vmcs01_virtual_apic_mode, reload_vmcs01_apic_access_page and the
new field in a single bit field, for example
vmx->nested.dirty_vmcs01_fields or vmx->nested.vmexit_requests.

In any case I expect Sean to take care of submitting this patch and I
have to do nothing more about it, right?

Paolo

\
 
 \ /
  Last update: 2021-02-11 10:16    [W:0.195 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site