[Bug 277326] FreeBSD guest on QEMU with Hyper-V enlightenment on is no longer able to detect Hyper-V devices

2024-05-08 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277326

--- Comment #9 from Roger Pau Monné  ---
(In reply to ernis from comment #8)
I'm not doing any work on this because I think there's nothing to be fixed.

If FreeBSD runs on QEMU, and QEMU exposes part of the Viridian extensions, the
primary hypervisor should still be reported as QEMU, and hence the CPUID
detection is accurate.

The fact it was not like this originally is in my opinion a bug, and not a
behavior we should carry moving forward.

If there's a desire to use Viridian based extensions or devices on non-native
HyperV, then the HyperV code should be adjusted to deal with it.  It's however
complicated, as it's my understanding most hypervisors that expose part of the
Viridian extensions do so with Windows guests in mind only.  It's unclear
whether enabling both HyperV and native hypervisor virtualization assistances
or devices couldn't result in failure.

-- 
You are receiving this mail because:
You are the assignee for the bug.


[Bug 277326] FreeBSD guest on QEMU with Hyper-V enlightenment on is no longer able to detect Hyper-V devices

2024-05-08 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277326

er...@microsoft.com changed:

   What|Removed |Added

 CC||er...@microsoft.com

--- Comment #8 from er...@microsoft.com ---
Could you please provide the status of this bug?

-- 
You are receiving this mail because:
You are the assignee for the bug.


[Bug 277326] FreeBSD guest on QEMU with Hyper-V enlightenment on is no longer able to detect Hyper-V devices

2024-02-27 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277326

--- Comment #7 from Roger Pau Monné  ---
(In reply to Miroslav Lachman from comment #6)
That's the same on Xen, the first CPUID signature is the HyperV one, but the
following one is the Xen one, and we want to use the Xen one, as the Viridian
set of features emulated by Xen is not very complete and just tested against
Windows guests.  This was already discussed in the differential revision of the
change for Xen: https://reviews.freebsd.org/D43508

So the question boils down to whether FreeBSD wants to treat KVM with HyperV
extensions as HyperV or as KVM.  I think the latter, as KVM is the real
hypervisor, disguising as HyperV.

-- 
You are receiving this mail because:
You are the assignee for the bug.


[Bug 277326] FreeBSD guest on QEMU with Hyper-V enlightenment on is no longer able to detect Hyper-V devices

2024-02-27 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277326

Miroslav Lachman <000.f...@quip.cz> changed:

   What|Removed |Added

 CC||000.f...@quip.cz

--- Comment #6 from Miroslav Lachman <000.f...@quip.cz> ---
According to this document
https://www.qemu.org/docs/master/system/i386/hyperv.html
some thing looks like Hyper-V, but for others you can tell it's a KVM
hypervisor.

"When any set of the Hyper-V enlightenments is enabled, QEMU changes hypervisor
identification (CPUID 0x4000..0x400A) to Hyper-V. KVM identification
and features are kept in leaves 0x4100..0x4101."

-- 
You are receiving this mail because:
You are the assignee for the bug.


[Bug 277326] FreeBSD guest on QEMU with Hyper-V enlightenment on is no longer able to detect Hyper-V devices

2024-02-27 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277326

--- Comment #5 from Zhenlei Huang  ---
(In reply to Zhenlei Huang from comment #4)
> I see lots of comparing of vm_guest in hyperv device drivers. I guess they 
> should be removed to correctly probe Hyper-V devices, to correctly support 
> Hyper-V enlightenment feature.

In case KVM should be reported when Hyper-V enlightenmen is enabled.

# grep -r 'VM_GUEST_HV' sys/dev/hyperv
sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c:if (vm_guest ==
VM_GUEST_HV) {
sys/dev/hyperv/vmbus/vmbus.c:   if (device_get_unit(parent) != 0 || vm_guest !=
VM_GUEST_HV ||
sys/dev/hyperv/vmbus/vmbus.c:   if (device_get_unit(dev) != 0 || vm_guest !=
VM_GUEST_HV ||
sys/dev/hyperv/vmbus/vmbus.c:   if (vm_guest != VM_GUEST_HV || sc == NULL)
sys/dev/hyperv/vmbus/hyperv.c:  if (vm_guest == VM_GUEST_HV)
sys/dev/hyperv/vmbus/hyperv.c:  if (vm_guest != VM_GUEST_HV)
sys/dev/hyperv/vmbus/vmbus_res.c:   if (device_get_unit(dev) != 0 ||
vm_guest != VM_GUEST_HV ||
sys/dev/hyperv/vmbus/x86/hyperv_x86.c:  if (vm_guest != VM_GUEST_HV)
sys/dev/hyperv/vmbus/aarch64/hyperv_aarch64.c:  vm_guest = VM_GUEST_HV;
sys/dev/hyperv/hvsock/hv_sock.c:if (vm_guest != VM_GUEST_HV)
sys/dev/hyperv/netvsc/if_hn.c:  if (vm_guest != VM_GUEST_HV)

-- 
You are receiving this mail because:
You are the assignee for the bug.


[Bug 277326] FreeBSD guest on QEMU with Hyper-V enlightenment on is no longer able to detect Hyper-V devices

2024-02-27 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277326

--- Comment #4 from Zhenlei Huang  ---
(In reply to Roger Pau Monné from comment #3)
> Hm, I guess I'm a bit confused.
While debugging PR 274810, I see the behavior, that FreeBSD guests report
HyperV rather than KVM when Hyper-V enlightenment is enabled.

> If the hypervisor is KVM, shouldn't it be detected as KVM rather than HyperV?
I think KVM should be reported. But it seems everything goes right even HyperV
is reported.

> What's the benefit of using the HyperV enlightenments when running on 
> QEMU/KVM?
I think Microsoft people are more familiar with that. When debugging PR 274810
I read briefly the design of Hyper-V virtual devices. I think the design is
pretty clear and performant.

I see lots of comparing of vm_guest in hyperv device drivers. I guess they
should be removed to correctly probe Hyper-V devices, to correctly support
Hyper-V enlightenment feature.

-- 
You are receiving this mail because:
You are the assignee for the bug.


[Bug 277326] FreeBSD guest on QEMU with Hyper-V enlightenment on is no longer able to detect Hyper-V devices

2024-02-26 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277326

Mark Linimon  changed:

   What|Removed |Added

   Assignee|b...@freebsd.org|virtualization@FreeBSD.org

-- 
You are receiving this mail because:
You are the assignee for the bug.