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