From nobody Sun Feb 8 04:11:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1587072334; cv=none; d=zohomail.com; s=zohoarc; b=QTm0Urgg/l07yENOGFwu6e3tmjy6IjsvnlzRWMVLf2yApdq3eNuW9Ar9idVKGEQZLFa/McyA+WSS5v245WwnxHeHJxv1NJEo6fvIFZDwklSYIpiI4y3h3VGC1PhIZqWwatxmUKf7jG81djVFc5uHGOSY7SoXBB45f19enrF5KWA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587072334; 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=QZ/UDQ1mVksEU4CTCRAcLS1paacUD9icsML8Kb8iE2A=; b=ioYR7dakzW4gK3mzCBrEkWStTT1ojju2PoyGCvcI7gA2IX7TAGRhjU+r4tx8o3QyOpZuv1ow8SUh/ZqUz67dgIj3MAUpgr/rQpvHTJXKCgokAg+Ts20zVVQ/dKjsSKNZNrNZnq5+eRkB3cjjT/x4Ai7a41cafGGmGlXb7fZBZRo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1587072334276933.9298429060833; Thu, 16 Apr 2020 14:25:34 -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-336-WHzugsWKP4CCiMkW8oS-cQ-1; Thu, 16 Apr 2020 17:25:30 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 645478018A2; Thu, 16 Apr 2020 21:25:25 +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 DDA24100EBAD; Thu, 16 Apr 2020 21:25:24 +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 BB06993373; Thu, 16 Apr 2020 21:25:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03GLPKmW002982 for ; Thu, 16 Apr 2020 17:25:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2F5C32026D66; Thu, 16 Apr 2020 21:25:20 +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 2B0B82026E1C for ; Thu, 16 Apr 2020 21:25:18 +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 F1F64101A55A for ; Thu, 16 Apr 2020 21:25:17 +0000 (UTC) Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-193-uKULl4DaOp-ozHGq1tQ-XQ-1; Thu, 16 Apr 2020 17:25:15 -0400 Received: by mail-qt1-f193.google.com with SMTP id 71so169901qtc.12 for ; Thu, 16 Apr 2020 14:25:15 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:b6b7:222c:adc1:59c6:6fc1]) by smtp.gmail.com with ESMTPSA id j2sm12059821qtp.5.2020.04.16.14.25.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Apr 2020 14:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587072332; 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=QZ/UDQ1mVksEU4CTCRAcLS1paacUD9icsML8Kb8iE2A=; b=D2xNB1qLtLNSeosLX+QnyR/6QSgVE1JoJ12hJq1NF3hm5XRECBwWsNTShTLskEdpFUoG6p srA8aFOgI/CPm4mIq7CBJXWihMmva0OzKjsRa0JyacjuJajXB++BxjoUgY5LnpN0N7pneV TzhiNVgj31x/m1W3Q8Vs9FHjyVnKb1A= X-MC-Unique: WHzugsWKP4CCiMkW8oS-cQ-1 X-MC-Unique: uKULl4DaOp-ozHGq1tQ-XQ-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=D9Saby2gGBcLhcXwQICO6D/uFR/F1yvQhVjhnXTia04=; b=uAWaHjfkNFUodgZXxSW+ebN+zsTjSxbnPwhX3D2feP1gR34d6uXqnf6TF2yBf6uEKV kd0rmPz8XidrArTU1W/DiSwYpPzUzD3y9u6fq9c/u5LntOCdB8aVEZnWM60RqSnGgDS9 IvXT6rEFhUyPnENuNWkvDvIDG+BWyfzn1r6o0ojyh3HHjB1MZ5/dDlvSzpEBOPpBkOfr wvmqKF8ZRr3tNuY9f1+XyX8xUsBNgsv2sgqer02gkZBb20PBxXs+00mSf999KaPAZSb9 kP0rJ5yDxYdZ0i0v8as6J6cbLM4rQm57Vrun1ApZPj0Y20/WojEdXNBu+lf7C9NuG9pS Zoew== X-Gm-Message-State: AGi0PuavZvdrTaG9oSVb+prdimy1/UH/wrGJ5yw3X/jctdEMR8byspNV ceaoXjIpHVoy7I5pJFfrkcCoupbU X-Google-Smtp-Source: APiQypKvuNd0diTFiCP2ABR+CjW3BLU01KDzIV2D1YC2OewkG2LIgV1Hy3zoGXX3tTkMIInCWr6ixw== X-Received: by 2002:ac8:6c57:: with SMTP id z23mr28733880qtu.359.1587072314806; Thu, 16 Apr 2020 14:25:14 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v1 1/7] qemu: Add capability for CFPC pSeries feature Date: Thu, 16 Apr 2020 18:24:58 -0300 Message-Id: <20200416212504.1302047-2-danielhb413@gmail.com> In-Reply-To: <20200416212504.1302047-1-danielhb413@gmail.com> References: <20200416212504.1302047-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03GLPKmW002982 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza 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.22 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" CFPC (Cache Flush on Privilege Change) is one of the capabilities added to QEMU to mitigate Spectre vulnerabilities in Power chips. It was implemented in QEMU 2.12 by commit 6898aed77f46. This capability is still used today due to differences in how the host setup (hardware and firmware/kernel) can handle this mitigation. Its default value also varies with the pseries machine version of the time. There's also certain OSes, like AIX, that might not support the default value of the pseries machine the guest uses. Exposing this in the Libvirt XML as a feature will allow users to tune CFPC values in a cleaner way, instead of hacking parameters in elements. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 1 + 8 files changed, 9 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index fe311048d4..4a262dc71d 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -573,6 +573,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "fsdev.multidevs", "virtio.packed", "pcie-root-port.hotplug", + "machine.pseries.cap-cfpc", ); =20 =20 @@ -1615,6 +1616,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsMachi= nePropsPSeries[] =3D { { "cap-htm", QEMU_CAPS_MACHINE_PSERIES_CAP_HTM }, { "cap-nested-hv", QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV }, { "cap-ccf-assist", QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST }, + { "cap-cfpc", QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC }, }; =20 static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsVirt[] =3D { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 1681fc79a8..81d67d2efe 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -554,6 +554,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ QEMU_CAPS_FSDEV_MULTIDEVS, /* fsdev.multidevs */ QEMU_CAPS_VIRTIO_PACKED_QUEUES, /* virtio.packed */ QEMU_CAPS_PCIE_ROOT_PORT_HOTPLUG, /* pcie-root-port.hotplug */ + QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, /* -machine pseries.cap-cfpc */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemuc= apabilitiesdata/caps_2.12.0.ppc64.xml index 38a3103c4a..cdd4f26993 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml @@ -154,6 +154,7 @@ + 2011090 0 42900289 diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_3.0.0.ppc64.xml index 9a0b9c05c2..84e9ad2dcc 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml @@ -156,6 +156,7 @@ + 2012050 0 42900239 diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_3.1.0.ppc64.xml index 6801023208..3d70a67dab 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml @@ -161,6 +161,7 @@ + 3000091 0 42900240 diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_4.0.0.ppc64.xml index f7e69fcc97..ce2d470cb2 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml @@ -175,6 +175,7 @@ + 4000000 0 42900240 diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_4.2.0.ppc64.xml index 99ec98e8cd..a813776660 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml @@ -180,6 +180,7 @@ + 4001050 0 42900242 diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_5.0.0.ppc64.xml index b08916132a..c33786b0bf 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml @@ -192,6 +192,7 @@ + 4002050 0 42900241 --=20 2.25.2