-
Notifications
You must be signed in to change notification settings - Fork 878
Add IOCTL to support haxm max vcpu value query #287
base: master
Are you sure you want to change the base?
Conversation
47e6f4d
to
a92e878
Compare
The NetBSD part looks good, however I would keep |
ddbf30a
to
6b4cfb0
Compare
Thanks for you review! I have updated the code, please take a look~ |
Looks good to me, maybe we could update the comment |
Do you mean to add a comment // TODO: Handle 64 VCPUS ? |
Yes. I would rephrase the existing comment to: |
Thanks for your suggestion! I have updated the code~ |
platforms/windows/hax_entry.c
Outdated
@@ -714,6 +715,16 @@ NTSTATUS HaxDeviceControl(PDEVICE_OBJECT DeviceObject, | |||
infret = sizeof(uint32_t); | |||
ret = STATUS_SUCCESS; | |||
break; | |||
case HAX_IOCTL_CAP_MAX_VCPU: | |||
if (outBufLength < sizeof(uint32_t)) { | |||
Irp->IoStatus.Information = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Irp->IoStatus.Information is changed after done:
done:
Irp->IoStatus.Status = ret;
Irp->IoStatus.Information = infret;
infret is zero after init, so this line (Irp->IoStatus.Information = 0;) is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your suggestion! I have updated the code~
This commit tried to add ioctl HAX_IOCTL_CAP_MAX_VCPU that will return the HAXM max vcpu support. Also, the switch case for Linux hax and vm device add return -ENOSYS in the default case. Moreover, the max HAXM vcpu value is updated from 16 to 64 (netbsd still 16). Previously, HAXM doesn't support IOCTL that would return the max vcpu value. This issue is resolved by adding a new IOCTL HAX_IOCTL_CAP_MAX_VCPU that will simply return HAX_MAX_VCPUS. (IOCTL naming credit to KVM) This commit results in if QEMU calls this IOCTL, it will get the max vcpu value HAXM driver supported and can then compare it with the QEMU max value and smp value to determine whether the smp value is valid. Signed-off-by: WangBowen <bowen.wang@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
How this feature will be used, is there any patch for qemu? |
Basically, this feature will be used for QEMU to obtain the maximum vcpu HAXM supported when creating the vm to check whether the requested vcpu number is valid. Also, as PR#255 supports more host cpus, we proceed to support more vcpus. (deals with Issue#195. And there will be a qemu patch (already in review process). |
563eb1b
to
6b942e3
Compare
b73a231
to
da1b8ec
Compare
This commit tried to add ioctl HAX_IOCTL_CAP_MAX_VCPU that will return
the HAXM max vcpu support. Also, the switch case for hax device and vm
device add return -ENOSYS in the default case. Moreover, the max HAXM
supported vcpu value is updated from 16 to 64. Previously, HAXM doesn't
support IOCTL that would return the max vcpu value.
This issue is resolved by adding a new IOCTL HAX_IOCTL_CAP_MAX_VCPU that
will simply return HAX_MAX_VCPUS. (IOCTL naming credit to KVM)
This commit results in if QEMU calls this IOCTL, it will get the max
vcpu value HAXM driver supported and can then compare it with the QEMU
max value and smp value to determine whether the smp value is valid.
Signed-off-by: WangBowen bowen.wang@intel.com