[libvirt] 'host-passthrough' for arm64

2014-01-20 Thread Oleg Strikov
Hello guys,

I'm trying to come up with basic OpenStack support for arm64 node.
I'd like to use 'libvirt_cpu_mode=host-passthrough' configuration option
with Nova which issues cpu mode='host-passthrough' to libvirt xml config.
But with this option passed libvirt crashes with 'error: unsupported
configuration: CPU specification not supported by hypervisor'.
This happens because the following handlers are not implemented (or
implemented as stubs) inside src/cpu/cpu_aarch64.c:
* AArch64Decode()
* AArch64Update()
* AArch64guestData()

To solve exactly this 'host-passthrough'-related issue that's enough to
have the following set of handlers:

AArch64Decode(...)
{
virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES, -1);

/* I don't know any way to detect 'cortex-a57' or any other armv8 CPU
for now */
/* But I don't think that we can meet anything else than cortex-a57 */

/* We may also put 'host' there to specifically point out that
qemu-aarch64 supports only '-cpu host' for now */
/* pm215 told me that the ETA for '-cpu cortex-a57' and friends is
around 3 months from now */

return !(VIR_STRDUP(cpu-model, host or cortex-a57) == 1);
}

static int AArch64Update(...)
{
/* qemu-aarch64 supports only '-cpu host' for now */

guest-match = VIR_CPU_MATCH_EXACT;
virCPUDefFreeModel(guest);
return virCPUDefCopyModel(guest, host, true);
}

static virCPUCompareResult
AArch64guestData(..)
{
return  VIR_CPU_COMPARE_IDENTICAL;
}

That's clear that these handlers provide just basic functionality
('host-passthrough'-only) and have to be extended in future.
But is it something we can commit for now?

Another way to deal with this issue is to adopt some code from PPC handlers
(including CPU model detection and best fit qemu configuration discovery).
But this way will be blocked until:
(1) I find any way to reliably detect CPU model on ARMv8 board (any ideas?)
(2) pm215 implements TCG for arm64

What is the best way to choose to come up with the commitable code?

Many thanks for your help!
Oleg
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Re: [libvirt] 'host-passthrough' for arm64

2014-01-20 Thread Cole Robinson
On 01/20/2014 08:19 AM, Oleg Strikov wrote:
 Hello guys,
 
 I'm trying to come up with basic OpenStack support for arm64 node.
 I'd like to use 'libvirt_cpu_mode=host-passthrough' configuration option with
 Nova which issues cpu mode='host-passthrough' to libvirt xml config.
 But with this option passed libvirt crashes with 'error: unsupported
 configuration: CPU specification not supported by hypervisor'.
 This happens because the following handlers are not implemented (or
 implemented as stubs) inside src/cpu/cpu_aarch64.c:
 * AArch64Decode()
 * AArch64Update()
 * AArch64guestData()
 
 To solve exactly this 'host-passthrough'-related issue that's enough to have
 the following set of handlers:
 
 AArch64Decode(...)
 {
 virCheckFlags(VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES, -1);
 
 /* I don't know any way to detect 'cortex-a57' or any other armv8 CPU for
 now */
 /* But I don't think that we can meet anything else than cortex-a57 */
 
 /* We may also put 'host' there to specifically point out that
 qemu-aarch64 supports only '-cpu host' for now */
 /* pm215 told me that the ETA for '-cpu cortex-a57' and friends is around
 3 months from now */
 
 return !(VIR_STRDUP(cpu-model, host or cortex-a57) == 1);
 }
 
 static int AArch64Update(...)
 {
 /* qemu-aarch64 supports only '-cpu host' for now */
 
 guest-match = VIR_CPU_MATCH_EXACT;
 virCPUDefFreeModel(guest);
 return virCPUDefCopyModel(guest, host, true);
 }
 
 static virCPUCompareResult
 AArch64guestData(..)
 {
 return  VIR_CPU_COMPARE_IDENTICAL;
 }
 
 That's clear that these handlers provide just basic functionality
 ('host-passthrough'-only) and have to be extended in future.
 But is it something we can commit for now?
 
 Another way to deal with this issue is to adopt some code from PPC handlers
 (including CPU model detection and best fit qemu configuration discovery).
 But this way will be blocked until:
 (1) I find any way to reliably detect CPU model on ARMv8 board (any ideas?)
 (2) pm215 implements TCG for arm64
 
 What is the best way to choose to come up with the commitable code?
 

IMO the above is fine, doesn't look like it should cause any compatibility
issues with a real implementation in the future, and allows launching
qemu-system-aarch64 with its preferred -cpu host flag. I'd say post the patch,
and if other folks disagree they can comment there.

Thanks,
Cole

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list