mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
cpu_ppc64: Add support for host-model on POWER9
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
ec9f3950e3
commit
5c8c2d1633
@ -92,22 +92,22 @@ ppc64CheckCompatibilityMode(const char *host_model,
|
||||
if (!compat_mode)
|
||||
return VIR_CPU_COMPARE_IDENTICAL;
|
||||
|
||||
/* Valid host CPUs: POWER6, POWER7, POWER8 */
|
||||
/* Valid host CPUs: POWER6, POWER7, POWER8, POWER9 */
|
||||
if (!STRPREFIX(host_model, "POWER") ||
|
||||
!(tmp = (char *) host_model + strlen("POWER")) ||
|
||||
virStrToLong_i(tmp, NULL, 10, &host) < 0 ||
|
||||
host < 6 || host > 8) {
|
||||
host < 6 || host > 9) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
"%s",
|
||||
_("Host CPU does not support compatibility modes"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Valid compatibility modes: power6, power7, power8 */
|
||||
/* Valid compatibility modes: power6, power7, power8, power9 */
|
||||
if (!STRPREFIX(compat_mode, "power") ||
|
||||
!(tmp = (char *) compat_mode + strlen("power")) ||
|
||||
virStrToLong_i(tmp, NULL, 10, &compat) < 0 ||
|
||||
compat < 6 || compat > 8) {
|
||||
compat < 6 || compat > 9) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unknown compatibility mode %s"),
|
||||
compat_mode);
|
||||
|
@ -0,0 +1,24 @@
|
||||
LC_ALL=C \
|
||||
PATH=/bin \
|
||||
HOME=/home/test \
|
||||
USER=test \
|
||||
LOGNAME=test \
|
||||
QEMU_AUDIO_DRV=none \
|
||||
/usr/bin/qemu-system-ppc64 \
|
||||
-name QEMUGuest1 \
|
||||
-S \
|
||||
-M pseries \
|
||||
-cpu host,compat=power9 \
|
||||
-m 256 \
|
||||
-smp 4,sockets=4,cores=1,threads=1 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
-nographic \
|
||||
-nodefconfig \
|
||||
-nodefaults \
|
||||
-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-QEMUGuest1/monitor.sock,\
|
||||
server,nowait \
|
||||
-mon chardev=charmonitor,id=monitor,mode=readline \
|
||||
-boot c \
|
||||
-usb \
|
||||
-chardev pty,id=charserial0 \
|
||||
-device spapr-vty,chardev=charserial0,reg=0x30000000
|
@ -0,0 +1,21 @@
|
||||
<domain type='kvm'>
|
||||
<name>QEMUGuest1</name>
|
||||
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||
<memory unit='KiB'>219100</memory>
|
||||
<currentMemory unit='KiB'>219100</currentMemory>
|
||||
<vcpu placement='static'>4</vcpu>
|
||||
<os>
|
||||
<type arch='ppc64' machine='pseries'>hvm</type>
|
||||
</os>
|
||||
<cpu mode='host-model'>
|
||||
<model>power9</model>
|
||||
</cpu>
|
||||
<clock offset='utc'/>
|
||||
<devices>
|
||||
<emulator>/usr/bin/qemu-system-ppc64</emulator>
|
||||
<console type='pty'>
|
||||
<address type="spapr-vio"/>
|
||||
</console>
|
||||
<memballoon model="none"/>
|
||||
</devices>
|
||||
</domain>
|
@ -1673,6 +1673,13 @@ mymain(void)
|
||||
QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG);
|
||||
DO_TEST("pseries-cpu-le", QEMU_CAPS_KVM,
|
||||
QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG);
|
||||
DO_TEST_FAILURE("pseries-cpu-compat-power9", QEMU_CAPS_KVM);
|
||||
|
||||
qemuTestSetHostCPU(driver.caps, cpuPower9);
|
||||
DO_TEST("pseries-cpu-compat-power9",
|
||||
QEMU_CAPS_KVM, QEMU_CAPS_CHARDEV, QEMU_CAPS_NODEFCONFIG);
|
||||
qemuTestSetHostCPU(driver.caps, NULL);
|
||||
|
||||
qemuTestSetHostArch(driver.caps, VIR_ARCH_NONE);
|
||||
|
||||
DO_TEST("pseries-panic-missing",
|
||||
|
@ -17,6 +17,7 @@
|
||||
virCPUDefPtr cpuDefault;
|
||||
virCPUDefPtr cpuHaswell;
|
||||
virCPUDefPtr cpuPower8;
|
||||
virCPUDefPtr cpuPower9;
|
||||
|
||||
static virCPUFeatureDef cpuDefaultFeatures[] = {
|
||||
{ (char *) "ds", -1 },
|
||||
@ -94,6 +95,15 @@ static virCPUDef cpuPower8Data = {
|
||||
.threads = 8,
|
||||
};
|
||||
|
||||
static virCPUDef cpuPower9Data = {
|
||||
.type = VIR_CPU_TYPE_HOST,
|
||||
.arch = VIR_ARCH_PPC64,
|
||||
.model = (char *) "POWER9",
|
||||
.sockets = 1,
|
||||
.cores = 16,
|
||||
.threads = 1,
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
TEST_UTILS_QEMU_BIN_I686,
|
||||
TEST_UTILS_QEMU_BIN_X86_64,
|
||||
@ -467,7 +477,8 @@ virCapsPtr testQemuCapsInit(void)
|
||||
|
||||
if (!(cpuDefault = virCPUDefCopy(&cpuDefaultData)) ||
|
||||
!(cpuHaswell = virCPUDefCopy(&cpuHaswellData)) ||
|
||||
!(cpuPower8 = virCPUDefCopy(&cpuPower8Data)))
|
||||
!(cpuPower8 = virCPUDefCopy(&cpuPower8Data)) ||
|
||||
!(cpuPower9 = virCPUDefCopy(&cpuPower9Data)))
|
||||
goto cleanup;
|
||||
|
||||
qemuTestSetHostCPU(caps, NULL);
|
||||
|
@ -21,6 +21,7 @@ virQEMUCapsPtr qemuTestParseCapabilities(virCapsPtr caps,
|
||||
extern virCPUDefPtr cpuDefault;
|
||||
extern virCPUDefPtr cpuHaswell;
|
||||
extern virCPUDefPtr cpuPower8;
|
||||
extern virCPUDefPtr cpuPower9;
|
||||
|
||||
void qemuTestSetHostArch(virCapsPtr caps,
|
||||
virArch arch);
|
||||
|
Loading…
Reference in New Issue
Block a user