From nobody Thu Mar 28 11:14:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) client-ip=216.205.24.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1585071232; cv=none; d=zohomail.com; s=zohoarc; b=k+0Zdy8XclKa4jSdSkJzrQgYtPCPyyHqN4QqtbYM3itSnA1htsL7b8yMNK7MqoEKlwC/xgGbComucZNaW2B+kINrjTTlpzFBIqK0OoEU7oyhfkxTDmXStIjvBen95PxZ96OJ/TQKZMsQ4l2qS0xg2e6cUxFGlmQb6WiK5uz1WbM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585071232; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3OAKe1Qy0f6GodTqRSUPsqT7kSjr0ag2fCvS+lqb9Rs=; b=lV2jrwYeiTEjWZzULxJLhFEzD73nhJuOqhnyHX9DLBUmoFCti1aqkkQRh7lO14wiXqOjMBDbQRM4145rCQJPOI2ht4lTB4tMT8XGzVRLzwm5EuuzIB5qnoOaFafQfWldG16zM90190gznTTnrS0JHf4pzAH3am57TqgD6J6BtyY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by mx.zohomail.com with SMTPS id 1585071232603136.26121457141448; Tue, 24 Mar 2020 10:33:52 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-413-wIhWVkXOPduPu3s9INkqYA-1; Tue, 24 Mar 2020 13:33:49 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4FC9E1005510; Tue, 24 Mar 2020 17:33:43 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2077346; Tue, 24 Mar 2020 17:33:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BBEAF18089CD; Tue, 24 Mar 2020 17:33:41 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02OHXe5s032604 for ; Tue, 24 Mar 2020 13:33:41 -0400 Received: by smtp.corp.redhat.com (Postfix) id D665A10ABC94; Tue, 24 Mar 2020 17:33:40 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D1D2010ABC95 for ; Tue, 24 Mar 2020 17:33:39 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 009598F7838 for ; Tue, 24 Mar 2020 17:33:39 +0000 (UTC) Received: from mail-qv1-f67.google.com (mail-qv1-f67.google.com [209.85.219.67]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-7-U_csbu3gNqKC3cixTUrXEw-1; Tue, 24 Mar 2020 13:33:36 -0400 Received: by mail-qv1-f67.google.com with SMTP id o18so9640287qvf.1; Tue, 24 Mar 2020 10:33:36 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:a54:94b:6faa:a6b0:6b1b]) by smtp.gmail.com with ESMTPSA id z1sm14715213qtc.51.2020.03.24.10.33.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 10:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585071231; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=3OAKe1Qy0f6GodTqRSUPsqT7kSjr0ag2fCvS+lqb9Rs=; b=eu4Puj9P49jxQ5dFZvqiblo0btlYq/hEqhPDbUk8Kp8q5ugx7KAYU4foeZqdZE68vJjiSu j4VaDDFb6Dtk8RZJw5YPKteXpKkrBJRfYNTgi7iNP6L5KF5FKXPuRljzYEY7V/4pUsupVY WpwS4JJrf07tpE93nf4+laDD7GmtM1s= X-MC-Unique: wIhWVkXOPduPu3s9INkqYA-1 X-MC-Unique: U_csbu3gNqKC3cixTUrXEw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2UZYEQZOiGcrBa7jE61h77T1UbYYm95pMClzyDGbRTQ=; b=RoV/e4fqCN62CtL0t3TdM1X/B2WXk1u8I4AnwnYkD3XRujaqmDb0vtvvLVhqfON92g W9UFT3lg+2nbPZaGSyNPfT9pCFrXnn7CMye3Og+oJ+zN1wqfNSrie2sVpT6AmxHCcUj3 WX+c6h3irE+WeHycezvlL9RhKWSK0k4KyNggy2r4bjMEu9ehFmqpMA90gYLbby+dRjPx hPMncy06geJReFjvTCx5GpGeAJkJuxnXRzF2SckYZ7BazHKXlHNSML9WZ0TsthUr10nc qP6beEtWesrT2okYulgG3BHPED8p+tz8Z+0ns7TNiIecW1PKDcyMu2w/bqiHSADRqxBd kOaA== X-Gm-Message-State: ANhLgQ1WdQrwdrVhB9+lxxQVHtdpl2+mRGZ3xM1GAR9nryCScbzwp18t gNhBTM/fkFfI6AknPGI9kKRtYoiV X-Google-Smtp-Source: ADFU+vvRYiArMRbEiO4qAccTl91LR/3ztNndt++Xz00QrRqClcF5Nz2wnEBVanDX//R0AklFGdohaw== X-Received: by 2002:a0c:f5c8:: with SMTP id q8mr26900716qvm.106.1585071215705; Tue, 24 Mar 2020 10:33:35 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 1/4] qemu: avoid launching non-x86 guests with APIC-EOI setting Date: Tue, 24 Mar 2020 14:33:21 -0300 Message-Id: <20200324173324.891258-2-danielhb413@gmail.com> In-Reply-To: <20200324173324.891258-1-danielhb413@gmail.com> References: <20200324173324.891258-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 02OHXe5s032604 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza , abologna@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The "" feature, although it's available only for x86 guests, can be declared in the domain XML of other archs without errors. But setting its 'eoi' attribute will break QEMU. For "", in a ppc64 guest: qemu-kvm: Expected key=3Dvalue format, found +kvm_pv_eoi A similar error happens with eoi=3D'off'. One can argue that it's better to simply forbid launching non-x86 guests with "" declared in the XML - it is a feature that the architecture doesn't support and this would make it clearer about it. This is sensible, but there are non-x86 guests that are running with "" declared in the domain (and A LOT of guests running with "" for that matter, probably reminiscent of x86 templates that were reused for other archs) that will stop working if we go this route. A more subtle approach is to detect if the 'eoi' element is being set for non-x86 guests and warn the user about it with a better error message than the one QEMU provides. This is the new error message when any value is set for the 'eoi' element in a ppc64 XML: error: unsupported configuration: The 'eoi' attribute of the 'apic' feature is not supported for architecture 'ppc64' or machine type 'pseries'. Suggested-by: Andrea Bolognani Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=3D1236440 Signed-off-by: Daniel Henrique Barboza Reviewed-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 2c9fb47d17..73a65128c6 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5255,8 +5255,23 @@ qemuDomainDefValidateFeatures(const virDomainDef *de= f, } break; =20 - case VIR_DOMAIN_FEATURE_ACPI: case VIR_DOMAIN_FEATURE_APIC: + /* The kvm_pv_eoi feature is x86-only. */ + if (def->features[i] !=3D VIR_TRISTATE_SWITCH_ABSENT && + def->apic_eoi !=3D VIR_TRISTATE_SWITCH_ABSENT && + !ARCH_IS_X86(def->os.arch)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("The 'eoi' attribute of the '%s' feature " + "is not supported for architecture '%s' o= r " + "machine type '%s'"), + featureName, + virArchToString(def->os.arch), + def->os.machine); + return -1; + } + break; + + case VIR_DOMAIN_FEATURE_ACPI: case VIR_DOMAIN_FEATURE_PAE: case VIR_DOMAIN_FEATURE_HAP: case VIR_DOMAIN_FEATURE_VIRIDIAN: --=20 2.25.1 From nobody Thu Mar 28 11:14:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) client-ip=63.128.21.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1585071238; cv=none; d=zohomail.com; s=zohoarc; b=cRYdSDJsJ5SDlea5Dci2rcIRjAj9Y4cwsgltNyrXQ27jQ7WJOQYsQVTCt8upOsFzoi/1fDqDX9z71lyvqFTSYhUPcStOvszpvTIi37OYgjfyEsbFIzxqAub2JbEGp43ljbAtahrB9lxuqq9aqsYym/ozmzcq5qa4QqG48N2+gDA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585071238; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sJiA4wNpkddzEcHwrIl3+bEz5/hbuGAYnQsDOvtD6qo=; b=nZSkDWgg0xGzp7ABbHIAEvxQfTYZjMKsnKEjMjgYoxy3WFddTCNldzD512cKokAwdeDbkBcZEni4WyjuM97inZYLjw1mbAD1+wk+9S5cpJ0BId+/BCvIQusg2Z+8gaBAoSORGUTpp9OyoPGF9Qm8LS5aup/LzwFdHOeIY1A5XSw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.zohomail.com with SMTPS id 1585071238576682.8203567028446; Tue, 24 Mar 2020 10:33:58 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-298-GVU-xoqBOGyEqnVj6sxNng-1; Tue, 24 Mar 2020 13:33:54 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2381C18A8C85; Tue, 24 Mar 2020 17:33:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E4EE260BF3; Tue, 24 Mar 2020 17:33:47 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9238718089D7; Tue, 24 Mar 2020 17:33:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02OHXhwV032621 for ; Tue, 24 Mar 2020 13:33:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 44E0C2166B2B; Tue, 24 Mar 2020 17:33:43 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3FF082166B2A for ; Tue, 24 Mar 2020 17:33:40 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D337E185A794 for ; Tue, 24 Mar 2020 17:33:40 +0000 (UTC) Received: from mail-qv1-f67.google.com (mail-qv1-f67.google.com [209.85.219.67]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-445-sCiIpOOZNjKO0gjO6TRCtg-1; Tue, 24 Mar 2020 13:33:37 -0400 Received: by mail-qv1-f67.google.com with SMTP id ca9so9639730qvb.9; Tue, 24 Mar 2020 10:33:37 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:a54:94b:6faa:a6b0:6b1b]) by smtp.gmail.com with ESMTPSA id z1sm14715213qtc.51.2020.03.24.10.33.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 10:33:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585071236; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=sJiA4wNpkddzEcHwrIl3+bEz5/hbuGAYnQsDOvtD6qo=; b=im+X8REy6M7PLxiO684y+rpjJ6rB8qWoy6+ydF8LcBUdLK+F4Xz2f6GFcfxCbdaZV0L0Eh 6SnjLNBNZbIG8rt6TRN+JKFvBc8cBsA1sUdWX/I2O4hsZwAYqcfBIdn8X6sWZzkRZwllkG ZJlU5sues8A0qHL6jIY90htHOM4qgUE= X-MC-Unique: GVU-xoqBOGyEqnVj6sxNng-1 X-MC-Unique: sCiIpOOZNjKO0gjO6TRCtg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yYIAIFJBUWUiNAUXT29PsXKSXcwiAdvzqD7Ggdjbi2g=; b=WlZNWWPxTo62471EtgGAOTAUSpvXr2y31UV/EnuR/lVAYhCXoXVIhOOKAWWgkjTUVE eWN/s3AjSS7s3Wx+gE0OKD8mwlylFeFM6d5kE6mhe5bAkdtpuWXg2jeOdY1/O/lenT+i y6C+YRmFqTY8xqYM4x4asW+gmFnZ1nMfOrP0YpdwtoNZafPHWqBMtG1rKl4If66eBfA4 ydnz0vLmtoAHc/z60HDau0OJ8fSMzm1dw+jmMuYoPhLlcKZwaSO4yooK69WbwDt757l+ kqqK+dK1a0VrN+slYIJNsYy5Rgli7q4tvZuFK/tJLFT13YR6oDTR0BEofFpBdLwlvXab 5s9A== X-Gm-Message-State: ANhLgQ0fftxU0AKniu4hdNDoBPsriMmQRN7uQ9PsYAw9rAl8a6IEfn+n cO0bV6A4yk0/+sLaaHblbU4zob30 X-Google-Smtp-Source: ADFU+vtOETwZJdbwRsef6IU6Y5n+p5EJeBAnva3PwZoH2q0nPh++CIR66qRtRZzQ9VEDTNFGjt3aEQ== X-Received: by 2002:a05:6214:12c7:: with SMTP id s7mr27174467qvv.218.1585071217107; Tue, 24 Mar 2020 10:33:37 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 2/4] qemu: avoid launching non-x86 guests with 'pvspinlock' setting Date: Tue, 24 Mar 2020 14:33:22 -0300 Message-Id: <20200324173324.891258-3-danielhb413@gmail.com> In-Reply-To: <20200324173324.891258-1-danielhb413@gmail.com> References: <20200324173324.891258-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 02OHXhwV032621 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza , abologna@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The 'pvspinlock' feature is x86 only. The "" declaration will always have a value 'on' or 'off', and both will break QEMU when launching non-x86 guests. This is the error message for "" when running a ppc64 guest: qemu-kvm: Expected key=3Dvalue format, found +kvm_pv_unhalt A similar error message is thrown for "". This patch prevents non-x86 guests from launching with any pvspinlock setting with a more informative error message: error: unsupported configuration: The 'pvspinlock' feature is not supported for architecture 'ppc64' or machine type 'pseries' Suggested-by: Andrea Bolognani Signed-off-by: Daniel Henrique Barboza Reviewed-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 73a65128c6..c56b3a893b 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5271,13 +5271,25 @@ qemuDomainDefValidateFeatures(const virDomainDef *d= ef, } break; =20 + case VIR_DOMAIN_FEATURE_PVSPINLOCK: + if (def->features[i] !=3D VIR_TRISTATE_SWITCH_ABSENT && + !ARCH_IS_X86(def->os.arch)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("The '%s' feature is not supported for " + "architecture '%s' or machine type '%s'"), + featureName, + virArchToString(def->os.arch), + def->os.machine); + return -1; + } + break; + case VIR_DOMAIN_FEATURE_ACPI: case VIR_DOMAIN_FEATURE_PAE: case VIR_DOMAIN_FEATURE_HAP: case VIR_DOMAIN_FEATURE_VIRIDIAN: case VIR_DOMAIN_FEATURE_PRIVNET: case VIR_DOMAIN_FEATURE_HYPERV: - case VIR_DOMAIN_FEATURE_PVSPINLOCK: case VIR_DOMAIN_FEATURE_CAPABILITIES: case VIR_DOMAIN_FEATURE_PMU: case VIR_DOMAIN_FEATURE_MSRS: --=20 2.25.1 From nobody Thu Mar 28 11:14:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) client-ip=216.205.24.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1585071245; cv=none; d=zohomail.com; s=zohoarc; b=d3SusKl6KeXH6/M4zxjadBOET4KEd37doSYXtmn7qWVoNq1wacxJ57ncJy2imWDZxEPZwWxQ6rVGUm9TX/Pe0tqzPg2vOQM/4tmo8XApOJiftG+ZdeCCKycUwWFerXJzc2UP4XJEt81V0z8JAeuB8y4IWjPUupdh7KC1H/82UsQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585071245; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qgTH1ciGeykpjsDfboQ5ngsRQ/S/CdkgUAZOxS0qTp0=; b=f2JRbQWjM1NYrJblC+PMtR9R6Q1yKCWyjOlT8bsBwb0+6U139SfHACBjOw9E6N41a9KmwRixdfyktExv3abJgmHJLH4kYtPhunO1Nb1AYjFqcJxlkEMYJNm4KhRWcGDiYgKJH5f+6fbn1JkXr52yPZbrcjBHJTGL+lNdYqV6+s4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [216.205.24.74]) by mx.zohomail.com with SMTPS id 1585071245753533.0674216772055; Tue, 24 Mar 2020 10:34:05 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-253-ux0ZMkduM9CO6E8mT9d0CQ-1; Tue, 24 Mar 2020 13:34:02 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8802A801E53; Tue, 24 Mar 2020 17:33:56 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5B80A4DA10; Tue, 24 Mar 2020 17:33:56 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 0CE5F86385; Tue, 24 Mar 2020 17:33:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02OHXkJ3032644 for ; Tue, 24 Mar 2020 13:33:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id B1DC0DBF27; Tue, 24 Mar 2020 17:33:46 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AD910D95FF for ; Tue, 24 Mar 2020 17:33:42 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1CB301017E42 for ; Tue, 24 Mar 2020 17:33:42 +0000 (UTC) Received: from mail-qv1-f68.google.com (mail-qv1-f68.google.com [209.85.219.68]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-236-Yp79kC3_P_i9UHZwd9xz5w-1; Tue, 24 Mar 2020 13:33:39 -0400 Received: by mail-qv1-f68.google.com with SMTP id o7so7158696qvq.8; Tue, 24 Mar 2020 10:33:39 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:a54:94b:6faa:a6b0:6b1b]) by smtp.gmail.com with ESMTPSA id z1sm14715213qtc.51.2020.03.24.10.33.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 10:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585071244; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=qgTH1ciGeykpjsDfboQ5ngsRQ/S/CdkgUAZOxS0qTp0=; b=hssYYoU6VKcz6+Dx5O+Av8v23c73ssXH4wsHHSKOUhKllVfmWFafZmsUr6H3D9leRyWWcj NGtxgmm5x/hQOO0otiFryWflX7dY02WkeYSEgQc8Ramq5mhwIlQV6WCW7yUd8aTOdsg/w5 uB7o9n04k9GoSGsqvF6h4GZ4JyreFag= X-MC-Unique: ux0ZMkduM9CO6E8mT9d0CQ-1 X-MC-Unique: Yp79kC3_P_i9UHZwd9xz5w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YgvRd8FpyMYIOTNQucJCrKq/O3+Qw84up9AKFWaxDjs=; b=bS72Wk5fe9SOokI1F7AAbXXNZod7jQmPBLnlKht6VjjcD5CtXMopM8g994g54IZFOM Mu3OCdx1lMm/orYg+0KI8tyFPRCq+x+ih25Fu8Ak4D8p5cyxvlnEiISThYu7bJGqs6X4 5GTX4aqPcXSVLIlrHTKk9p49tp+/nj9rla7/0sYY8mizcp+KPZE+RmfYwklXJNfBQ/uW lb/fOAAzSbRrHHeAKYgdf1vIj7sxjrP9t/4gVsZt4DebT/6BfFMZxCDRhPJriMa+/eVr kG6gGgb/baR03w6rRUyHOaeMJAVFpX7rACtHIqYXz8uikCoSdKFQQ5AqhVOPXCC6fedR szbw== X-Gm-Message-State: ANhLgQ3k1cfHtNo73vX1JzE7q5eAMTl8epFn/QV2mP9A+LBDyZ13xK7u /crjwc9u57shk3tX9W5lMbOr1ko+ X-Google-Smtp-Source: ADFU+vvV/4XW4rogeFuiQNz9DYmGtRxm+YjvWtLSO217PGIo2U4iVNTJaEdQRi29hHszKWwIZUjYVQ== X-Received: by 2002:a05:6214:1808:: with SMTP id o8mr4174943qvw.34.1585071218739; Tue, 24 Mar 2020 10:33:38 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 3/4] qemu: make Hyperv settings exclusive to x86 and aarch64 Date: Tue, 24 Mar 2020 14:33:23 -0300 Message-Id: <20200324173324.891258-4-danielhb413@gmail.com> In-Reply-To: <20200324173324.891258-1-danielhb413@gmail.com> References: <20200324173324.891258-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 02OHXkJ3032644 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza , abologna@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Hyperv features are supported by both x86 and aarch64. The declaration in the XML by itself is benign to other architectures, but any of its 14 current features will break QEMU with an error like this (from ppc64): qemu-kvm: Expected key=3Dvalue format, found hv_relaxed This is a more extreme case than the one for apic eoi because we would need an extra 'switch' statement, with all current Hyperv features in the body of qemuDomainDefValidateFeatures(), to check if the user attempted to activate any of them. It's easier to simply fail to launch with any 'hyperv' declaration in the XML for every arch which is not x86 and aarch64. A fair disclaimer about Windows and PowerPC: the last Windows version that ran in the architecture is the hall of famer Windows NT 4.0, launched in 1996 and with end of extended support for the Server version in 2004 [1]. I am acknowledging that there might be Windows NT 4.0 users running in PowerPC, but not enough people running it under KVM/QEMU to justify Libvirt allowing 'hyperv' to exist in the domain XML of ppc64 domains. [1] https://en.wikipedia.org/wiki/Windows_NT_4.0 Suggested-by: Andrea Bolognani Signed-off-by: Daniel Henrique Barboza Reviewed-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index c56b3a893b..b03e7bbb30 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5284,12 +5284,23 @@ qemuDomainDefValidateFeatures(const virDomainDef *d= ef, } break; =20 + case VIR_DOMAIN_FEATURE_HYPERV: + if (def->features[i] !=3D VIR_TRISTATE_SWITCH_ABSENT && + !ARCH_IS_X86(def->os.arch) && !qemuDomainIsARMVirt(def)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Hyperv features are not supported for " + "architecture '%s' or machine type '%s'"), + virArchToString(def->os.arch), + def->os.machine); + return -1; + } + break; + case VIR_DOMAIN_FEATURE_ACPI: case VIR_DOMAIN_FEATURE_PAE: case VIR_DOMAIN_FEATURE_HAP: case VIR_DOMAIN_FEATURE_VIRIDIAN: case VIR_DOMAIN_FEATURE_PRIVNET: - case VIR_DOMAIN_FEATURE_HYPERV: case VIR_DOMAIN_FEATURE_CAPABILITIES: case VIR_DOMAIN_FEATURE_PMU: case VIR_DOMAIN_FEATURE_MSRS: --=20 2.25.1 From nobody Thu Mar 28 11:14:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) client-ip=63.128.21.74; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-74.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1585071242; cv=none; d=zohomail.com; s=zohoarc; b=MB1FAu5GRmUXE4UUU5zhmWbZ9DPutGCWcgrGHkc/oUbvQuQvgboyxsWb5nWATtgo3yCYI7dxPbEkzMCDoCDfXl0w8MdYsZiikTDYmY1i+Ba61exnuznYbKBLYOtmmd2lrqvZdvM1qSZuV0La4fyq0O5hvra9shN3KyrVOXMUNI4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1585071242; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ZgDOSXY0kZQmW/wDOThseuBFL7jtmvbN/bd2HkhOIVc=; b=gGVeeYucxbItaNTnIwLLkcvaULQoSQ834cyUq0yIHmsWwiioIRYOO0fvplubnp5EAOmUpU7FPkpqY+F2SpQSCWJqrs2wtCTbpOqLsZ7KrGJrQosP4QseQO2cMbcfR0fabz0qwCv4MW3MXAEB8TS7etpN84p9/1yKBEpHdjsE/DU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.74 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-74.mimecast.com (us-smtp-delivery-74.mimecast.com [63.128.21.74]) by mx.zohomail.com with SMTPS id 1585071242193470.968522159067; Tue, 24 Mar 2020 10:34:02 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-186-YM_ppasqPNumdA24FVaF7Q-1; Tue, 24 Mar 2020 13:33:58 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 72A3E10CE781; Tue, 24 Mar 2020 17:33:48 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4403C60BF3; Tue, 24 Mar 2020 17:33:48 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E8ADA86382; Tue, 24 Mar 2020 17:33:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 02OHXhxk032622 for ; Tue, 24 Mar 2020 13:33:43 -0400 Received: by smtp.corp.redhat.com (Postfix) id 62ECD2166B2A; Tue, 24 Mar 2020 17:33:43 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast05.extmail.prod.ext.rdu2.redhat.com [10.11.55.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5F5642166B29 for ; Tue, 24 Mar 2020 17:33:43 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 44A99800299 for ; Tue, 24 Mar 2020 17:33:43 +0000 (UTC) Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-15-8Ue2OBcOPXiBBwJ6R_k1OQ-1; Tue, 24 Mar 2020 13:33:41 -0400 Received: by mail-qv1-f45.google.com with SMTP id z13so9666589qvw.3; Tue, 24 Mar 2020 10:33:40 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:a54:94b:6faa:a6b0:6b1b]) by smtp.gmail.com with ESMTPSA id z1sm14715213qtc.51.2020.03.24.10.33.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 10:33:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585071240; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ZgDOSXY0kZQmW/wDOThseuBFL7jtmvbN/bd2HkhOIVc=; b=Ap2aXOIPQ/Byz+fJ0PtUIsIoKFbdq1fmQgnnnXZCAzpXHSwARZpwqIOZ6imeUVyE6IuyR5 5bp7b5NQg4Wp519CmgdRw3DMi312xCNha7jmJhpXCubbjN6Krlq7g/9CgTokl2/V6d7Ky9 u2vq6SyPF79R5jm8yaUYYnLBTecRvcM= X-MC-Unique: YM_ppasqPNumdA24FVaF7Q-1 X-MC-Unique: 8Ue2OBcOPXiBBwJ6R_k1OQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZoFzz4CWpkN7lBCoNHO+RnXeZuhkuuz3SJqdBKizoHo=; b=N6udWEI7d6WSUjKAtK3Tl/XI0ooaZAQoJ5fxdQGhmr3VkHta2BwdiP1sEu4bRmKTkZ GtVBYw2j4gbaNRMUIaNrgR6CejLNqXSh1YS1vDZ5bwMmXuKFGzY9ZGXhoJb9c0ZtOi6i AyZOjVNdnnWmTt377iJWIJj/5d1cmwmiPZc/v71uKNX/T0JVe5jekR+u0/kMPJYWrULq biI9WlQkU5D2xmvYeRBt+F0eP7gQr8rS1OWNa5hElufmbpgKS5ROscunOuULSaZxoF9U lfEJfTSeZvgpPV5oeH9vovjogi6ozoWLuZwZCn8Cncge12QmhxTlZBhZhRmChyApiMUc IavA== X-Gm-Message-State: ANhLgQ0RWkHmODaD6hGO7a7GgMXzZIstRq7LvehyPflQdACiEcDG8aC3 VCgYVxa9FiBrevTYd613n7cV8IK8 X-Google-Smtp-Source: ADFU+vu594SqufYG1K2W2BiBQ+Cf7kUr/AuyTVmuHTiI3XRuphqNJ46HWP6Qm6FaNjrZzUhubKW5tg== X-Received: by 2002:a0c:ea42:: with SMTP id u2mr4174493qvp.226.1585071220176; Tue, 24 Mar 2020 10:33:40 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v2 4/4] qemu: allow PMU feature to be enabled for ppc64 guests Date: Tue, 24 Mar 2020 14:33:24 -0300 Message-Id: <20200324173324.891258-5-danielhb413@gmail.com> In-Reply-To: <20200324173324.891258-1-danielhb413@gmail.com> References: <20200324173324.891258-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 02OHXhxk032622 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza , abologna@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" The PMU feature is enabled by default in ppc64 guests and can't be disabled via Libvirt or QEMU [1]. The current PMU feature implementation does not allow PMU to enabled or disabled in the ppc64 guest. Declaring the PMU feature will make the 'pmu' property to be passed on to QEMU, but this property isn't available for ppc64: qemu-kvm: can't apply global host-powerpc64-cpu.pmu=3Don: Property '.pmu' n= ot found A similar error is thrown when trying to disable the PMU. This patch standardizes the PMU handling for ppc64 guests by: - throwing an error if the user attempts to set the feature to 'off', given that this feature can't be turned off at all; - allowing the feature to be declared as 'on' in the domain XML. This is done by skipping ppc64 guests when creating the command line for this feature. [1] https://www.redhat.com/archives/libvir-list/2020-March/msg00874.html Signed-off-by: Daniel Henrique Barboza Reviewed-by: Andrea Bolognani --- src/qemu/qemu_command.c | 4 +++- src/qemu/qemu_domain.c | 11 ++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 3a772fa3f3..d1b689dfd3 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6784,7 +6784,9 @@ qemuBuildCpuCommandLine(virCommandPtr cmd, } } =20 - if (def->features[VIR_DOMAIN_FEATURE_PMU]) { + /* ppc64 guests always have PMU enabled, but the 'pmu' option + * is not supported. */ + if (def->features[VIR_DOMAIN_FEATURE_PMU] && !ARCH_IS_PPC64(def->os.ar= ch)) { virTristateSwitch pmu =3D def->features[VIR_DOMAIN_FEATURE_PMU]; virBufferAsprintf(&buf, ",pmu=3D%s", virTristateSwitchTypeToString(pmu)); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index b03e7bbb30..7d29f3f114 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -5296,13 +5296,22 @@ qemuDomainDefValidateFeatures(const virDomainDef *d= ef, } break; =20 + case VIR_DOMAIN_FEATURE_PMU: + if (def->features[i] =3D=3D VIR_TRISTATE_SWITCH_OFF && + ARCH_IS_PPC64(def->os.arch)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("PMU is always enabled for architecture '= %s'"), + virArchToString(def->os.arch)); + return -1; + } + break; + case VIR_DOMAIN_FEATURE_ACPI: case VIR_DOMAIN_FEATURE_PAE: case VIR_DOMAIN_FEATURE_HAP: case VIR_DOMAIN_FEATURE_VIRIDIAN: case VIR_DOMAIN_FEATURE_PRIVNET: case VIR_DOMAIN_FEATURE_CAPABILITIES: - case VIR_DOMAIN_FEATURE_PMU: case VIR_DOMAIN_FEATURE_MSRS: case VIR_DOMAIN_FEATURE_LAST: break; --=20 2.25.1