From nobody Sat Apr 27 17:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1587989712; cv=none; d=zohomail.com; s=zohoarc; b=XPMRNd7tyXZ28zSGBYHrYVAmGJYZkpO1aifOnF+wmFY14oUjgg7T2ATkS/UGC8QsSTsotRB4jbQeQ8jvd8xFPHHnY8uGuGQsu15aNfHgmbWZ3p9pw3khDEj1/QI4+VRgFPsSUtAvwT/Iy/9mH5V/F5gSNeOzoNqe7W+ZqnL/Ghc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587989712; 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=PNfpuTu24fIFb8H+4IMUTHDD3vgsp7u2BJdiygHfFSA=; b=cdqjtksdAfzSrqxbEgaSddgLY2TJx9svtUjvWvKZ2GY0xxeFhsvUxsdv4AAm8MMtGUfYTBzeVaLPMIhjUChOGF9DsFnQwgtF8h/p7Lwn2ny9w1lexAR4pPqXYkwy4iSU1GmcRbb0aWESeOQjQIQuV2shOrleecs+jVhil4R0Nlg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 158798971257875.202009536368; Mon, 27 Apr 2020 05:15:12 -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-261-El4xfC2ePYusmDqK4VHCHA-1; Mon, 27 Apr 2020 08:15:06 -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 DDC8E1005510; Mon, 27 Apr 2020 12:15:00 +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 849715C1D6; Mon, 27 Apr 2020 12:15:00 +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 8EB8C1809543; Mon, 27 Apr 2020 12:14:57 +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 03RCEtep006488 for ; Mon, 27 Apr 2020 08:14:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id AF2B017441; Mon, 27 Apr 2020 12:14:55 +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 AAD5A176D7 for ; Mon, 27 Apr 2020 12:14:55 +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 908E6101A526 for ; Mon, 27 Apr 2020 12:14:55 +0000 (UTC) Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-94-Qd0PaiDqNwaq16Ff-SCwBQ-1; Mon, 27 Apr 2020 08:14:50 -0400 Received: by mail-qk1-f194.google.com with SMTP id g74so17619932qke.13 for ; Mon, 27 Apr 2020 05:14:50 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:4fd4:d3ed:7c48:c060:71]) by smtp.gmail.com with ESMTPSA id k2sm10271935qte.16.2020.04.27.05.14.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 05:14:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587989709; 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=PNfpuTu24fIFb8H+4IMUTHDD3vgsp7u2BJdiygHfFSA=; b=FADr01U1GFGPdx8roeWLXcdqSY01oUQBlF30nbVkG02hB+GYHY36cLUoBT7lCMD6rhiGwb Tfo6YXP3B60Cgy1uIUzdXHMATY+EP/z3QqPTCAEI/43YuKci5RXss746VQynQza8jRIaRp 0ZMKKI1RyqDB3b6FX3jcnMDC9WmPiR4= X-MC-Unique: El4xfC2ePYusmDqK4VHCHA-1 X-MC-Unique: Qd0PaiDqNwaq16Ff-SCwBQ-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=YeT5fXccyudoK4gEkcMhsbX5GknVCsI5LEc8oMfJg6Y=; b=e9jtNcUN3cEGrEuzUlMIWceScTvc+Y5y1wH/MXCKYG5W2cAZmh7cDay4yFHNQMaJWy 7humc9FP2MuI99Cc1uKkITRp4nEVdfBQ6mOlkZK7fcz0lv9YCBb2ROiYhwvSzKH/FwVs qaqmoXbemyjz8rBL0uA3vgXE9Iq8Bhhm8Cmj2VMhv+K89133EhO7Xb8VVBhEycGPHRWD QA+OLl1udXEMTjU143oZ/yhn15CGrAFjPI1H4mJreA1SH8XxL1RE+F1QXe+IJ1LhJngA m8zRx06EuqnVztVbi6PRqepEXcC6GSxDuotI1A5ZbS4tdE2o2/8/WhVNVbgYZp0Sn1Iy e0yg== X-Gm-Message-State: AGi0PuY3UFR49Mnozv6CBPJZVDn4lkzMlZFAN53sqHuIS4dtAkXaqWCx Ji2F0oyZZAq7MTtrZsQU2QqztaYpmwY= X-Google-Smtp-Source: APiQypKy2yAF3d8fYwcBLxO2khAkkzRIEoGS1baC4Vr6fDceOmtHpneBsvM1ikY8O7SEWaVlW+sR4A== X-Received: by 2002:ae9:e814:: with SMTP id a20mr21548392qkg.297.1587989689504; Mon, 27 Apr 2020 05:14:49 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH RESEND v1 1/7] qemu: Add capability for CFPC pSeries feature Date: Mon, 27 Apr 2020 09:14:26 -0300 Message-Id: <20200427121432.920307-2-danielhb413@gmail.com> In-Reply-To: <20200427121432.920307-1-danielhb413@gmail.com> References: <20200427121432.920307-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 03RCEtep006488 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.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" 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 Reviewed-by: Michal Privoznik --- 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 f6b3c96a3d..4838f3cfb5 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -574,6 +574,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "virtio.packed", "pcie-root-port.hotplug", "aio.io_uring", + "machine.pseries.cap-cfpc", ); =20 =20 @@ -1617,6 +1618,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 0e9a161f94..88cf44ed59 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -555,6 +555,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ QEMU_CAPS_VIRTIO_PACKED_QUEUES, /* virtio.packed */ QEMU_CAPS_PCIE_ROOT_PORT_HOTPLUG, /* pcie-root-port.hotplug */ QEMU_CAPS_AIO_IO_URING, /* -blockdev {...,"aio":"io_uring",...} */ + 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.4 From nobody Sat Apr 27 17:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1587989725; cv=none; d=zohomail.com; s=zohoarc; b=LX0F7v/ZNIb0/n0uyffz2EZtfyqW36MYVTpTcBhU9TmCBTB71SFiwJb+H4Jv+iQAdNhEWLEZm94afZzmxFNGKlZXGoH8QA+4PahBWVbgMlCqPTDC7HG6OsWt5up/osS0rHb/kl0x9Y4+cTkGW+/Zj44LmgQDnczEO4Xxu9u8hSo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587989725; 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=NxyBXFPBZX+CHqT1Jxdx3TXRPuqr+FzpkU4Fl+c+jiY=; b=nzPsYlO0M3a9mYx/lFS8JGl0kKG6w1lohNCkX6MF9Wa92xA1BhpmN9fNML7vmRtUtzvwbIuvuY6Iw/JUXydk79K6l0XyRBrIVBPicK/KRWubKRsOX4nu4xstpaadzqGtNnJb3IOa0gnPAvBuuGHA7LLIwVxlqraC54Z8Aw21Jh8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1587989725562954.1661809545368; Mon, 27 Apr 2020 05:15:25 -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-16-L2ibNaI1OCiH5bPIGiShEA-1; Mon, 27 Apr 2020 08:15:21 -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 D7D84107BEF7; Mon, 27 Apr 2020 12:15:14 +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 9A4005C220; Mon, 27 Apr 2020 12:15:14 +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 333654A71F; Mon, 27 Apr 2020 12:15:14 +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 03RCEu8v006500 for ; Mon, 27 Apr 2020 08:14:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id B6BE42166BA0; Mon, 27 Apr 2020 12:14:56 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B1D0E2166BA2 for ; Mon, 27 Apr 2020 12:14:54 +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 634168008A3 for ; Mon, 27 Apr 2020 12:14:54 +0000 (UTC) Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-482-bcHPffEAOmK0QPnJxYcrug-1; Mon, 27 Apr 2020 08:14:52 -0400 Received: by mail-qk1-f173.google.com with SMTP id o135so5245420qke.6 for ; Mon, 27 Apr 2020 05:14:52 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:4fd4:d3ed:7c48:c060:71]) by smtp.gmail.com with ESMTPSA id k2sm10271935qte.16.2020.04.27.05.14.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 05:14:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587989723; 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=NxyBXFPBZX+CHqT1Jxdx3TXRPuqr+FzpkU4Fl+c+jiY=; b=PhGchToCHLxpFKsEiT+V4BwJOUsBS022dgl4GAv38W+/ybhTG0j29qqtDWykbgZo01Tlt5 ttY7bK7mw95PLwamEoqJO3SPAEc5F1vu+2jK6UQ5exYHZHX88VHCpD4PIW7+4hAsLBzFPY a879YZVsWyJ25kTjeAZcMHb1rNEaNTE= X-MC-Unique: L2ibNaI1OCiH5bPIGiShEA-1 X-MC-Unique: bcHPffEAOmK0QPnJxYcrug-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=LTyze5GPPxf0RZisz0WJnHtJIKDKvsedtJcLrSAAFIs=; b=nQxXSFpnHZJ5oBdY+/LrIpcuIuQNeECToSuXvzB94heoatCnYlb7IvuneGNdnPeaVi OppbWb6TEDzTJQDYbA9nRmOZfT/bGJkQ8J3zOAN4MaiJ0AOmeCjsmSMpP+2REbfNlbyi jnwF2K8mEM0cfup/31g6R8QJMxjS8o6xv2JidB/IE13wwwntCwWFXn1HH8qnyoge0wuQ 8VgHwHdEKGz7Wk4fSF+eghMDmoKTZ03UVhQKFS19xug3A6LtqmdPt00eYDz1+5tXdDhs ekZ/wiRuhDEckMdRaT6KdVhzuMTZuYfR7+e1aO5dK4uBox1QAKnU561loUcEzY269kQG EdTQ== X-Gm-Message-State: AGi0PubsVgceAR7PLoVRm3xuiYcrDMFy1KEWNTuSsjhy1Bl6S5lbHlTU 9jPOK2iqH637zsESey+1zkr1wd8wfMs= X-Google-Smtp-Source: APiQypJdVtr5BXkmHwJfLxe2bRosSLD65yZCUif3WBcARsN5yEdmXu88apqa3AKnUkkph9aKP3aMCw== X-Received: by 2002:a05:620a:1093:: with SMTP id g19mr21486992qkk.399.1587989691154; Mon, 27 Apr 2020 05:14:51 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH RESEND v1 2/7] qemu: Implement the CFPC pSeries feature Date: Mon, 27 Apr 2020 09:14:27 -0300 Message-Id: <20200427121432.920307-3-danielhb413@gmail.com> In-Reply-To: <20200427121432.920307-1-danielhb413@gmail.com> References: <20200427121432.920307-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 03RCEu8v006500 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.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" This patch adds the implementation of the CFPC pSeries feature, using the QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC capability added in the previous patch. CPFC can have the values "broken", "workaround" or "fixed". Extra code is required to handle it since it's not a regular tristate capability. This is the XML format for the cap: Signed-off-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik --- docs/formatdomain.html.in | 11 +++++ docs/schemas/domaincommon.rng | 15 +++++++ src/conf/domain_conf.c | 44 +++++++++++++++++++ src/conf/domain_conf.h | 12 +++++ src/libvirt_private.syms | 1 + src/qemu/qemu_command.c | 5 +++ src/qemu/qemu_validate.c | 11 +++++ tests/qemuxml2argvdata/pseries-features.args | 3 +- tests/qemuxml2argvdata/pseries-features.xml | 1 + tests/qemuxml2argvtest.c | 17 ++++++- tests/qemuxml2xmloutdata/pseries-features.xml | 1 + tests/qemuxml2xmltest.c | 3 +- 12 files changed, 121 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index c5305739d2..a99407675f 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2078,6 +2078,7 @@ <htm state=3D'on'/> <ccf-assist state=3D'on'/> <msrs unknown=3D'ignore'/> + <cfpc value=3D'workaround'/> </features> ... =20 @@ -2406,6 +2407,16 @@ defined, the hypervisor default will be used. Since 5.9.0 (QEMU/KVM only) +
cfpc
+
Configure cfpc (Cache Flush on Privilege Change) availability for + pSeries guests. + Possible values for the value attribute + are broken (no protection), workaround + (software workaround available) and fixed (fixed in + hardware). If the attribute is not defined, the hypervisor + default will be used. + Since 6.3.0 (QEMU/KVM only) +
=20

Time keeping

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 7f18e5b669..6441e01717 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5434,6 +5434,9 @@ + + + @@ -5693,6 +5696,18 @@ =20 + + + + + broken + workaround + fixed + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 89cd8c5f32..e53586cdf2 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -174,6 +174,7 @@ VIR_ENUM_IMPL(virDomainFeature, "msrs", "ccf-assist", "xen", + "cfpc", ); =20 VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, @@ -1266,6 +1267,14 @@ VIR_ENUM_IMPL(virDomainOsDefFirmware, "efi", ); =20 +VIR_ENUM_IMPL(virDomainCFPC, + VIR_DOMAIN_CFPC_LAST, + "none", + "broken", + "workaround", + "fixed", +); + /* Internal mapping: subset of block job types that can be present in * XML (remaining types are not two-phase). */ VIR_ENUM_DECL(virDomainBlockJob); @@ -19326,6 +19335,21 @@ virDomainFeaturesDefParse(virDomainDefPtr def, } break; =20 + case VIR_DOMAIN_FEATURE_CFPC: + tmp =3D virXMLPropString(nodes[i], "value"); + if (tmp) { + int value =3D virDomainCFPCTypeFromString(tmp); + if (value < 0 || value =3D=3D VIR_DOMAIN_CFPC_NONE) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unknown value: %s"), + tmp); + goto error; + } + def->features[val] =3D value; + VIR_FREE(tmp); + } + break; + case VIR_DOMAIN_FEATURE_HTM: case VIR_DOMAIN_FEATURE_NESTED_HV: case VIR_DOMAIN_FEATURE_CCF_ASSIST: @@ -23377,6 +23401,18 @@ virDomainDefFeaturesCheckABIStability(virDomainDef= Ptr src, } break; =20 + case VIR_DOMAIN_FEATURE_CFPC: + if (src->features[i] !=3D dst->features[i]) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("State of feature '%s' differs: " + "source: '%s=3D%s', destination: '%s=3D%s= '"), + featureName, + "value", virDomainCFPCTypeToString(src->fea= tures[i]), + "value", virDomainCFPCTypeToString(dst->fea= tures[i])); + return false; + } + break; + case VIR_DOMAIN_FEATURE_MSRS: break; =20 @@ -29211,6 +29247,14 @@ virDomainDefFormatFeatures(virBufferPtr buf, virDomainMsrsUnknownTypeToString(def->msrs_f= eatures[VIR_DOMAIN_MSRS_UNKNOWN])); break; =20 + case VIR_DOMAIN_FEATURE_CFPC: + if (def->features[i] =3D=3D VIR_DOMAIN_CFPC_NONE) + break; + + virBufferAsprintf(&childBuf, "\n", + virDomainCFPCTypeToString(def->features[i])); + break; + /* coverity[dead_error_begin] */ case VIR_DOMAIN_FEATURE_LAST: break; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index ecb80ef8f2..8594049e52 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1816,6 +1816,7 @@ typedef enum { VIR_DOMAIN_FEATURE_MSRS, VIR_DOMAIN_FEATURE_CCF_ASSIST, VIR_DOMAIN_FEATURE_XEN, + VIR_DOMAIN_FEATURE_CFPC, =20 VIR_DOMAIN_FEATURE_LAST } virDomainFeature; @@ -1987,6 +1988,17 @@ typedef enum { =20 VIR_ENUM_DECL(virDomainHPTResizing); =20 +typedef enum { + VIR_DOMAIN_CFPC_NONE =3D 0, + VIR_DOMAIN_CFPC_BROKEN, + VIR_DOMAIN_CFPC_WORKAROUND, + VIR_DOMAIN_CFPC_FIXED, + + VIR_DOMAIN_CFPC_LAST +} virDomainCFPC; + +VIR_ENUM_DECL(virDomainCFPC); + /* Operating system configuration data & machine / arch */ struct _virDomainOSEnv { char *name; diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index a9694f34c0..308959b493 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -235,6 +235,7 @@ virDomainBlockIoTuneInfoHasMaxLength; virDomainBootTypeFromString; virDomainBootTypeToString; virDomainCapabilitiesPolicyTypeToString; +virDomainCFPCTypeToString; virDomainChrConsoleTargetTypeFromString; virDomainChrConsoleTargetTypeToString; virDomainChrDefForeach; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 45dd830781..4cb454769a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7171,6 +7171,11 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, virBufferAsprintf(&buf, ",cap-ccf-assist=3D%s", str); } =20 + if (def->features[VIR_DOMAIN_FEATURE_CFPC] !=3D VIR_DOMAIN_CFPC_NONE) { + const char *str =3D virDomainCFPCTypeToString(def->features[VIR_DO= MAIN_FEATURE_CFPC]); + virBufferAsprintf(&buf, ",cap-cfpc=3D%s", str); + } + if (cpu && cpu->model && cpu->mode =3D=3D VIR_CPU_MODE_HOST_MODEL && qemuDomainIsPSeries(def) && diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index cb0ff8d636..31d36e938b 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -136,6 +136,16 @@ qemuValidateDomainDefPSeriesFeature(const virDomainDef= *def, return -1; } =20 + break; + + case VIR_DOMAIN_FEATURE_CFPC: + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC))= { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("cfpc configuration is not supported by " + "this QEMU binary")); + return -1; + } + break; } =20 @@ -194,6 +204,7 @@ qemuValidateDomainDefFeatures(const virDomainDef *def, case VIR_DOMAIN_FEATURE_HTM: case VIR_DOMAIN_FEATURE_NESTED_HV: case VIR_DOMAIN_FEATURE_CCF_ASSIST: + case VIR_DOMAIN_FEATURE_CFPC: if (qemuValidateDomainDefPSeriesFeature(def, qemuCaps, i) < 0) return -1; break; diff --git a/tests/qemuxml2argvdata/pseries-features.args b/tests/qemuxml2a= rgvdata/pseries-features.args index 7aa357a54e..8540252c17 100644 --- a/tests/qemuxml2argvdata/pseries-features.args +++ b/tests/qemuxml2argvdata/pseries-features.args @@ -11,7 +11,8 @@ QEMU_AUDIO_DRV=3Dnone \ -name guest \ -S \ -machine pseries,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,resize-hpt=3D= required,\ -cap-hpt-max-page-size=3D1048576k,cap-htm=3Don,cap-nested-hv=3Doff,cap-ccf-= assist=3Don \ +cap-hpt-max-page-size=3D1048576k,cap-htm=3Don,cap-nested-hv=3Doff,cap-ccf-= assist=3Don,\ +cap-cfpc=3Dfixed \ -m 512 \ -realtime mlock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/pseries-features.xml b/tests/qemuxml2ar= gvdata/pseries-features.xml index 8ccc1b73d8..f07a204cb7 100644 --- a/tests/qemuxml2argvdata/pseries-features.xml +++ b/tests/qemuxml2argvdata/pseries-features.xml @@ -13,6 +13,7 @@ + /usr/bin/qemu-system-ppc64 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 1a1b9026c4..1bad60bfce 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1964,6 +1964,7 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, + QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 /* parse error: no QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT */ @@ -1972,7 +1973,8 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE, QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, - QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST); + QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, + QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC); =20 /* parse error: no QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE */ DO_TEST_PARSE_ERROR("pseries-features", @@ -1980,6 +1982,7 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, + QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 /* parse error: no QEMU_CAPS_MACHINE_PSERIES_CAP_HTM */ @@ -1988,6 +1991,7 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE, QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, + QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 /* parse error: no QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV */ @@ -1996,6 +2000,7 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE, QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, + QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 /* parse error: no QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST */ @@ -2004,8 +2009,18 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE, QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, + QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 + /* parse error: no QEMU_CAPS_MACHINE_PSERIES_CFPC */ + DO_TEST_PARSE_ERROR("pseries-features", + QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, + QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT, + QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE, + QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, + QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, + QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST); + DO_TEST_PARSE_ERROR("pseries-features-invalid-machine", NONE); =20 DO_TEST("pseries-serial-native", diff --git a/tests/qemuxml2xmloutdata/pseries-features.xml b/tests/qemuxml2= xmloutdata/pseries-features.xml index a5df840394..1b5d78ce74 100644 --- a/tests/qemuxml2xmloutdata/pseries-features.xml +++ b/tests/qemuxml2xmloutdata/pseries-features.xml @@ -15,6 +15,7 @@ + destroy diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 4e43fa6fc6..2a89c289a4 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -695,7 +695,8 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, - QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); + QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT, + QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC); =20 DO_TEST("pseries-serial-native", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, --=20 2.25.4 From nobody Sat Apr 27 17:09:21 2024 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=1587989719; cv=none; d=zohomail.com; s=zohoarc; b=R6/VzGuheK2b7ZejbaG2HABJfKSDwfjs+bsChJCgaK9W6QNhh8jD2PHG+5wWwM720aaiJgUx3jl+6PzGyouMacopC5EUg2lOwsumENCAhcsB1BWMhZ4/XFMFOKMn8YnbJOs8HTb16cmjG64UkpERxx+VrPOksKhOxKzGWxDh4vM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587989719; 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=eq7SMuMmNZwwjsYIhFXIfGehnMKJhCA7xtPOUNW4UAk=; b=hdKQIVHOHyvrjeaU7xebaJSwuF6pHvWklwZbLKFvHzNX0wHqcT0tu4Hh8abwd/aJLveMLiqdud0ZIC4MX+jsKlf6As6Cu+AprnQOXEGhkvL9Q+nedg4WELSIq35kVxF49mpny541rifSNqpmjZ/4e6U857IWtNXF+0AhWuDKAls= 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 1587989719064143.89021946552805; Mon, 27 Apr 2020 05:15:19 -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-210-sy4Cw0xHPYi8AnRB8mkR0Q-1; Mon, 27 Apr 2020 08:15:15 -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 A050D19067EC; Mon, 27 Apr 2020 12:15:09 +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 6612827CCA; Mon, 27 Apr 2020 12:15:09 +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 F02274CAB0; Mon, 27 Apr 2020 12:15:08 +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 03RCEub7006495 for ; Mon, 27 Apr 2020 08:14:56 -0400 Received: by smtp.corp.redhat.com (Postfix) id 41E55176D7; Mon, 27 Apr 2020 12:14:56 +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 3DCA51758A for ; Mon, 27 Apr 2020 12:14:56 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.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 25B2E80CDAE for ; Mon, 27 Apr 2020 12:14:56 +0000 (UTC) Received: from mail-qt1-f194.google.com (mail-qt1-f194.google.com [209.85.160.194]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-496-xmHSx7ZwOJ-uZHVoBfabCQ-1; Mon, 27 Apr 2020 08:14:53 -0400 Received: by mail-qt1-f194.google.com with SMTP id v26so8384424qto.0 for ; Mon, 27 Apr 2020 05:14:53 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:4fd4:d3ed:7c48:c060:71]) by smtp.gmail.com with ESMTPSA id k2sm10271935qte.16.2020.04.27.05.14.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 05:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587989717; 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=eq7SMuMmNZwwjsYIhFXIfGehnMKJhCA7xtPOUNW4UAk=; b=Ios7FTkoyxT819mfHiAy6jhcXADLBBO7U9KY7lsCllYrPQg9cIJ8gEwW7c9eQ4L9/n18us EGsrpyriGTikB2NL2bgNU37ryZyEY3L8FLzAz+gf/RCsQkyJPZlJEtH7iNn4fAfUFvKYku E/GAziz7pA+KB82sw+SqyvaWidtIEdk= X-MC-Unique: sy4Cw0xHPYi8AnRB8mkR0Q-1 X-MC-Unique: xmHSx7ZwOJ-uZHVoBfabCQ-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=YaFYcksAk5ZTJta5oEcLql6sn5jPw5TJ64iaW6KcP/M=; b=fZQGsOwsIaHSg2sv6OGPP7RPOjMxW9wnxOvYMcfwOxe9sKOxpakkkOEe9bEd82JHve oY3oXa84nzGvimRsRNecvgR38IAkzs688CiHE6xUWdBf0F6ALL6YC1KiuRMZFAcnauFU L+C+h9TAxxIF5IxzX/axJjY4trNFcJk1Ufdz+yWIppNRxAQ1rVFQn7zv7vU9UjvOEPCf hIkTzxwtInkvB64Bw+6yHUQ4+GFjx3sRQffnZZ3sPNSWkbHMinJbMoq+WfHwPVuV8zQB TFLXB+aIUmuQEWakrlUr0U/W7G09glz6mqdhd+oZsCkIEHyzrlfEScONyFhA93RBNeZd wgSQ== X-Gm-Message-State: AGi0PuY9jWghdjAQbKGiqQqKWnxUe4OY7NkLyLb8UwoXlGT9bjw7hrP3 PSY/tG9Ju+AC74tUHG13cHuFWK6jHBs= X-Google-Smtp-Source: APiQypJWdDWqwMYf+5OMN8EjeLjTKnJn2ZcTcDBYl6izM/1bQXd/aaXfYvye2XO71j1oyN+fL+Rnmg== X-Received: by 2002:aed:2e65:: with SMTP id j92mr22484229qtd.123.1587989692840; Mon, 27 Apr 2020 05:14:52 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH RESEND v1 3/7] qemu: Add capability for SBBC pSeries feature Date: Mon, 27 Apr 2020 09:14:28 -0300 Message-Id: <20200427121432.920307-4-danielhb413@gmail.com> In-Reply-To: <20200427121432.920307-1-danielhb413@gmail.com> References: <20200427121432.920307-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 03RCEub7006495 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.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" SBBC (Speculation Barrier Bounds Checking) is another capability related to Spectre mitigation efforts in Power processors. It was implemented in QEMU 2.12 by commit 09114fd81799. This patch introduces it as QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC to be implemented in the next patch. Like the case with the now implemented CFPC, exposing this feature in the XML allows for a cleaner way for users to tune the SBBC accordingly, given that not all hypervisor and guest setups supports this Spectre mitigation. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik --- src/qemu/qemu_capabilities.c | 4 ++++ src/qemu/qemu_capabilities.h | 3 +++ 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, 13 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 4838f3cfb5..2e2b9874a7 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -575,6 +575,9 @@ VIR_ENUM_IMPL(virQEMUCaps, "pcie-root-port.hotplug", "aio.io_uring", "machine.pseries.cap-cfpc", + + /* 365 */ + "machine.pseries.cap-sbbc", ); =20 =20 @@ -1619,6 +1622,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsMachi= nePropsPSeries[] =3D { { "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 }, + { "cap-sbbc", QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC }, }; =20 static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsVirt[] =3D { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 88cf44ed59..4040c50dc4 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -557,6 +557,9 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ QEMU_CAPS_AIO_IO_URING, /* -blockdev {...,"aio":"io_uring",...} */ QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, /* -machine pseries.cap-cfpc */ =20 + /* 365 */ + QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, /* -machine pseries.cap-sbbc */ + QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; =20 diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemuc= apabilitiesdata/caps_2.12.0.ppc64.xml index cdd4f26993..2046f1097c 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml @@ -155,6 +155,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 84e9ad2dcc..9e71080152 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml @@ -157,6 +157,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 3d70a67dab..f13b384e91 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml @@ -162,6 +162,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 ce2d470cb2..674e4b4944 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml @@ -176,6 +176,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 a813776660..f89498171b 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml @@ -181,6 +181,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 c33786b0bf..ebc39130df 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml @@ -193,6 +193,7 @@ + 4002050 0 42900241 --=20 2.25.4 From nobody Sat Apr 27 17:09:21 2024 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=1587989730; cv=none; d=zohomail.com; s=zohoarc; b=IQERuxrQs2Gr6XBQeN9dMYZpv5Er4ENGjW0Nm9HYG2f4yQaaP6SWSgC+lNgIUL2AMbU6zkCFu089h1NuP2O0O2v8T07EzQRsn4hh08mvH7aoWHI3DFGAGJpZ0N08irWE067AjWAWyDxjuyJXkzCvRunUK3sti+xY1Kuh6MQqbPk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587989730; 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=eTg8SIraTnX5KexKc7f2Y8QhQeX+kY6NKKxGKq3gj/I=; b=afF0JQkhLFd9jfDa/jQoewUtnVRpOsd5TN6f3v302amIRgcQS/07z9hI6PrTdfnWp6MyAETwyM4YSiKfEDo8mEEeL+VxQBxJJXZ3YwDQ9mCQoaxxufv0BG+aNcQp4xLlD+VzvagxhxHlDBSLKZVag3ffElVzX/mAKwawHHQ64jw= 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 1587989730850819.3499493351476; Mon, 27 Apr 2020 05:15:30 -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-108-6_XoCHbFNtGwhKLEMF-drA-1; Mon, 27 Apr 2020 08:15:25 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 56694107BEF6; Mon, 27 Apr 2020 12:15:20 +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 257335D9DC; Mon, 27 Apr 2020 12:15:20 +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 C48AC4E564; Mon, 27 Apr 2020 12:15:19 +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 03RCEw29006512 for ; Mon, 27 Apr 2020 08:14:58 -0400 Received: by smtp.corp.redhat.com (Postfix) id 063DE2166BA3; Mon, 27 Apr 2020 12:14:58 +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 0253E2166BA0 for ; Mon, 27 Apr 2020 12:14:57 +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 D6A5580CDAF for ; Mon, 27 Apr 2020 12:14:57 +0000 (UTC) Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-207-rp1cjBLwPciBJ71_NgkIeg-1; Mon, 27 Apr 2020 08:14:55 -0400 Received: by mail-qk1-f170.google.com with SMTP id s63so17669830qke.4 for ; Mon, 27 Apr 2020 05:14:55 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:4fd4:d3ed:7c48:c060:71]) by smtp.gmail.com with ESMTPSA id k2sm10271935qte.16.2020.04.27.05.14.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 05:14:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587989729; 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=eTg8SIraTnX5KexKc7f2Y8QhQeX+kY6NKKxGKq3gj/I=; b=TL7YDn4uYoioNv9p+hoAWhLwczDJecXQBNGumj1HHsXex/2z0hNAe/kRXbzWRvUv143m63 sBs5ZYT+bt2KEcj3UQpt5a8ZMdsx61rK/OCUCcRdLHIlhWhwvb38ddgXDRowUFd0MjuxFL 7bJ8G07y5DZyjDttFtb1FKTIj+x+7KE= X-MC-Unique: 6_XoCHbFNtGwhKLEMF-drA-1 X-MC-Unique: rp1cjBLwPciBJ71_NgkIeg-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=hqlUIn2YS0UhtkwG8dU5Ix49ecJ2S84Ihcs7tAIgTBk=; b=WJTf+Ua74l5CziNm7/+dSAL92vYYRTF2RijkGQO0RISsqALJL10JY5JBcHnZtviQDh tTVrG72yLhAuVNa7SD1qmivNjEaXHrhFx/lTzV4uZ+fqKJOg/hvk+9ZoEpK05ImkhFNi xqYbV7G531SAMTdZHjnwNMSDSuqxqPgh00jS9j0n6/eKm426NPjYYYaBwaAqVLIvp9I2 d63igbV9rNoOzVpIbXT+FKH+Xu17zWgpv536vfXcRlb1Kjz/jyx5LK3+cLajKqTVI8wx Z7XXbz/27WeMGMVBGHMVF892Pi55Gafv8uBeSswm5MJEsv2t3kaU/jqr3VjeFXKtUlpV OgZA== X-Gm-Message-State: AGi0PubOmF6a0XQn78XMg3b98KZ0OmqQcpbHawnaYAjD5U7Dn4qCdjbP JwLqCJC9sjCQkj/a9owsOow4SMb0f3o= X-Google-Smtp-Source: APiQypKHXFhaFupEtvUCZfd8mkXU3hdLJpHKfg92EnL55vu0NV7A5mvMs4bcOCsAC+4IqOVPL3RLWg== X-Received: by 2002:a37:274e:: with SMTP id n75mr21847836qkn.355.1587989694150; Mon, 27 Apr 2020 05:14:54 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH RESEND v1 4/7] qemu: Implement the SBBC pSeries feature Date: Mon, 27 Apr 2020 09:14:29 -0300 Message-Id: <20200427121432.920307-5-danielhb413@gmail.com> In-Reply-To: <20200427121432.920307-1-danielhb413@gmail.com> References: <20200427121432.920307-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 03RCEw29006512 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.79 on 10.5.11.14 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" This patch adds the implementation of the SBBC pSeries feature, using the QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC capability added in the previous patch. Like the previously added CFPC feature, SBBC can have the values "broken", "workaround" or "fixed". Extra code is required to handle it since it's not a regular tristate capability. This is the XML format for the cap: Signed-off-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik --- docs/formatdomain.html.in | 11 +++++ docs/schemas/domaincommon.rng | 15 +++++++ src/conf/domain_conf.c | 44 +++++++++++++++++++ src/conf/domain_conf.h | 12 +++++ src/libvirt_private.syms | 1 + src/qemu/qemu_command.c | 5 +++ src/qemu/qemu_validate.c | 11 +++++ tests/qemuxml2argvdata/pseries-features.args | 2 +- tests/qemuxml2argvdata/pseries-features.xml | 1 + tests/qemuxml2argvtest.c | 21 ++++++++- tests/qemuxml2xmloutdata/pseries-features.xml | 1 + tests/qemuxml2xmltest.c | 3 +- 12 files changed, 123 insertions(+), 4 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index a99407675f..dd8172fff2 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2079,6 +2079,7 @@ <ccf-assist state=3D'on'/> <msrs unknown=3D'ignore'/> <cfpc value=3D'workaround'/> + <sbbc value=3D'workaround'/> </features> ... =20 @@ -2417,6 +2418,16 @@ default will be used. Since 6.3.0 (QEMU/KVM only) +
sbbc
+
Configure sbbc (Speculation Barrier Bounds Checking) availabilit= y for + pSeries guests. + Possible values for the value attribute + are broken (no protection), workaround + (software workaround available) and fixed (fixed in + hardware). If the attribute is not defined, the hypervisor + default will be used. + Since 6.3.0 (QEMU/KVM only) +
=20

Time keeping

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 6441e01717..2a7a433c03 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5437,6 +5437,9 @@ + + +
@@ -5708,6 +5711,18 @@
=20 + + + + + broken + workaround + fixed + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index e53586cdf2..226a0012fc 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -175,6 +175,7 @@ VIR_ENUM_IMPL(virDomainFeature, "ccf-assist", "xen", "cfpc", + "sbbc", ); =20 VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, @@ -1275,6 +1276,14 @@ VIR_ENUM_IMPL(virDomainCFPC, "fixed", ); =20 +VIR_ENUM_IMPL(virDomainSBBC, + VIR_DOMAIN_SBBC_LAST, + "none", + "broken", + "workaround", + "fixed", +); + /* Internal mapping: subset of block job types that can be present in * XML (remaining types are not two-phase). */ VIR_ENUM_DECL(virDomainBlockJob); @@ -19350,6 +19359,21 @@ virDomainFeaturesDefParse(virDomainDefPtr def, } break; =20 + case VIR_DOMAIN_FEATURE_SBBC: + tmp =3D virXMLPropString(nodes[i], "value"); + if (tmp) { + int value =3D virDomainSBBCTypeFromString(tmp); + if (value < 0 || value =3D=3D VIR_DOMAIN_SBBC_NONE) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unknown value: %s"), + tmp); + goto error; + } + def->features[val] =3D value; + VIR_FREE(tmp); + } + break; + case VIR_DOMAIN_FEATURE_HTM: case VIR_DOMAIN_FEATURE_NESTED_HV: case VIR_DOMAIN_FEATURE_CCF_ASSIST: @@ -23413,6 +23437,18 @@ virDomainDefFeaturesCheckABIStability(virDomainDef= Ptr src, } break; =20 + case VIR_DOMAIN_FEATURE_SBBC: + if (src->features[i] !=3D dst->features[i]) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("State of feature '%s' differs: " + "source: '%s=3D%s', destination: '%s=3D%s= '"), + featureName, + "value", virDomainSBBCTypeToString(src->fea= tures[i]), + "value", virDomainSBBCTypeToString(dst->fea= tures[i])); + return false; + } + break; + case VIR_DOMAIN_FEATURE_MSRS: break; =20 @@ -29255,6 +29291,14 @@ virDomainDefFormatFeatures(virBufferPtr buf, virDomainCFPCTypeToString(def->features[i])); break; =20 + case VIR_DOMAIN_FEATURE_SBBC: + if (def->features[i] =3D=3D VIR_DOMAIN_SBBC_NONE) + break; + + virBufferAsprintf(&childBuf, "\n", + virDomainSBBCTypeToString(def->features[i])); + break; + /* coverity[dead_error_begin] */ case VIR_DOMAIN_FEATURE_LAST: break; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 8594049e52..ac84591b17 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1817,6 +1817,7 @@ typedef enum { VIR_DOMAIN_FEATURE_CCF_ASSIST, VIR_DOMAIN_FEATURE_XEN, VIR_DOMAIN_FEATURE_CFPC, + VIR_DOMAIN_FEATURE_SBBC, =20 VIR_DOMAIN_FEATURE_LAST } virDomainFeature; @@ -1999,6 +2000,17 @@ typedef enum { =20 VIR_ENUM_DECL(virDomainCFPC); =20 +typedef enum { + VIR_DOMAIN_SBBC_NONE =3D 0, + VIR_DOMAIN_SBBC_BROKEN, + VIR_DOMAIN_SBBC_WORKAROUND, + VIR_DOMAIN_SBBC_FIXED, + + VIR_DOMAIN_SBBC_LAST +} virDomainSBBC; + +VIR_ENUM_DECL(virDomainSBBC); + /* Operating system configuration data & machine / arch */ struct _virDomainOSEnv { char *name; diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 308959b493..cccae12323 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -582,6 +582,7 @@ virDomainRNGModelTypeToString; virDomainRNGRemove; virDomainRunningReasonTypeFromString; virDomainRunningReasonTypeToString; +virDomainSBBCTypeToString; virDomainSCSIDriveAddressIsUsed; virDomainSeclabelTypeFromString; virDomainSeclabelTypeToString; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 4cb454769a..b7c6be0d50 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7176,6 +7176,11 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, virBufferAsprintf(&buf, ",cap-cfpc=3D%s", str); } =20 + if (def->features[VIR_DOMAIN_FEATURE_SBBC] !=3D VIR_DOMAIN_SBBC_NONE) { + const char *str =3D virDomainSBBCTypeToString(def->features[VIR_DO= MAIN_FEATURE_SBBC]); + virBufferAsprintf(&buf, ",cap-sbbc=3D%s", str); + } + if (cpu && cpu->model && cpu->mode =3D=3D VIR_CPU_MODE_HOST_MODEL && qemuDomainIsPSeries(def) && diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 31d36e938b..0d5df6f426 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -146,6 +146,16 @@ qemuValidateDomainDefPSeriesFeature(const virDomainDef= *def, return -1; } =20 + break; + + case VIR_DOMAIN_FEATURE_SBBC: + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC))= { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("sbbc configuration is not supported by " + "this QEMU binary")); + return -1; + } + break; } =20 @@ -205,6 +215,7 @@ qemuValidateDomainDefFeatures(const virDomainDef *def, case VIR_DOMAIN_FEATURE_NESTED_HV: case VIR_DOMAIN_FEATURE_CCF_ASSIST: case VIR_DOMAIN_FEATURE_CFPC: + case VIR_DOMAIN_FEATURE_SBBC: if (qemuValidateDomainDefPSeriesFeature(def, qemuCaps, i) < 0) return -1; break; diff --git a/tests/qemuxml2argvdata/pseries-features.args b/tests/qemuxml2a= rgvdata/pseries-features.args index 8540252c17..9a64df7593 100644 --- a/tests/qemuxml2argvdata/pseries-features.args +++ b/tests/qemuxml2argvdata/pseries-features.args @@ -12,7 +12,7 @@ QEMU_AUDIO_DRV=3Dnone \ -S \ -machine pseries,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,resize-hpt=3D= required,\ cap-hpt-max-page-size=3D1048576k,cap-htm=3Don,cap-nested-hv=3Doff,cap-ccf-= assist=3Don,\ -cap-cfpc=3Dfixed \ +cap-cfpc=3Dfixed,cap-sbbc=3Dbroken \ -m 512 \ -realtime mlock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/pseries-features.xml b/tests/qemuxml2ar= gvdata/pseries-features.xml index f07a204cb7..ef431b0067 100644 --- a/tests/qemuxml2argvdata/pseries-features.xml +++ b/tests/qemuxml2argvdata/pseries-features.xml @@ -14,6 +14,7 @@ + /usr/bin/qemu-system-ppc64 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 1bad60bfce..83f451f750 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1965,6 +1965,7 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, + QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 /* parse error: no QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT */ @@ -1974,7 +1975,8 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, - QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC); + QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, + QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC); =20 /* parse error: no QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE */ DO_TEST_PARSE_ERROR("pseries-features", @@ -1983,6 +1985,7 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, + QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 /* parse error: no QEMU_CAPS_MACHINE_PSERIES_CAP_HTM */ @@ -1992,6 +1995,7 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, + QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 /* parse error: no QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV */ @@ -2001,6 +2005,7 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, + QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 /* parse error: no QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST */ @@ -2010,6 +2015,7 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, + QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 /* parse error: no QEMU_CAPS_MACHINE_PSERIES_CFPC */ @@ -2019,7 +2025,18 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE, QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, - QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST); + QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, + QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC); + + /* parse error: no QEMU_CAPS_MACHINE_PSERIES_SBBC */ + DO_TEST_PARSE_ERROR("pseries-features", + QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, + QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT, + QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE, + QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, + QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, + QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, + QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC); =20 DO_TEST_PARSE_ERROR("pseries-features-invalid-machine", NONE); =20 diff --git a/tests/qemuxml2xmloutdata/pseries-features.xml b/tests/qemuxml2= xmloutdata/pseries-features.xml index 1b5d78ce74..3700ffa195 100644 --- a/tests/qemuxml2xmloutdata/pseries-features.xml +++ b/tests/qemuxml2xmloutdata/pseries-features.xml @@ -16,6 +16,7 @@ + destroy diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index 2a89c289a4..c2596161c3 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -696,7 +696,8 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT, - QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC); + QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, + QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC); =20 DO_TEST("pseries-serial-native", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, --=20 2.25.4 From nobody Sat Apr 27 17:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1587989719; cv=none; d=zohomail.com; s=zohoarc; b=h37uxxWcxINAv6WoQPKIWJmS3AICWgnJY3PT9d9no1MagigjUlDFV0rMuJSs0uGevwDnRZ5zIw9A2wbxYFLEtXHRffK23ypowwW+79IbQoRgIbpfhN0LknOUo98skxuumNQ58ejnGVaMk5HKanTM4mWrG2fbsYEBQQRQMU8xWmU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587989719; 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=BwU+FjESZZBzn5T4LSgml7PthHfZrO5Ps3ZQx3BgKnA=; b=gZryGs09N0b3XLLUnjAP7BfcIG5l47HSserbQpTmNKmDPbrrXe6aHtFuMPoouj5UN1Eze8aPJzS5NuHGkXqG7rxfhRFB2h4gFaAyjjFvDsb2QBav94w7dVPj6sdbIGcaFUtZqXP8FPBpiNCq9kY8sP0kP0EcVth8ghXPWcqY0/k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1587989719532798.7334461409739; Mon, 27 Apr 2020 05:15:19 -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-209-hNTcZQB7MQe_wSwpRSFTyg-1; Mon, 27 Apr 2020 08:15:15 -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 AB438A0BDA; Mon, 27 Apr 2020 12:15:09 +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 6DA9D610AB; Mon, 27 Apr 2020 12:15:09 +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 EF6751809557; Mon, 27 Apr 2020 12:15:08 +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 03RCF05w006526 for ; Mon, 27 Apr 2020 08:15:00 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8A5FF110F0C9; Mon, 27 Apr 2020 12:15:00 +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 85AF0110F0CB for ; Mon, 27 Apr 2020 12:14:58 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.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 A857580CDAE for ; Mon, 27 Apr 2020 12:14:58 +0000 (UTC) Received: from mail-qk1-f195.google.com (mail-qk1-f195.google.com [209.85.222.195]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-224-TYAsyLepNayIFgbiqIDtuw-1; Mon, 27 Apr 2020 08:14:56 -0400 Received: by mail-qk1-f195.google.com with SMTP id m67so17609263qke.12 for ; Mon, 27 Apr 2020 05:14:56 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:4fd4:d3ed:7c48:c060:71]) by smtp.gmail.com with ESMTPSA id k2sm10271935qte.16.2020.04.27.05.14.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 05:14:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587989717; 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=BwU+FjESZZBzn5T4LSgml7PthHfZrO5Ps3ZQx3BgKnA=; b=DdZxrl/oY9hdtiUc5VLitmgYWhpOB1MACFzBaWYUY7FCTNn+moSwh9ivHVCyxqnC2DYCko bDG4NGPdl1xvw9XTC7zJ0C9FJSmZtoziil85XRJcES62fUBk2Kvvkp/KRIV0fy+mgKpmFJ /ODlfCtQcZ9cFSBcO2Gciet8M4vha3w= X-MC-Unique: hNTcZQB7MQe_wSwpRSFTyg-1 X-MC-Unique: TYAsyLepNayIFgbiqIDtuw-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=9GhMgJlG66i4GLpP3dsSVMT7owQ6B3VyVNadaH98ZO4=; b=Lu83Wm9T8dk298Vfn9qPJo+wGAaZ3bfCn9rqDiqCE9bM0PU+TEF8IEkbVttNP/NxRh xc7oSzWU4s6QgMEax8ZeRNhhEDNdwQOWpi6cZQ/bI1Q7oQNp0NwRcS+/POd1O3au8Wa+ VFeGAyR0RYyd4RmrZip1ftFYU2opK1KZ7Lv2g99EVqtH8etmXnfLbJs2EHiDOOvDO0Mp 1fbBc73RBvF6rlm3obQ90C0bickMNFOcfDYvNCjeOs3UVTi1D+v8uldU3M/U//G8BuN6 e3eVTfyMQaHUrkzQHXCL+8p6xWd+0SuT6pNob4UWLkwkHF7h7lN4JpNvXl7JitXB0tcQ w+TA== X-Gm-Message-State: AGi0PubcGN+/YzjabVdUXA/3R4wBoXvDmorDulSi7Ww/JU6gxmLc/6kC HglX0+0QOnXVBmrda74RyDxkOQ50yU0= X-Google-Smtp-Source: APiQypItRcscbF9CfuVKbHpDF3uDySzfdhsIUU+/BEMtQKj+J/4bk2Ymjcx+RbgKt5eBMFYVVV2rYw== X-Received: by 2002:ae9:edc6:: with SMTP id c189mr21011374qkg.422.1587989695876; Mon, 27 Apr 2020 05:14:55 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH RESEND v1 5/7] qemu: Add capability for IBS pSeries feature Date: Mon, 27 Apr 2020 09:14:30 -0300 Message-Id: <20200427121432.920307-6-danielhb413@gmail.com> In-Reply-To: <20200427121432.920307-1-danielhb413@gmail.com> References: <20200427121432.920307-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 03RCF05w006526 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.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" IBS (Indirect Branch Speculation) is the last capability added in QEMU 2.12 related to Spectre mitigation for Power. It was added in commit 4be8d4e7d935. This patch introduces it as QEMU_CAPS_MACHINE_PSERIES_CAP_IBS. Like CFPC and SBBC, users might want to tune in IBS based on their HW and guest OS requirements, and it's better to do it so in a proper Libvirt feature than to put QEMU arguments in the middle of the domain XML. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik --- 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 2e2b9874a7..3e00299a91 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -578,6 +578,7 @@ VIR_ENUM_IMPL(virQEMUCaps, =20 /* 365 */ "machine.pseries.cap-sbbc", + "machine.pseries.cap-ibs", ); =20 =20 @@ -1623,6 +1624,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsMachi= nePropsPSeries[] =3D { { "cap-ccf-assist", QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST }, { "cap-cfpc", QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC }, { "cap-sbbc", QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC }, + { "cap-ibs", QEMU_CAPS_MACHINE_PSERIES_CAP_IBS }, }; =20 static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsVirt[] =3D { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 4040c50dc4..281aca5ea7 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -559,6 +559,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ =20 /* 365 */ QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, /* -machine pseries.cap-sbbc */ + QEMU_CAPS_MACHINE_PSERIES_CAP_IBS, /* -machine pseries.cap-ibs */ =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 2046f1097c..4c1758fbfe 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml @@ -156,6 +156,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 9e71080152..a8390a12eb 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml @@ -158,6 +158,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 f13b384e91..d96caaa9ed 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml @@ -163,6 +163,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 674e4b4944..44c1b9205e 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml @@ -177,6 +177,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 f89498171b..2eef337cc4 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml @@ -182,6 +182,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 ebc39130df..d972def4b3 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml @@ -194,6 +194,7 @@ + 4002050 0 42900241 --=20 2.25.4 From nobody Sat Apr 27 17:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; 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 207.211.31.81 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=1587989726; cv=none; d=zohomail.com; s=zohoarc; b=UAl93JvPGAFBjmINVECj/CHrAm4hgL/pC4lSLlx2aM0lF5NC5a/elE0SimpDe8xsw9NF0FeePXBtC5wPyoBpveCRvOXclCPVXmzpgmiv5QvslTBzbALAaUnqIYmVFO4AjeAE0n742n4D0D8DKrTCB+gDrPl7eu+4/9IxrsiHZQk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587989726; 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=g68phyhkZeMJLFwgOfZOnWKpwabuxyGMh/rN1GzUzW0=; b=grfzhqrppYH5fy3MpORMdYIhx79eTUZBnBnb0Gji7LCqGMJynPajQ3GCil0l3vF7gZJv7T35sX8qFuEkXsoTPHTLA/vAvn9vyJLPwxKeQdicPV9dVrdg+Q43caucPh/Zaudgk2NtAIR1d86CUvVztKrAzLPoynqe9pWJKRAaBzA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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 [207.211.31.81]) by mx.zohomail.com with SMTPS id 1587989726066974.1349808673341; Mon, 27 Apr 2020 05:15:26 -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-449-z1H4sF9HPaGMepfT7cgfwA-1; Mon, 27 Apr 2020 08:15:21 -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 2CEA246B; Mon, 27 Apr 2020 12:15:15 +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 EF39D5C254; Mon, 27 Apr 2020 12:15:14 +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 7C68D1809561; Mon, 27 Apr 2020 12:15:14 +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 03RCF1qa006538 for ; Mon, 27 Apr 2020 08:15:01 -0400 Received: by smtp.corp.redhat.com (Postfix) id E3F23176D7; Mon, 27 Apr 2020 12:15:00 +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 DFD7E1758A for ; Mon, 27 Apr 2020 12:15:00 +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 C1398101A526 for ; Mon, 27 Apr 2020 12:15:00 +0000 (UTC) Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-335-_ft8OQ4iP0m5IBmb81HLsQ-1; Mon, 27 Apr 2020 08:14:58 -0400 Received: by mail-qv1-f54.google.com with SMTP id h6so8348744qvz.8 for ; Mon, 27 Apr 2020 05:14:58 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:4fd4:d3ed:7c48:c060:71]) by smtp.gmail.com with ESMTPSA id k2sm10271935qte.16.2020.04.27.05.14.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 05:14:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587989724; 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=g68phyhkZeMJLFwgOfZOnWKpwabuxyGMh/rN1GzUzW0=; b=XbOxNJbA3DGNJSDyHLoNWQjTn2vVlCGpuKgPPtDg5cYiohcbpsZ2C5lXJprolxtahHcd2+ z0iDBxPji3H36voI6VTKXFIrxEOEH1JT/P9u+LX7ryBI8wjpP9/mGcnPM3Kd6HnO8AHVx1 31Ody+Uo7w6aGvDoiS0YOtpl3qDaik4= X-MC-Unique: z1H4sF9HPaGMepfT7cgfwA-1 X-MC-Unique: _ft8OQ4iP0m5IBmb81HLsQ-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=MS8LQ3OAdp1H46bY1rc3FXING0JlvR+AyZ1AYqZuggA=; b=dfs7em7ZNcSBXpDJUvo675ZxhEfcRekHHyK2H9QJTKArTSHRf1/82XkFUQ2hMJ/yLs n85/k8s6Qre5C2cq4LwoyU9CCXsiV/Z/DXksCo6L5f0c44CgPmNrIKvu7Wt56TnK5GiY EznL7foT5YBWwV0WyiPs8/qSTkIIdOzo/1RMb3cH3iRJI6N247ZPQrG+kyGYqszlhQYD hYr1Z6S/AgyLua0vfi3g5Ui81gWZruxJZ18A8oJfjFDBy147iOPhnw9gcahdDxTMwmnW k6UOXC15DZ7TkhlnZQ7720X542JWLtgqv+jWuaQC9k7f+KPcXGqfizEdmU4QrrsodMeL zatg== X-Gm-Message-State: AGi0Pubmxo1+qvmkki/vQtsvSXVcx3kbxB7LCM2YM/eOk1ROROu2bD0Y 8pB+tbQLhuEUstFlOw1KRMD/IHT1SYk= X-Google-Smtp-Source: APiQypLJOuC0DwVRtVWKBmPCq0UpqHfT/JOqa7z+mTdJYvPmDZabrIBu0KcwzSKorrtjHihuCJJcCg== X-Received: by 2002:a05:6214:9b3:: with SMTP id du19mr21570398qvb.167.1587989697237; Mon, 27 Apr 2020 05:14:57 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH RESEND v1 6/7] qemu: Implement the IBS pSeries feature Date: Mon, 27 Apr 2020 09:14:31 -0300 Message-Id: <20200427121432.920307-7-danielhb413@gmail.com> In-Reply-To: <20200427121432.920307-1-danielhb413@gmail.com> References: <20200427121432.920307-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 03RCF1qa006538 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.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" This patch adds the implementation of the IBS pSeries feature, using the QEMU_CAPS_MACHINE_PSERIES_CAP_IBS capability added in the previous patch. IBS can have the following values: "broken", "workaround", "fixed-ibs", "fixed-ccd" and "fixed-na". This is the XML format for the cap: Signed-off-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik --- docs/formatdomain.html.in | 14 ++++++ docs/schemas/domaincommon.rng | 17 +++++++ src/conf/domain_conf.c | 46 +++++++++++++++++++ src/conf/domain_conf.h | 14 ++++++ src/libvirt_private.syms | 1 + src/qemu/qemu_command.c | 5 ++ src/qemu/qemu_validate.c | 11 +++++ tests/qemuxml2argvdata/pseries-features.args | 2 +- tests/qemuxml2argvdata/pseries-features.xml | 1 + tests/qemuxml2argvtest.c | 25 ++++++++-- tests/qemuxml2xmloutdata/pseries-features.xml | 1 + tests/qemuxml2xmltest.c | 3 +- 12 files changed, 135 insertions(+), 5 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index dd8172fff2..91d6f6c0d3 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2080,6 +2080,7 @@ <msrs unknown=3D'ignore'/> <cfpc value=3D'workaround'/> <sbbc value=3D'workaround'/> + <ibs value=3D'fixed-na'/> </features> ... =20 @@ -2428,6 +2429,19 @@ default will be used. Since 6.3.0 (QEMU/KVM only) +
ibs
+
Configure ibs (Indirect Branch Speculation) availability for + pSeries guests. + Possible values for the value attribute + are broken (no protection), workaround + (count cache flush), fixed-ibs (fixed by + serializing indirect branches), fixed-ccd (fixed by + disabling the cache count) and fixed-na (fixed in + hardware - no longer applicable). + If the attribute is not defined, the hypervisor + default will be used. + Since 6.3.0 (QEMU/KVM only) +
=20

Time keeping

diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 2a7a433c03..9d60b090f3 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5440,6 +5440,9 @@ + + +
@@ -5723,6 +5726,20 @@
=20 + + + + + broken + workaround + fixed-ibs + fixed-ccd + fixed-na + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 226a0012fc..8a87586936 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -176,6 +176,7 @@ VIR_ENUM_IMPL(virDomainFeature, "xen", "cfpc", "sbbc", + "ibs", ); =20 VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, @@ -1284,6 +1285,16 @@ VIR_ENUM_IMPL(virDomainSBBC, "fixed", ); =20 +VIR_ENUM_IMPL(virDomainIBS, + VIR_DOMAIN_IBS_LAST, + "none", + "broken", + "workaround", + "fixed-ibs", + "fixed-ccd", + "fixed-na", +); + /* Internal mapping: subset of block job types that can be present in * XML (remaining types are not two-phase). */ VIR_ENUM_DECL(virDomainBlockJob); @@ -19374,6 +19385,21 @@ virDomainFeaturesDefParse(virDomainDefPtr def, } break; =20 + case VIR_DOMAIN_FEATURE_IBS: + tmp =3D virXMLPropString(nodes[i], "value"); + if (tmp) { + int value =3D virDomainIBSTypeFromString(tmp); + if (value < 0 || value =3D=3D VIR_DOMAIN_IBS_NONE) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("Unknown value: %s"), + tmp); + goto error; + } + def->features[val] =3D value; + VIR_FREE(tmp); + } + break; + case VIR_DOMAIN_FEATURE_HTM: case VIR_DOMAIN_FEATURE_NESTED_HV: case VIR_DOMAIN_FEATURE_CCF_ASSIST: @@ -23449,6 +23475,18 @@ virDomainDefFeaturesCheckABIStability(virDomainDef= Ptr src, } break; =20 + case VIR_DOMAIN_FEATURE_IBS: + if (src->features[i] !=3D dst->features[i]) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("State of feature '%s' differs: " + "source: '%s=3D%s', destination: '%s=3D%s= '"), + featureName, + "value", virDomainIBSTypeToString(src->feat= ures[i]), + "value", virDomainIBSTypeToString(dst->feat= ures[i])); + return false; + } + break; + case VIR_DOMAIN_FEATURE_MSRS: break; =20 @@ -29299,6 +29337,14 @@ virDomainDefFormatFeatures(virBufferPtr buf, virDomainSBBCTypeToString(def->features[i])); break; =20 + case VIR_DOMAIN_FEATURE_IBS: + if (def->features[i] =3D=3D VIR_DOMAIN_IBS_NONE) + break; + + virBufferAsprintf(&childBuf, "\n", + virDomainIBSTypeToString(def->features[i])); + break; + /* coverity[dead_error_begin] */ case VIR_DOMAIN_FEATURE_LAST: break; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index ac84591b17..4afd8f04bc 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1818,6 +1818,7 @@ typedef enum { VIR_DOMAIN_FEATURE_XEN, VIR_DOMAIN_FEATURE_CFPC, VIR_DOMAIN_FEATURE_SBBC, + VIR_DOMAIN_FEATURE_IBS, =20 VIR_DOMAIN_FEATURE_LAST } virDomainFeature; @@ -2011,6 +2012,19 @@ typedef enum { =20 VIR_ENUM_DECL(virDomainSBBC); =20 +typedef enum { + VIR_DOMAIN_IBS_NONE =3D 0, + VIR_DOMAIN_IBS_BROKEN, + VIR_DOMAIN_IBS_WORKAROUND, + VIR_DOMAIN_IBS_FIXEDIBS, + VIR_DOMAIN_IBS_FIXEDCCD, + VIR_DOMAIN_IBS_FIXEDNA, + + VIR_DOMAIN_IBS_LAST +} virDomainIBS; + +VIR_ENUM_DECL(virDomainIBS); + /* Operating system configuration data & machine / arch */ struct _virDomainOSEnv { char *name; diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index cccae12323..c70ea9e642 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -455,6 +455,7 @@ virDomainHubTypeFromString; virDomainHubTypeToString; virDomainHypervTypeFromString; virDomainHypervTypeToString; +virDomainIBSTypeToString; virDomainInputBusTypeToString; virDomainInputDefFind; virDomainInputDefFree; diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b7c6be0d50..a76e7d6f61 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7181,6 +7181,11 @@ qemuBuildMachineCommandLine(virCommandPtr cmd, virBufferAsprintf(&buf, ",cap-sbbc=3D%s", str); } =20 + if (def->features[VIR_DOMAIN_FEATURE_IBS] !=3D VIR_DOMAIN_IBS_NONE) { + const char *str =3D virDomainIBSTypeToString(def->features[VIR_DOM= AIN_FEATURE_IBS]); + virBufferAsprintf(&buf, ",cap-ibs=3D%s", str); + } + if (cpu && cpu->model && cpu->mode =3D=3D VIR_CPU_MODE_HOST_MODEL && qemuDomainIsPSeries(def) && diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 0d5df6f426..cd297aa734 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -156,6 +156,16 @@ qemuValidateDomainDefPSeriesFeature(const virDomainDef= *def, return -1; } =20 + break; + + case VIR_DOMAIN_FEATURE_IBS: + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_MACHINE_PSERIES_CAP_IBS)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("ibs configuration is not supported by " + "this QEMU binary")); + return -1; + } + break; } =20 @@ -216,6 +226,7 @@ qemuValidateDomainDefFeatures(const virDomainDef *def, case VIR_DOMAIN_FEATURE_CCF_ASSIST: case VIR_DOMAIN_FEATURE_CFPC: case VIR_DOMAIN_FEATURE_SBBC: + case VIR_DOMAIN_FEATURE_IBS: if (qemuValidateDomainDefPSeriesFeature(def, qemuCaps, i) < 0) return -1; break; diff --git a/tests/qemuxml2argvdata/pseries-features.args b/tests/qemuxml2a= rgvdata/pseries-features.args index 9a64df7593..668eeb157b 100644 --- a/tests/qemuxml2argvdata/pseries-features.args +++ b/tests/qemuxml2argvdata/pseries-features.args @@ -12,7 +12,7 @@ QEMU_AUDIO_DRV=3Dnone \ -S \ -machine pseries,accel=3Dtcg,usb=3Doff,dump-guest-core=3Doff,resize-hpt=3D= required,\ cap-hpt-max-page-size=3D1048576k,cap-htm=3Don,cap-nested-hv=3Doff,cap-ccf-= assist=3Don,\ -cap-cfpc=3Dfixed,cap-sbbc=3Dbroken \ +cap-cfpc=3Dfixed,cap-sbbc=3Dbroken,cap-ibs=3Dfixed-ccd \ -m 512 \ -realtime mlock=3Doff \ -smp 1,sockets=3D1,cores=3D1,threads=3D1 \ diff --git a/tests/qemuxml2argvdata/pseries-features.xml b/tests/qemuxml2ar= gvdata/pseries-features.xml index ef431b0067..6e4700a56a 100644 --- a/tests/qemuxml2argvdata/pseries-features.xml +++ b/tests/qemuxml2argvdata/pseries-features.xml @@ -15,6 +15,7 @@ + /usr/bin/qemu-system-ppc64 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 83f451f750..d3c8b048cb 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1966,6 +1966,7 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, + QEMU_CAPS_MACHINE_PSERIES_CAP_IBS, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 /* parse error: no QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT */ @@ -1976,7 +1977,8 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, - QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC); + QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, + QEMU_CAPS_MACHINE_PSERIES_CAP_IBS); =20 /* parse error: no QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE */ DO_TEST_PARSE_ERROR("pseries-features", @@ -1986,6 +1988,7 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, + QEMU_CAPS_MACHINE_PSERIES_CAP_IBS, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 /* parse error: no QEMU_CAPS_MACHINE_PSERIES_CAP_HTM */ @@ -1996,6 +1999,7 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, + QEMU_CAPS_MACHINE_PSERIES_CAP_IBS, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 /* parse error: no QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV */ @@ -2006,6 +2010,7 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, + QEMU_CAPS_MACHINE_PSERIES_CAP_IBS, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 /* parse error: no QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST */ @@ -2016,6 +2021,7 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, + QEMU_CAPS_MACHINE_PSERIES_CAP_IBS, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT); =20 /* parse error: no QEMU_CAPS_MACHINE_PSERIES_CFPC */ @@ -2026,7 +2032,8 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, - QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC); + QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, + QEMU_CAPS_MACHINE_PSERIES_CAP_IBS); =20 /* parse error: no QEMU_CAPS_MACHINE_PSERIES_SBBC */ DO_TEST_PARSE_ERROR("pseries-features", @@ -2036,7 +2043,19 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, - QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC); + QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, + QEMU_CAPS_MACHINE_PSERIES_CAP_IBS); + + /* parse error: no QEMU_CAPS_MACHINE_PSERIES_IBS */ + DO_TEST_PARSE_ERROR("pseries-features", + QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, + QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT, + QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE, + QEMU_CAPS_MACHINE_PSERIES_CAP_HTM, + QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV, + QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, + QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, + QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC); =20 DO_TEST_PARSE_ERROR("pseries-features-invalid-machine", NONE); =20 diff --git a/tests/qemuxml2xmloutdata/pseries-features.xml b/tests/qemuxml2= xmloutdata/pseries-features.xml index 3700ffa195..e1c1d7306e 100644 --- a/tests/qemuxml2xmloutdata/pseries-features.xml +++ b/tests/qemuxml2xmloutdata/pseries-features.xml @@ -17,6 +17,7 @@ + destroy diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c index c2596161c3..06145e767a 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -697,7 +697,8 @@ mymain(void) QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST, QEMU_CAPS_MACHINE_PSERIES_RESIZE_HPT, QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, - QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC); + QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, + QEMU_CAPS_MACHINE_PSERIES_CAP_IBS); =20 DO_TEST("pseries-serial-native", QEMU_CAPS_DEVICE_SPAPR_PCI_HOST_BRIDGE, --=20 2.25.4 From nobody Sat Apr 27 17:09:21 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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=1587989721; cv=none; d=zohomail.com; s=zohoarc; b=dlwp/rn6RN19a2VGcm5FN6OKe0IjYkLOT8cnUXejCl0kCWNVWiTisTAM9sUUIVpJXQfGLUEg+HIEYZXKroIOfvx69dF+WP//S1wgUJ00/qDDfLZNHvXWfrWbVkmq/sjfTIIjmu6z08igUAZgmf97u9AWvh6DRSEmhvc4cv0Vq4E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587989721; 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=KRnV9OwO/qYcfVCDDZ6IU35XBrsvFAOL9D4B8vSrFIo=; b=Py4D2qNEaVryT8XfoHATMsS7yBY+EDMYBstg16gSnJhzE2/28YEhjQ/qlXoUvWyFz6nT9hop0yWlkLxMIbZ5j6oMQGjVINtQwYNmaxYktnUF59dgSl1xNUp29BDvJXw2VUg5VubHQMyx7rWdkgDY01t88SRogF5eBTh7W8vI0Qc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 1587989721183982.13214449961; Mon, 27 Apr 2020 05:15:21 -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-226-WaBtRqzsPAe3oZv2kqNiuA-1; Mon, 27 Apr 2020 08:15:14 -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 C10E4468; Mon, 27 Apr 2020 12:15:08 +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 A937627CCC; Mon, 27 Apr 2020 12:15:07 +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 3B5E34CAAD; Mon, 27 Apr 2020 12:15:07 +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 03RCF5oP006560 for ; Mon, 27 Apr 2020 08:15:05 -0400 Received: by smtp.corp.redhat.com (Postfix) id DECEF20267F2; Mon, 27 Apr 2020 12:15:04 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB1302026D67 for ; Mon, 27 Apr 2020 12:15:02 +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 8601C8001E4 for ; Mon, 27 Apr 2020 12:15:02 +0000 (UTC) Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-337-biCNDVg6MPG9K-P-ncp6OQ-1; Mon, 27 Apr 2020 08:14:59 -0400 Received: by mail-qv1-f52.google.com with SMTP id 59so6238261qva.13 for ; Mon, 27 Apr 2020 05:14:59 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:4fd4:d3ed:7c48:c060:71]) by smtp.gmail.com with ESMTPSA id k2sm10271935qte.16.2020.04.27.05.14.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Apr 2020 05:14:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587989719; 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=KRnV9OwO/qYcfVCDDZ6IU35XBrsvFAOL9D4B8vSrFIo=; b=WW+LJcjpvkkdb1U2aKQeNIChCYRh2QHLQgKzCBi45XpO+GsXbq5eUkPCIs5yJcmYzpWA2s qRLP1EpzDGX0SQ0Zcn/Y21KbgaBZhvZa2tIKHCE5dcnjm80+7+6vtHejSghLSzUtGmZcVt DIUOoyaA5pVFfbYggx9C1FfjtRdI1mM= X-MC-Unique: WaBtRqzsPAe3oZv2kqNiuA-1 X-MC-Unique: biCNDVg6MPG9K-P-ncp6OQ-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=/dbVaqG9Z0lO0ruqtgzovA/t4IDSk3WTxyT8ZcXdBPQ=; b=pZmPm8/6103GoQ+hXlYrXgwCCHoKQNaC5EKTa3D0KLfmutUAqWP7NdpZV2JqjY8FVF rfk4YMynqP5tdsEGHH300AsKk3YxxtCz/mRFeG+p45OBc95ocQfBrNWrN1VfOi8fu0bJ hWn6HTME2LJzhMa9OKiMP9NNVdJYUCnBAbRWVmdT9ywVEiYj29lOkJCSnq+YUEAKab1P 7mDSipcLZs/xAL3py9ov5onwrivCawuzUXO3rUftqk8/ruIb8b2TpvdYE4Xqgj+ZuWRr JtlC3LNXGqtjKQSsNpsJUo1fd8lOUTNxSww/AkrFigQr6OdOcxrZg+mZMvQOynKhxeOV He9Q== X-Gm-Message-State: AGi0PuZjSdjS/CXPvUISXxXD1xT2JJQBx/vMKyNXeJO0l9MwxQROVEiD 3QQCvZC0DwAQw2SpqjKLHHdRuNafiu4= X-Google-Smtp-Source: APiQypLa7OqRrPCxgTFtH1uL31eSi//wvdbcabO9xDjnSLh9lu4iU5hq+UA6QSnJYv4PvvASUZVlWw== X-Received: by 2002:a0c:a986:: with SMTP id a6mr21184700qvb.79.1587989699072; Mon, 27 Apr 2020 05:14:59 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH RESEND v1 7/7] news: Update for the recent added pSeries features Date: Mon, 27 Apr 2020 09:14:32 -0300 Message-Id: <20200427121432.920307-8-danielhb413@gmail.com> In-Reply-To: <20200427121432.920307-1-danielhb413@gmail.com> References: <20200427121432.920307-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 03RCF5oP006560 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.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" Update news.xml to inform about the availability of CFPC, SBBC and IBS features. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Michal Privoznik --- docs/news.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 5835013c19..80819aec23 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -109,6 +109,16 @@ and/or fine tuned per individual host. + + + qemu: Implement pSeries Spectre mitigation features + + + Users can now setup the following capabilities of pSeries guests: + CFPC (Cache Flush on Privilege Change), SBBC (Speculation Barrier + Bounds Checking) and IBS (Indirect Branch Speculation). + +
--=20 2.25.4