qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 0/6] Adding the Android Emulator hypervisor driver accelerato


From: Paolo Bonzini
Subject: Re: [PATCH 0/6] Adding the Android Emulator hypervisor driver accelerator
Date: Tue, 4 Apr 2023 13:55:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

On 3/3/23 18:39, Haitao Shan wrote:
No, we're always open to new proposals. It merely means that it
might be harder to justify why the new hypervisor is a net benefit
for QEMU, when there is a competing solution supported by the OS
vendor.

Thanks for the clarification. It is great that the door is not shut completely.

Hi,

sorry for not answering before.

I think in general QEMU should be open to merging work from the Android Emulator. If AEHD is useful to the Android emulator, I would consider it interesting for QEMU as well.

However, I would rather have it as an extension to KVM if possible rather than a completely new emulator. One possibility is to introduce a new file that encapsulates all KVM ioctls, with a struct that encapsulates the Unix file descriptor/Windows HANDLE. For example

int kvm_ioctl_get_supported_cpuid(KVMState *s, struct kvm_cpuid *cpuid,
                                  int max)
{
    cpuid->nent = max;
#ifdef CONFIG_POSIX
    return ioctl(s, KVM_GET_SUPPORTED_VCPUID, cpuid);
#else
    size_t size = sizeof(*cpuid) + max * sizeof(*cpuid->entries);
return aehd_ioctl(s, AEHD_GET_SUPPORTED_CPUID, cpuid, size, cpuid, size);
#endif
}

int kvm_ioctl_create_vcpu(KVMState *s, int vcpu_id, CPUState *out)
{
#ifdef CONFIG_POSIX
    out.kvm_fd = kvm_vm_ioctl(KVM_CREATE_VCPU, vcpu_id);
    return out.kvm_fd;
#else
    return aehd_vm_ioctl(s, AEHD_CREATE_VCPU, &vcpu_id, sizeof(vcpu_id),
                         &out.kvm_fd, sizeof(out.kvm_fd));
#endif
}

etc.

These are just general examples, the actual level of abstraction is up to you.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]