Re: [PATCH] KVM: VMX: Fix commit which broke PML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Nov 22, 2016 at 04:43:51PM +0100, Paolo Bonzini wrote:
> From: Kai Huang <kai.huang@xxxxxxxxxxxxxxx>
>
> [ upstream commit feda805fe7c4ed9cf78158e73b1218752e3b4314, for 4.1.y only.
>   The symptoms are not as bad as they were when the upstream patch went
>   in, but it still fixes an ugly call trace on VM shutdown and prepares
>   for the next patch. ]
>
> I found PML was broken since below commit:
>
> 	commit feda805fe7c4ed9cf78158e73b1218752e3b4314
> 	Author: Xiao Guangrong <guangrong.xiao@xxxxxxxxxxxxxxx>
> 	Date:   Wed Sep 9 14:05:55 2015 +0800
>
> 	KVM: VMX: unify SECONDARY_VM_EXEC_CONTROL update
>
> 	Unify the update in vmx_cpuid_update()
>
> 	Signed-off-by: Xiao Guangrong <guangrong.xiao@xxxxxxxxxxxxxxx>
> 	[Rewrite to use vmcs_set_secondary_exec_control. - Paolo]
> 	Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>
>
> The reason is in above commit vmx_cpuid_update calls vmx_secondary_exec_control,
> in which currently SECONDARY_EXEC_ENABLE_PML bit is cleared unconditionally (as
> PML is enabled in creating vcpu). Therefore if vcpu_cpuid_update is called after
> vcpu is created, PML will be disabled unexpectedly while log-dirty code still
> thinks PML is used.
>
> Fix this by clearing SECONDARY_EXEC_ENABLE_PML in vmx_secondary_exec_control
> only when PML is not supported or not enabled (!enable_pml). This is more
> reasonable as PML is currently either always enabled or disabled. With this
> explicit updating SECONDARY_EXEC_ENABLE_PML in vmx_enable{disable}_pml is not
> needed so also rename vmx_enable{disable}_pml to vmx_create{destroy}_pml_buffer.
>
> Fixes: feda805fe7c4ed9cf78158e73b1218752e3b4314
> Signed-off-by: Kai Huang <kai.huang@xxxxxxxxxxxxxxx>
> [While at it, change a wrong ASSERT to an "if".  The condition can happen
>  if creating the VCPU fails with ENOMEM. - Paolo]
> Signed-off-by: Paolo Bonzini <pbonzini@xxxxxxxxxx>

Tested-by: Greg Edwards <gedwards@xxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]