Bug 1851247

Summary: Interface for querying supported HyperV Enlightenments
Product: Red Hat Enterprise Linux 9 Reporter: Eduardo Habkost <ehabkost>
Component: qemu-kvmAssignee: Vitaly Kuznetsov <vkuznets>
qemu-kvm sub component: CPU Models QA Contact: menli <menli>
Status: CLOSED CURRENTRELEASE Docs Contact:
Severity: unspecified    
Priority: unspecified CC: ailan, blc, jinzhao, juzhang, qizhu, ribarry, virt-maint, vkuznets, yuhuang
Version: unspecifiedKeywords: FutureFeature, Triaged
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-12-25 07:26:57 UTC Type: Feature Request
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1997408    
Bug Blocks: 1624786, 1717611    

Description Eduardo Habkost 2020-06-25 21:54:22 UTC
This bug was initially created as a copy of libvirt Bug #1717611.  qemu-kvm doesn't provide this information, so we need to implement an interface that libvirt can use to query hyperv enlightenments supported by the host.

I suggest using the existing CPU feature query interface for this (query-cpu-model-expansion type=full with model="host" and model="max").

Original bug #1717611 description:

Management software needs to be able to query which HyperV Enlightenments are supported by the current host.  The availability of HyperV Enlightenments depends on capabilities available in the KVM kernel module, in QEMU, and in libvirt.

Comment 1 Eduardo Habkost 2020-06-25 21:59:44 UTC
This is supposed to work, but doesn't seem to work today:

  query-cpu-model-expansion type=full model={"name":"host","props":{"hv-passthrough":true}}

Probably because hv_cpuid_check_and_set() isn't called at feature expansion time.

Comment 2 John Ferlan 2020-07-03 12:48:37 UTC
Rick - this seems like something Vitaly would handle - although perhaps the component/sub-subcomponent/pool would need to be adjusted.

Comment 6 Vitaly Kuznetsov 2020-09-04 15:09:48 UTC
Upstream work started.

KVM patches suggested:
https://lore.kernel.org/kvm/20200807083946.377654-1-vkuznets@redhat.com/

QEMU patches suggested:
https://lists.gnu.org/archive/html/qemu-devel/2020-09/msg02017.html

Comment 9 Vitaly Kuznetsov 2021-07-16 14:09:34 UTC
We have all the required bits upstream but the series is quite big and I was wondering if it would make sense to try to backport this for 8.5 or not.

Eduardo, are you aware of any particular users of this new interface? In particular, do you know if libvirt is working on a related feature?

Comment 10 Eduardo Habkost 2021-07-16 16:52:32 UTC
(In reply to Vitaly Kuznetsov from comment #9)
> We have all the required bits upstream but the series is quite big and I was
> wondering if it would make sense to try to backport this for 8.5 or not.
> 
> Eduardo, are you aware of any particular users of this new interface? In
> particular, do you know if libvirt is working on a related feature?

I don't think we need it in 8.5.  We were not planning to use this interface in 8.5 because we thought the hyperv=on boolean (bug 1877467) would work for us.

The libvirt side of this feature is being tracked at bug 1717611.

Comment 11 Vitaly Kuznetsov 2021-07-19 07:52:14 UTC
(In reply to Eduardo Habkost from comment #10)
> 
> I don't think we need it in 8.5.  We were not planning to use this interface
> in 8.5 because we thought the hyperv=on boolean (bug 1877467) would work for
> us.

OK, I'm not backporting patches then, we'll get them with the next rebase. Thanks!

Comment 12 John Ferlan 2021-09-09 13:32:34 UTC
Bulk update: Move RHEL-AV bugs to RHEL9. If necessary to resolve in RHEL8, then clone to the current RHEL8 release.

Comment 13 menli@redhat.com 2021-11-25 06:06:04 UTC
Hi Vitaly,

Whether we could move this bug to modify status, as it already works on qemu 6.1. or still wait for other related patch?

details:
qemp command:
{ "execute":"query-cpu-model-expansion","arguments":{"type":"full","model":{"name":"host","props":{"hv-passthrough":true}}}}

test on qemu-kvm-6.1.0-1.module+el8.6.0+12721+8d053ff2.x86_64 before, the result is like: '.."hv-relaxed": true, "avx512-fp16": false, "hv-crash": true,..'
also try it on qemu-kvm-4.2.0-59.module+el8.5.0+12817+cb650d43.x86_64 , the result is like: '.."hv-relaxed": false, "hv-crash": false..'

Thanks
Menghuan

Comment 15 Vitaly Kuznetsov 2021-11-25 10:06:37 UTC
(In reply to menli from comment #13)
> Hi Vitaly,
> 
> Whether we could move this bug to modify status, as it already works on qemu
> 6.1.

Yes, let's make this TestOnly dependent on QEMU rebase to 6.1 BZ and move to ON_QA.

Comment 16 menli@redhat.com 2021-11-25 10:59:03 UTC
Base on comment 13 and comment 15, change status to verified.

Comment 17 RHEL Program Management 2021-12-25 07:26:57 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.