kvm-hint-dedicated requires host CPU passthrough?

Hi, libvirt refuses to set KVM_HINTS_DEDICATED when the CPU model is not host-passthrough. Is there a reason for this limitation? My understanding is that KVM_HINTS_DEDICATED means the vCPU is pinned to a host CPU that is not shared with other tasks. Any KVM vCPU should be able to support this feature, regardless of whether host-passthrough is used or not. Stefan

On 20/05/20 19:13, Stefan Hajnoczi wrote:
Hi, libvirt refuses to set KVM_HINTS_DEDICATED when the CPU model is not host-passthrough.
Is there a reason for this limitation?
My understanding is that KVM_HINTS_DEDICATED means the vCPU is pinned to a host CPU that is not shared with other tasks. Any KVM vCPU should be able to support this feature, regardless of whether host-passthrough is used or not.
Perhaps it's because KVM_HINTS_DEDICATED enables mwait passthrough, and the details of mwait vary per CPU model? Paolo

On Wed, May 20, 2020 at 07:23:32PM +0200, Paolo Bonzini wrote:
On 20/05/20 19:13, Stefan Hajnoczi wrote:
Hi, libvirt refuses to set KVM_HINTS_DEDICATED when the CPU model is not host-passthrough.
Is there a reason for this limitation?
My understanding is that KVM_HINTS_DEDICATED means the vCPU is pinned to a host CPU that is not shared with other tasks. Any KVM vCPU should be able to support this feature, regardless of whether host-passthrough is used or not.
Perhaps it's because KVM_HINTS_DEDICATED enables mwait passthrough, and the details of mwait vary per CPU model?
KVM_HINTS_DEDICATED (now known as KVM_HINTS_REALTIME) is also used by cpuidle-haltpoll. In that case we don't care about mwait. CPU passthrough can prevent live migration, so I think we should relax this check, if possible. Wim: Can you let us know what the original intention of checking for cpu-passthrough was? Thanks, Stefan

Oh, I also see that my claws-mail filters are in chaos and that there's additional email to this mail-thread. On Thu, 21 May 2020 16:14:34 +0100 Stefan Hajnoczi <stefanha@redhat.com> wrote:
On Wed, May 20, 2020 at 07:23:32PM +0200, Paolo Bonzini wrote:
On 20/05/20 19:13, Stefan Hajnoczi wrote:
Hi, libvirt refuses to set KVM_HINTS_DEDICATED when the CPU model is not host-passthrough.
Is there a reason for this limitation?
My understanding is that KVM_HINTS_DEDICATED means the vCPU is pinned to a host CPU that is not shared with other tasks. Any KVM vCPU should be able to support this feature, regardless of whether host-passthrough is used or not.
Perhaps it's because KVM_HINTS_DEDICATED enables mwait passthrough, and the details of mwait vary per CPU model?
KVM_HINTS_DEDICATED (now known as KVM_HINTS_REALTIME) is also used by cpuidle-haltpoll. In that case we don't care about mwait.
CPU passthrough can prevent live migration, so I think we should relax this check, if possible.
I agree, the check for <cpu mode='host-passthrough'/> should be relaxed.
Wim: Can you let us know what the original intention of checking for cpu-passthrough was?
From our, my proposed, point of view it was. But that seems silly indeed.
Rgds, - Wim10H.
Thanks, Stefan

Hi Stefan, sorry for my very late response as I was temporarily out and unfortunately missed this email thread. For your question (remark), yes, you're right. This feature should not apply to specific <cpu mode='host-passthrough'... /> scenario. Something else to look into is that the feature can only work if the serving layer underneath by capabilities does support the request. Short, yes, this needs correction. - Wim10H. On Wed, 20 May 2020 18:13:57 +0100 Stefan Hajnoczi <stefanha@redhat.com> wrote:
Hi, libvirt refuses to set KVM_HINTS_DEDICATED when the CPU model is not host-passthrough.
Is there a reason for this limitation?
My understanding is that KVM_HINTS_DEDICATED means the vCPU is pinned to a host CPU that is not shared with other tasks. Any KVM vCPU should be able to support this feature, regardless of whether host-passthrough is used or not.
Stefan

On Mon, Jun 29, 2020 at 01:58:13PM +0200, Wim ten Have wrote:
Hi Stefan, sorry for my very late response as I was temporarily out and unfortunately missed this email thread.
For your question (remark), yes, you're right. This feature should not apply to specific <cpu mode='host-passthrough'... /> scenario. Something else to look into is that the feature can only work if the serving layer underneath by capabilities does support the request.
Short, yes, this needs correction.
Thank you! I have filed a bugzilla so that this issue is tracked: https://bugzilla.redhat.com/show_bug.cgi?id=1857671 Maybe someone will have time to work on it. Stefan
participants (3)
-
Paolo Bonzini
-
Stefan Hajnoczi
-
Wim ten Have