From nobody Sun May 5 22:03:00 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=1587072334; cv=none; d=zohomail.com; s=zohoarc; b=QTm0Urgg/l07yENOGFwu6e3tmjy6IjsvnlzRWMVLf2yApdq3eNuW9Ar9idVKGEQZLFa/McyA+WSS5v245WwnxHeHJxv1NJEo6fvIFZDwklSYIpiI4y3h3VGC1PhIZqWwatxmUKf7jG81djVFc5uHGOSY7SoXBB45f19enrF5KWA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587072334; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QZ/UDQ1mVksEU4CTCRAcLS1paacUD9icsML8Kb8iE2A=; b=ioYR7dakzW4gK3mzCBrEkWStTT1ojju2PoyGCvcI7gA2IX7TAGRhjU+r4tx8o3QyOpZuv1ow8SUh/ZqUz67dgIj3MAUpgr/rQpvHTJXKCgokAg+Ts20zVVQ/dKjsSKNZNrNZnq5+eRkB3cjjT/x4Ai7a41cafGGmGlXb7fZBZRo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1587072334276933.9298429060833; Thu, 16 Apr 2020 14:25:34 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-336-WHzugsWKP4CCiMkW8oS-cQ-1; Thu, 16 Apr 2020 17:25:30 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 645478018A2; Thu, 16 Apr 2020 21:25:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DDA24100EBAD; Thu, 16 Apr 2020 21:25:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BB06993373; Thu, 16 Apr 2020 21:25:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03GLPKmW002982 for ; Thu, 16 Apr 2020 17:25:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2F5C32026D66; Thu, 16 Apr 2020 21:25:20 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast04.extmail.prod.ext.rdu2.redhat.com [10.11.55.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2B0B82026E1C for ; Thu, 16 Apr 2020 21:25:18 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F1F64101A55A for ; Thu, 16 Apr 2020 21:25:17 +0000 (UTC) Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-193-uKULl4DaOp-ozHGq1tQ-XQ-1; Thu, 16 Apr 2020 17:25:15 -0400 Received: by mail-qt1-f193.google.com with SMTP id 71so169901qtc.12 for ; Thu, 16 Apr 2020 14:25:15 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:b6b7:222c:adc1:59c6:6fc1]) by smtp.gmail.com with ESMTPSA id j2sm12059821qtp.5.2020.04.16.14.25.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Apr 2020 14:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587072332; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=QZ/UDQ1mVksEU4CTCRAcLS1paacUD9icsML8Kb8iE2A=; b=D2xNB1qLtLNSeosLX+QnyR/6QSgVE1JoJ12hJq1NF3hm5XRECBwWsNTShTLskEdpFUoG6p srA8aFOgI/CPm4mIq7CBJXWihMmva0OzKjsRa0JyacjuJajXB++BxjoUgY5LnpN0N7pneV TzhiNVgj31x/m1W3Q8Vs9FHjyVnKb1A= X-MC-Unique: WHzugsWKP4CCiMkW8oS-cQ-1 X-MC-Unique: uKULl4DaOp-ozHGq1tQ-XQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=D9Saby2gGBcLhcXwQICO6D/uFR/F1yvQhVjhnXTia04=; b=uAWaHjfkNFUodgZXxSW+ebN+zsTjSxbnPwhX3D2feP1gR34d6uXqnf6TF2yBf6uEKV kd0rmPz8XidrArTU1W/DiSwYpPzUzD3y9u6fq9c/u5LntOCdB8aVEZnWM60RqSnGgDS9 IvXT6rEFhUyPnENuNWkvDvIDG+BWyfzn1r6o0ojyh3HHjB1MZ5/dDlvSzpEBOPpBkOfr wvmqKF8ZRr3tNuY9f1+XyX8xUsBNgsv2sgqer02gkZBb20PBxXs+00mSf999KaPAZSb9 kP0rJ5yDxYdZ0i0v8as6J6cbLM4rQm57Vrun1ApZPj0Y20/WojEdXNBu+lf7C9NuG9pS Zoew== X-Gm-Message-State: AGi0PuavZvdrTaG9oSVb+prdimy1/UH/wrGJ5yw3X/jctdEMR8byspNV ceaoXjIpHVoy7I5pJFfrkcCoupbU X-Google-Smtp-Source: APiQypKvuNd0diTFiCP2ABR+CjW3BLU01KDzIV2D1YC2OewkG2LIgV1Hy3zoGXX3tTkMIInCWr6ixw== X-Received: by 2002:ac8:6c57:: with SMTP id z23mr28733880qtu.359.1587072314806; Thu, 16 Apr 2020 14:25:14 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v1 1/7] qemu: Add capability for CFPC pSeries feature Date: Thu, 16 Apr 2020 18:24:58 -0300 Message-Id: <20200416212504.1302047-2-danielhb413@gmail.com> In-Reply-To: <20200416212504.1302047-1-danielhb413@gmail.com> References: <20200416212504.1302047-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03GLPKmW002982 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" CFPC (Cache Flush on Privilege Change) is one of the capabilities added to QEMU to mitigate Spectre vulnerabilities in Power chips. It was implemented in QEMU 2.12 by commit 6898aed77f46. This capability is still used today due to differences in how the host setup (hardware and firmware/kernel) can handle this mitigation. Its default value also varies with the pseries machine version of the time. There's also certain OSes, like AIX, that might not support the default value of the pseries machine the guest uses. Exposing this in the Libvirt XML as a feature will allow users to tune CFPC values in a cleaner way, instead of hacking parameters in elements. Signed-off-by: Daniel Henrique Barboza --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml | 1 + tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml | 1 + 8 files changed, 9 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index fe311048d4..4a262dc71d 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -573,6 +573,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "fsdev.multidevs", "virtio.packed", "pcie-root-port.hotplug", + "machine.pseries.cap-cfpc", ); =20 =20 @@ -1615,6 +1616,7 @@ static struct virQEMUCapsStringFlags virQEMUCapsMachi= nePropsPSeries[] =3D { { "cap-htm", QEMU_CAPS_MACHINE_PSERIES_CAP_HTM }, { "cap-nested-hv", QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV }, { "cap-ccf-assist", QEMU_CAPS_MACHINE_PSERIES_CAP_CCF_ASSIST }, + { "cap-cfpc", QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC }, }; =20 static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsVirt[] =3D { diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index 1681fc79a8..81d67d2efe 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -554,6 +554,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for = syntax-check */ QEMU_CAPS_FSDEV_MULTIDEVS, /* fsdev.multidevs */ QEMU_CAPS_VIRTIO_PACKED_QUEUES, /* virtio.packed */ QEMU_CAPS_PCIE_ROOT_PORT_HOTPLUG, /* pcie-root-port.hotplug */ + QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC, /* -machine pseries.cap-cfpc */ =20 QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml b/tests/qemuc= apabilitiesdata/caps_2.12.0.ppc64.xml index 38a3103c4a..cdd4f26993 100644 --- a/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_2.12.0.ppc64.xml @@ -154,6 +154,7 @@ + 2011090 0 42900289 diff --git a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_3.0.0.ppc64.xml index 9a0b9c05c2..84e9ad2dcc 100644 --- a/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_3.0.0.ppc64.xml @@ -156,6 +156,7 @@ + 2012050 0 42900239 diff --git a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_3.1.0.ppc64.xml index 6801023208..3d70a67dab 100644 --- a/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_3.1.0.ppc64.xml @@ -161,6 +161,7 @@ + 3000091 0 42900240 diff --git a/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_4.0.0.ppc64.xml index f7e69fcc97..ce2d470cb2 100644 --- a/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml @@ -175,6 +175,7 @@ + 4000000 0 42900240 diff --git a/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_4.2.0.ppc64.xml index 99ec98e8cd..a813776660 100644 --- a/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_4.2.0.ppc64.xml @@ -180,6 +180,7 @@ + 4001050 0 42900242 diff --git a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml b/tests/qemuca= pabilitiesdata/caps_5.0.0.ppc64.xml index b08916132a..c33786b0bf 100644 --- a/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml +++ b/tests/qemucapabilitiesdata/caps_5.0.0.ppc64.xml @@ -192,6 +192,7 @@ + 4002050 0 42900241 --=20 2.25.2 From nobody Sun May 5 22:03:00 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=1587072335; cv=none; d=zohomail.com; s=zohoarc; b=KbfsJbj42srvCTYUbODgWPv9H1rzz4e1rHsc9mze+7s7z0mG89WKlvytTrfjXxPl482syufqtbW1W3MsqyoSn/h3j6gJ2YFXhVU5UUsG/DLhGEd6Qjzu4e6DnblZfxFAludnte4z9bwfAQFeVgmLyGYra0TjiSI1wWp5GZ2ePm4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587072335; 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=zdCRK02Nxbokxd7vKs3UhSItaXETx2+iJeuARjgFH5s=; b=LI0sXQ/Qtt011XM42BcBAH1FCuH42OnF7Tf4kRfE/TrV2/58bjgoRV7FAVuIY6iJ3tQCfU7OnrPZgvTBqil5PIQUzVDLVODezsDfl9YmSek8+2x/7l1EqElV+fVT8BOp7SGu6R5rJV+fbxyo0toiKp+ceNd9WTefGwHimr/y9Co= 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 1587072335187261.1995153741542; Thu, 16 Apr 2020 14:25:35 -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-222-IU3xbJxVP_6zzN3QE2MTMg-1; Thu, 16 Apr 2020 17:25:31 -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 7B82013FB; Thu, 16 Apr 2020 21:25:25 +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 0B9FD19756; Thu, 16 Apr 2020 21:25:25 +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 4DF2D18089CE; Thu, 16 Apr 2020 21:25:22 +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 03GLPKiR002985 for ; Thu, 16 Apr 2020 17:25:20 -0400 Received: by smtp.corp.redhat.com (Postfix) id 5160213BF54; Thu, 16 Apr 2020 21:25:20 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4CFCD13BF46 for ; Thu, 16 Apr 2020 21:25:20 +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 2C87C8FF67A for ; Thu, 16 Apr 2020 21:25:20 +0000 (UTC) Received: from mail-qv1-f43.google.com (mail-qv1-f43.google.com [209.85.219.43]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-485-m9t7y9QWPpaqxJcLGRBDnA-1; Thu, 16 Apr 2020 17:25:17 -0400 Received: by mail-qv1-f43.google.com with SMTP id v38so2852184qvf.6 for ; Thu, 16 Apr 2020 14:25:17 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:b6b7:222c:adc1:59c6:6fc1]) by smtp.gmail.com with ESMTPSA id j2sm12059821qtp.5.2020.04.16.14.25.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Apr 2020 14:25:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587072333; 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=zdCRK02Nxbokxd7vKs3UhSItaXETx2+iJeuARjgFH5s=; b=ijgXoLtaSGV9TE3xx/ysA+rY9bXlIqRLRyC2LFCtav7uoc0xwe9fH3hizXOmSWhSK/OlsY Or8lRLYjhFrK1dTY6bJnjSlYz7lDaOWZEmjCXYdg9tKrY7drT7PKO4nO20E9//s46PD/qd LkWT1xskv3dlXNvjFvFWXFQSeB60LxU= X-MC-Unique: IU3xbJxVP_6zzN3QE2MTMg-1 X-MC-Unique: m9t7y9QWPpaqxJcLGRBDnA-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=zI8wk0vyxbguI5+hUARzhD/q9Ec9dQkQUJGgkCyhoEI=; b=CsmUQ8h1g92betfpiNNMpN1iH614q3nuCwnSUZjLTpW1v5pPnWr78k2cDEkVi5ycEm tFQHOdqNygKOrNHY3fOiBqWIAylnZssStSi0ic0lpN9H6FwO6RdP2L88Pq2/LTfKPUrA r7CRH6mm460akKsOHy6NzA+dRP1RWkVCIXcBc13O7TFUySb6P2KpULFf8mu8t91laejX DmRFyrM+skuge1QBa/rHil9POQaXr9AO8pIAg0TwnKzNsP9d4PvCc7eFPz9qH1BVq8Wu JBhLx0qMNAPWqrrjtHAuezec1VvOSk0wfXrK9vx5H2CiitZ0Mavq3IU3fev8H7qR9eQ+ Fb2g== X-Gm-Message-State: AGi0Puaj8kdeiUCa6lrNbvCfIPnyCZmjJyRix2zNt/RPB1UHS0C0ughZ zT4nWQYI767AYF21XtFOzltj2C8a X-Google-Smtp-Source: APiQypLPwwdNWHaW1Lb7iB+NkuQ7TOJdxx8wTvtzA6DFCxVPMHJy85A1C8duGZHPijep3HS5Ii9irw== X-Received: by 2002:a05:6214:294:: with SMTP id l20mr12229575qvv.46.1587072316406; Thu, 16 Apr 2020 14:25:16 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v1 2/7] qemu: Implement the CFPC pSeries feature Date: Thu, 16 Apr 2020 18:24:59 -0300 Message-Id: <20200416212504.1302047-3-danielhb413@gmail.com> In-Reply-To: <20200416212504.1302047-1-danielhb413@gmail.com> References: <20200416212504.1302047-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03GLPKiR002985 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" 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 --- docs/formatdomain.html.in | 11 +++++ docs/schemas/domaincommon.rng | 15 +++++++ src/conf/domain_conf.c | 45 +++++++++++++++++++ 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, 122 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 0077666862..607e815413 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2074,6 +2074,7 @@ <htm state=3D'on'/> <ccf-assist state=3D'on'/> <msrs unknown=3D'ignore'/> + <cfpc value=3D'workaround'/> </features> ... =20 @@ -2379,6 +2380,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 65d6580434..40785752f7 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5430,6 +5430,9 @@ + + + @@ -5689,6 +5692,18 @@ =20 + + + + + broken + workaround + fixed + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 8700d56761..4bfb17b7c8 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -173,6 +173,7 @@ VIR_ENUM_IMPL(virDomainFeature, "nested-hv", "msrs", "ccf-assist", + "cfpc", ); =20 VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, @@ -1251,6 +1252,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); @@ -20961,6 +20970,22 @@ virDomainDefParseXML(xmlDocPtr xml, } 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: @@ -23266,6 +23291,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 @@ -29024,6 +29061,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 7d8f1aa31b..a59e3cd41a 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1814,6 +1814,7 @@ typedef enum { VIR_DOMAIN_FEATURE_NESTED_HV, VIR_DOMAIN_FEATURE_MSRS, VIR_DOMAIN_FEATURE_CCF_ASSIST, + VIR_DOMAIN_FEATURE_CFPC, =20 VIR_DOMAIN_FEATURE_LAST } virDomainFeature; @@ -1970,6 +1971,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 ec367653d5..df48176e6a 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 95402fc4ff..302cee79ad 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7163,6 +7163,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 971e4a945a..11d310ed8f 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 66472a5ee5..8cb53b2416 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1963,6 +1963,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 */ @@ -1971,7 +1972,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", @@ -1979,6 +1981,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 */ @@ -1987,6 +1990,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 */ @@ -1995,6 +1999,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 */ @@ -2003,8 +2008,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 cf5abeac35..41510fd17a 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -694,7 +694,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.2 From nobody Sun May 5 22:03:00 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=1587072356; cv=none; d=zohomail.com; s=zohoarc; b=NwVScLHPHju5v6LrhJlPXoubxY7hVGtqBEm5y7kvEN7UEVIjngUPr+Yzu8DWezTGwDNnZFaCWMvXHgXUxTH9L1SlJwJqmxMwPxexq7ORa23SYGcronVkow5C8bVf89BaH5gLuec2T5GJDtQLfsB2S9TxdasD8LOI6hfsMHpOZME= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587072356; 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=2uDthjJjJN1I+RaenN1/yk1pYt8m293GUZXC8q0yk04=; b=VHblhyDqd1mvyrM/Z2GSzr4HkFyKjtXtzVvm9iJHg0CDgPr0eTcpcSff6skOBXbWU8gIb6qKsjIaR71lZWWjq71cchj2z8f9DBeoQmr87XnTon62/kbYo8cXj53poUGfFwja2ncwkqDvaZKe5nd6rmI4WaVkt0Je/CzVpSW8siM= 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-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1587072356642695.7625318673612; Thu, 16 Apr 2020 14:25:56 -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-371-1oTwYF1SO2isPIFW9t9QVQ-1; Thu, 16 Apr 2020 17:25:52 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5BEDA18C35A3; Thu, 16 Apr 2020 21:25:47 +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 22C147E7E1; Thu, 16 Apr 2020 21:25:47 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8647318089D6; Thu, 16 Apr 2020 21:25:46 +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 03GLPNNP003004 for ; Thu, 16 Apr 2020 17:25:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id C856F1006ECA; Thu, 16 Apr 2020 21:25:23 +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 C42841006B2C for ; Thu, 16 Apr 2020 21:25:21 +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 26264800296 for ; Thu, 16 Apr 2020 21:25:21 +0000 (UTC) Received: from mail-qv1-f68.google.com (mail-qv1-f68.google.com [209.85.219.68]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-227-CLohrf9zN0qzJcRqBDFaPg-1; Thu, 16 Apr 2020 17:25:18 -0400 Received: by mail-qv1-f68.google.com with SMTP id di6so2846724qvb.10 for ; Thu, 16 Apr 2020 14:25:18 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:b6b7:222c:adc1:59c6:6fc1]) by smtp.gmail.com with ESMTPSA id j2sm12059821qtp.5.2020.04.16.14.25.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Apr 2020 14:25:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587072355; 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=2uDthjJjJN1I+RaenN1/yk1pYt8m293GUZXC8q0yk04=; b=beFUfcYErVvpcvcNhX/LWwJKJR9b0NIU+alT87+0iGXt41PVMqjQjK9tV4dr5LXmrIAJet Z+bfwdsJPxBgQOqlpoTAST2Y1fbaC5KqJn643yu44vlwUZB24Lw8uYPTL+31x4ZwuiAYKB jYAYgC59nvcJXckbr02MiEVQkORThR4= X-MC-Unique: 1oTwYF1SO2isPIFW9t9QVQ-1 X-MC-Unique: CLohrf9zN0qzJcRqBDFaPg-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=t57ShA4Uj9nDjls985pHOvtOeW/RtO9YEv9r7Sl5J1w=; b=KiTRvK/pdsfD7GV3lSqF39v06PYg1BMsqsDxEfaHt9Udo35VaMUmne2BDD31aVofKE OzIwJm5CiN5Lje+iVXVzX6AJUE8DTvD81aVsh8b5Bzsbsw3ZjI30le8c8rMvymWotKUb 2kwsrkceBfxrQLSqPTQKobOsRBBbjANeRySxOZ7QAUNLHya57zIgjyKs/wAidckWORPu GV6Vk+Phem3o72vFjXy/SlsnrvjK+4vYFV/XpczO8q5/xNVo0LG58nvz5hJDMHluBjPp Ddx3Q7qhK4hC/wbz56bL23mXgjzcJoo6TEIlaT0FlzhVJfuXXriiL8J3rVIujQ1wqfK9 B32A== X-Gm-Message-State: AGi0PuZb2zJFyBob9qEvdTGEJhgFuvTlvKncbH2XD4fS3fl0nP3MrYwY xy3FhCb9Rf2xgv2Y9AkcKZFc2axa X-Google-Smtp-Source: APiQypKYTx/ZZ22yGi8xzg8PIjy2M9oebwI66KWGPxK1D+ad6KOLZkh2L0AaBvA7UoNc9dlwGdpPmg== X-Received: by 2002:a0c:ebd2:: with SMTP id k18mr5898190qvq.27.1587072317797; Thu, 16 Apr 2020 14:25:17 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v1 3/7] qemu: Add capability for SBBC pSeries feature Date: Thu, 16 Apr 2020 18:25:00 -0300 Message-Id: <20200416212504.1302047-4-danielhb413@gmail.com> In-Reply-To: <20200416212504.1302047-1-danielhb413@gmail.com> References: <20200416212504.1302047-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03GLPNNP003004 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.11 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 --- 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 4a262dc71d..dd04393c95 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", "machine.pseries.cap-cfpc", + "machine.pseries.cap-sbbc", ); =20 =20 @@ -1617,6 +1618,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 81d67d2efe..83932fb96f 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_MACHINE_PSERIES_CAP_CFPC, /* -machine pseries.cap-cfpc */ + QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, /* -machine pseries.cap-sbbc */ =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 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.2 From nobody Sun May 5 22:03:00 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=1587072362; cv=none; d=zohomail.com; s=zohoarc; b=FnNYpcGfKsGrRe6mhi10nfH659hqvDV+GZTJ2bMNoeLm/pgDMUmiJg7bIrbFZ07rIEwifk2bzFegxxvzxQ+Q1EXWSKrom7WmEWoSkPeA8GxoRdO29mMpg6VGmPxaTBgT4Iy7O7IoSyAmwkQ/1qe2m6IGXb9xs6C54fP3ELV3XSI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587072362; 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=zl5B2bvGZKA4TAc6SN6MAghAFvzo+i3tF2qtiM17t6c=; b=Kzfob/9fVw6Q2lEGvg9NYlV1joX0eqdPmHOvoqvYz31nZ4dMdnYxiGMfDiAFu7329ld8Sa1bx96uOLUIW4AwXZIlvJXHRg+WWCWiRvVyY2F0U62parL7uVEzoCiKNWbdqjAYFMJkiOQjeXFk21DtJdiFwsODvXEvLpU08n+He6g= 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 158707236267033.85862004810269; Thu, 16 Apr 2020 14:26:02 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-233-xDv5suiqPNKwBt2DuxHPmg-1; Thu, 16 Apr 2020 17:25:57 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8F267108442E; Thu, 16 Apr 2020 21:25:52 +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 5BFC8100EBAD; Thu, 16 Apr 2020 21:25:52 +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 02972180887A; Thu, 16 Apr 2020 21:25:52 +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 03GLPNhg003005 for ; Thu, 16 Apr 2020 17:25:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id C97451006B2C; Thu, 16 Apr 2020 21:25:23 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C42BC1006EC1 for ; Thu, 16 Apr 2020 21:25:22 +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 A24A9867B07 for ; Thu, 16 Apr 2020 21:25:22 +0000 (UTC) Received: from mail-qt1-f169.google.com (mail-qt1-f169.google.com [209.85.160.169]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-292-HCIkpjA-PLCaqIAlI6UVCg-1; Thu, 16 Apr 2020 17:25:20 -0400 Received: by mail-qt1-f169.google.com with SMTP id l13so202936qtr.7 for ; Thu, 16 Apr 2020 14:25:20 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:b6b7:222c:adc1:59c6:6fc1]) by smtp.gmail.com with ESMTPSA id j2sm12059821qtp.5.2020.04.16.14.25.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Apr 2020 14:25:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587072361; 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=zl5B2bvGZKA4TAc6SN6MAghAFvzo+i3tF2qtiM17t6c=; b=arwtbdkU51TU1OtoUkJzt9WHoS3Xqht5tzDHOC/ar1YY1hUDaYJq+6h9fqNu8TzONobnPR dQdEygowdjRO5ycxEYYuTy2xNTZmk88MThnv9jB6YmEAEEYiw6GYvpV4JKNsDn41YHfOMm QZttobmTgla0ReyZStapSoSp2TSXpqY= X-MC-Unique: xDv5suiqPNKwBt2DuxHPmg-1 X-MC-Unique: HCIkpjA-PLCaqIAlI6UVCg-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=CpuAUcgdM0bSmb0XnoEdlx5xsL9v5kPxCL7Cg4DdhsQ=; b=MDVYUcaiiHB53fqlkNLSordzVre5cZ4qjbhH6gt4lWdlSm/ZKLntOhut0jh1xGBMHl RUERcGFnYh0MxaLRuQ82dEFHyP+X9FKhFZaeiLP2TolM/LYmh9BMSFcaGhSXycz7AFkk 117k1CRlqz9ftH8Nk1bwFzc3wXeMIG43m/Sy6nXD1dEfYZDKP0R1LoC1GxWV5BaBf2JR 44w2+T+ENpZ/AYupMHXFGSTZ7dkeIxiUij2tqzuowbUaXnpPIVfX+s2LBpgD0OKijkDl aYbf9jj9/Jap/BXVrwvkv0CZkgzRHpUuwWwsa/C6bBZbUW+UqXh3vXGtcoEw7dzD6osO 4+SQ== X-Gm-Message-State: AGi0PuahrF0o6iU3dyGC9p87GBAUSeYjq/6u9/jVoj99KRcIJerAWF/o JQrItbvPsu0gNuIlAPwNai3tL2zG X-Google-Smtp-Source: APiQypJUa7lw0XfSGEzShceKBeLaVVTNfIz9HVr2I4ahcdreTzNCVV/R36dMVhfQaJLZl4f6HtS3nQ== X-Received: by 2002:ac8:c84:: with SMTP id n4mr28629820qti.24.1587072319368; Thu, 16 Apr 2020 14:25:19 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v1 4/7] qemu: Implement the SBBC pSeries feature Date: Thu, 16 Apr 2020 18:25:01 -0300 Message-Id: <20200416212504.1302047-5-danielhb413@gmail.com> In-Reply-To: <20200416212504.1302047-1-danielhb413@gmail.com> References: <20200416212504.1302047-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03GLPNhg003005 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" 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 CPFC 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 --- docs/formatdomain.html.in | 11 +++++ docs/schemas/domaincommon.rng | 15 +++++++ src/conf/domain_conf.c | 43 +++++++++++++++++++ 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, 122 insertions(+), 4 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 607e815413..2146374475 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2075,6 +2075,7 @@ <ccf-assist state=3D'on'/> <msrs unknown=3D'ignore'/> <cfpc value=3D'workaround'/> + <sbbc value=3D'workaround'/> </features> ... =20 @@ -2390,6 +2391,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 40785752f7..72c281aa8f 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5433,6 +5433,9 @@ + + +
@@ -5704,6 +5707,18 @@
=20 + + + + + broken + workaround + fixed + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 4bfb17b7c8..5373b29263 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -174,6 +174,7 @@ VIR_ENUM_IMPL(virDomainFeature, "msrs", "ccf-assist", "cfpc", + "sbbc", ); =20 VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, @@ -1260,6 +1261,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); @@ -20985,6 +20994,20 @@ virDomainDefParseXML(xmlDocPtr xml, } 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; =20 case VIR_DOMAIN_FEATURE_HTM: case VIR_DOMAIN_FEATURE_NESTED_HV: @@ -23303,6 +23326,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 @@ -29069,6 +29104,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 a59e3cd41a..c04441e587 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1815,6 +1815,7 @@ typedef enum { VIR_DOMAIN_FEATURE_MSRS, VIR_DOMAIN_FEATURE_CCF_ASSIST, VIR_DOMAIN_FEATURE_CFPC, + VIR_DOMAIN_FEATURE_SBBC, =20 VIR_DOMAIN_FEATURE_LAST } virDomainFeature; @@ -1982,6 +1983,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 df48176e6a..99e74eee84 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 302cee79ad..0c3b37760a 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7168,6 +7168,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 11d310ed8f..f75cec93c2 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 8cb53b2416..0b4dc0dec5 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1964,6 +1964,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 */ @@ -1973,7 +1974,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", @@ -1982,6 +1984,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 */ @@ -1991,6 +1994,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 */ @@ -2000,6 +2004,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 */ @@ -2009,6 +2014,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 */ @@ -2018,7 +2024,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 41510fd17a..9e1b5be13c 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -695,7 +695,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.2 From nobody Sun May 5 22:03:00 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=1587072367; cv=none; d=zohomail.com; s=zohoarc; b=dGN3r/zQxoJVdiDrRRJS+QkGhBOYbxk4/PCU+c4sLxB/7QN2BlhsF1CZIL4ah9qm59Py2AYH09BWWdbCkUCsSXGwCN6sQtx/bQxuJ6y4mGo03QDpg6mH7cAhkojY+Vp2gNkzVs+hH6sk+e+kGKiyQ1gpBxoNrO7pwlCW9eVYzWU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587072367; 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=4gYrEH/+5W1gxVDTcI7Bqd3GiSnX6DCR1KmWmF3/pyQ=; b=OG7ShaohPXjppHsLs9Lqj28lQXaV0KLFC7gT5OpoyAWkXOfs46AjOXJaf5AYZgctSMY32s2s/p/4lNsRG65PBegOZ/6SsCH8ir+gur3qlwJFr9F3Xb1KqrQASlYsw78N1/JI++rNOUVSA+WqPgBZIRh8lUDjRUVhonomKsDtC5s= 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 1587072367985497.95623949944604; Thu, 16 Apr 2020 14:26:07 -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-403-KxGvtmffN9CCdrD_DUPNWA-1; Thu, 16 Apr 2020 17:26:04 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A28781005513; Thu, 16 Apr 2020 21:25:59 +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 736AA116D9B; Thu, 16 Apr 2020 21:25:59 +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 19C669339B; Thu, 16 Apr 2020 21:25:59 +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 03GLPPhe003015 for ; Thu, 16 Apr 2020 17:25:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1B5FD1006EC1; Thu, 16 Apr 2020 21:25:25 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 170CD1006B2C for ; Thu, 16 Apr 2020 21:25:25 +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 F2D45185A790 for ; Thu, 16 Apr 2020 21:25:24 +0000 (UTC) Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-302-XuIULuLNNVi6H7ZcAre3hg-1; Thu, 16 Apr 2020 17:25:21 -0400 Received: by mail-qk1-f196.google.com with SMTP id 20so201290qkl.10 for ; Thu, 16 Apr 2020 14:25:21 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:b6b7:222c:adc1:59c6:6fc1]) by smtp.gmail.com with ESMTPSA id j2sm12059821qtp.5.2020.04.16.14.25.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Apr 2020 14:25:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587072366; 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=4gYrEH/+5W1gxVDTcI7Bqd3GiSnX6DCR1KmWmF3/pyQ=; b=Kuig5oCCgQjLPoKaXAV+R9exJU0GzwR3MtOefRwHBH0lfvnUzlVaYj4dMgynY8qdrk+oX7 gVWg472yEhInSXO6KyucEyKU637wug1DE5lwu5cgDqKY4LhxbQ+iqoo2sx7cRUP3JqZdm7 EFTrU0amu+kn+e16rMvAEvuKj1a6q/U= X-MC-Unique: KxGvtmffN9CCdrD_DUPNWA-1 X-MC-Unique: XuIULuLNNVi6H7ZcAre3hg-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=xYoXyUgpZJYo3g14bwHFZm2rnxGUGiAybTxtUBSMRxM=; b=TU4UZXLUdIJp0CaFiSgYRIw5iAtPNMYkv3pBYCuG9VsO0sN0WQxSrpGU4l3jVpZSBS 5kFTnJ62GwNSUwF0//d3wjoDfokHw0KCQoua0GDE/BfIVGyZ9YJgzvI0yF4s4ZbC/e59 tChujTvi1zNdddMqYcThy8BGovij7A9tiW0fjN03K2pO2QJR9u6FG+Ca1KLLqv3oOOsE jwGpyDuZ6z7PM7235DjQduOb2GBRCUE/o88CXS0V/K6SZ0nO+58Wzmrr4zEK+pfwXwSQ etpY0dhOaZKwsUnLCFBsYbcbhlCibLmmsQLJEhnlqa24p3m6rLiVKxweu99KFmTLzRCp xsLA== X-Gm-Message-State: AGi0PuYituD4Ffr1gbInlyUUZTiK1RWgMGSu1ewo1Vs3hkp8Geu3rEKu +UHbfGqWQzxm6gceYq8vbZEyBr5j X-Google-Smtp-Source: APiQypJLRBlaERTCLiLLjBO3SeQASXLWu2oo9/JbxdJAIBtaHmpwjOo+IBKSSZ9L+WhPTb4bEhWjMw== X-Received: by 2002:a37:4b56:: with SMTP id y83mr41168qka.159.1587072320903; Thu, 16 Apr 2020 14:25:20 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v1 5/7] qemu: Add capability for IBS pSeries feature Date: Thu, 16 Apr 2020 18:25:02 -0300 Message-Id: <20200416212504.1302047-6-danielhb413@gmail.com> In-Reply-To: <20200416212504.1302047-1-danielhb413@gmail.com> References: <20200416212504.1302047-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03GLPPhe003015 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.15 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 --- 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 dd04393c95..4ea01d4ea9 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", "machine.pseries.cap-cfpc", "machine.pseries.cap-sbbc", + + /* 365 */ + "machine.pseries.cap-ibs", ); =20 =20 @@ -1619,6 +1622,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 83932fb96f..21e3eb3327 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_MACHINE_PSERIES_CAP_CFPC, /* -machine pseries.cap-cfpc */ QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC, /* -machine pseries.cap-sbbc */ =20 + /* 365 */ + QEMU_CAPS_MACHINE_PSERIES_CAP_IBS, /* -machine pseries.cap-ibs */ + 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 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.2 From nobody Sun May 5 22:03:00 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=1587072360; cv=none; d=zohomail.com; s=zohoarc; b=GoKGHmcfhGo6FCcdo8tJ9ijwgo+iI2eKasPWO/SLmJDSGNQpK8nCNyrDdHxel2saRcaw5AELkRcfkciZwMwDemMFoYRzWYL3jRn6NlVA2j389Vdg5uQP8WVEHuwMcswSZL0mtTd/vvgdGHr9SGe6AWWOHj4C1WI6O7W/+ljPHS0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587072360; 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=/O59f1zJhGJ5QyTtAyidMcng3+awfs8ug/Lpo6SeZHk=; b=Kf8lABoHcKXEdaIw/hTHhiUyEt3SreI72qjCA53bKomdEzdBMUwGpKXnRDWjPXnGScqchOYVZKbGk+0AShUBBI6af7hBrH0UrBPpPZN915BQZmhPGB6dPKT4WbyGSXPXYnPJNn0ie4jtKfTwvuMqhsVeKxdVQ/s8qbd0sjmlJEs= 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 1587072360532176.07754422598134; Thu, 16 Apr 2020 14:26:00 -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-19-uGEy30DBPLKkmuPlvEVJqA-1; Thu, 16 Apr 2020 17:25:52 -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 6F09318C35A4; Thu, 16 Apr 2020 21:25:47 +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 26F26396; Thu, 16 Apr 2020 21:25:47 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8620A9339C; Thu, 16 Apr 2020 21:25:46 +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 03GLPPZ6003023 for ; Thu, 16 Apr 2020 17:25:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id A98CB13BF51; Thu, 16 Apr 2020 21:25:25 +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 A566C13BF46 for ; Thu, 16 Apr 2020 21:25:25 +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 87F29101A55A for ; Thu, 16 Apr 2020 21:25:25 +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-52-GToRti4WOVK5Qo03bZP2nQ-1; Thu, 16 Apr 2020 17:25:23 -0400 Received: by mail-qk1-f173.google.com with SMTP id l78so225045qke.7 for ; Thu, 16 Apr 2020 14:25:23 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:b6b7:222c:adc1:59c6:6fc1]) by smtp.gmail.com with ESMTPSA id j2sm12059821qtp.5.2020.04.16.14.25.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Apr 2020 14:25:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587072359; 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=/O59f1zJhGJ5QyTtAyidMcng3+awfs8ug/Lpo6SeZHk=; b=BADW/IAiRx4aZ3EIpEuZfFK3D/Z191Usiz2J0zUVSi9tKGj6txXmnVQ5Qr7s/GjFljj1y9 2aTpuUBupI28NDc8UeBrTCA+/67aodVPLoy1fI1jI5ONqGFgCPmviFG758cgoDtbKNLAU1 Op3JNb/DOh8CSnw8eE97S0WEEUikejg= X-MC-Unique: uGEy30DBPLKkmuPlvEVJqA-1 X-MC-Unique: GToRti4WOVK5Qo03bZP2nQ-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=E5quU41+8Bhbvwz43xt6yhV0R0/gJQOejfscLJUvtxc=; b=B3xxSNrqiHCMjnD/aL5/7wi6kSkSFPRyxjU5FSC252dtFEsJA6oM3D2vVJj8sIzxxk /iYft76HbHMrJpqHYe0pgJBpxZbX+vOVApibe8zITywk5z+O1E0maqUTLpjnQ8C0FRku J/NrG7/rmcYzn6YHB+5k1MFNkXQHHszeTMAZVlPjC28R5BlPj7U+PJkA2eHvqf+FvAD/ 6lCJiE57HWYKh6VutFiX9vJcLlFkst8xbMI9bHGa7OaZmt+oy7YOgUHj3HXq1vn9E1ob 2lLm84UuM7NY1ZIOlu3aM9miHYrO/ndLRmNFP7e8LBZCUXGWUfpw17BnwTHpnGsg5sty WVTw== X-Gm-Message-State: AGi0Pua2drJyFwCt7eLB5fNXselWE48bd5kPg2Dzj9FBy4H/+SvbOi6T Dn3gZEYViKR5cyHMUT7mfxlfxLYi X-Google-Smtp-Source: APiQypKKLouAHd2P1r5ze5DYM1Xz1NFQYwQ2+6esv4mfFtqsCnOm6ON/BqpLylJovXEIVdsW8ceGkQ== X-Received: by 2002:a05:620a:5f1:: with SMTP id z17mr49646qkg.21.1587072322313; Thu, 16 Apr 2020 14:25:22 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v1 6/7] qemu: Implement the IBS pSeries feature Date: Thu, 16 Apr 2020 18:25:03 -0300 Message-Id: <20200416212504.1302047-7-danielhb413@gmail.com> In-Reply-To: <20200416212504.1302047-1-danielhb413@gmail.com> References: <20200416212504.1302047-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03GLPPZ6003023 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" 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 --- 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 2146374475..01aa825fc6 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2076,6 +2076,7 @@ <msrs unknown=3D'ignore'/> <cfpc value=3D'workaround'/> <sbbc value=3D'workaround'/> + <ibs value=3D'fixed-na'/> </features> ... =20 @@ -2401,6 +2402,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 72c281aa8f..75d5cd3271 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -5436,6 +5436,9 @@ + + +
@@ -5719,6 +5722,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 5373b29263..dfa7421249 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -175,6 +175,7 @@ VIR_ENUM_IMPL(virDomainFeature, "ccf-assist", "cfpc", "sbbc", + "ibs", ); =20 VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, @@ -1269,6 +1270,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); @@ -21009,6 +21020,21 @@ virDomainDefParseXML(xmlDocPtr xml, } 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: @@ -23338,6 +23364,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 @@ -29112,6 +29150,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 c04441e587..a5582f7a34 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1816,6 +1816,7 @@ typedef enum { VIR_DOMAIN_FEATURE_CCF_ASSIST, VIR_DOMAIN_FEATURE_CFPC, VIR_DOMAIN_FEATURE_SBBC, + VIR_DOMAIN_FEATURE_IBS, =20 VIR_DOMAIN_FEATURE_LAST } virDomainFeature; @@ -1994,6 +1995,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 99e74eee84..09a6ca8956 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 0c3b37760a..32565b49a9 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7173,6 +7173,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 f75cec93c2..7d356f683a 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 0b4dc0dec5..eb509e0bc0 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1965,6 +1965,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 */ @@ -1975,7 +1976,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", @@ -1985,6 +1987,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 */ @@ -1995,6 +1998,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 */ @@ -2005,6 +2009,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 */ @@ -2015,6 +2020,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 */ @@ -2025,7 +2031,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", @@ -2035,7 +2042,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 9e1b5be13c..78fa9060e1 100644 --- a/tests/qemuxml2xmltest.c +++ b/tests/qemuxml2xmltest.c @@ -696,7 +696,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.2 From nobody Sun May 5 22:03:00 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=1587072360; cv=none; d=zohomail.com; s=zohoarc; b=dLJkRVL/0YbOW6140YJTeouj3XqtLg/cTBuurwEZ461fKoP1E8xFyl2ID94MVnFrpXu0NTJ2XspCuRQDOxlxcAmNxUadTAaA3tniIGNnJJlES6oybzc7plvNsV+ZllqnrZ40vSaug9LzXnNPtVg67CMhjrmkA9bzfcnhTiWviQw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587072360; 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=gU77uNmlnqvflQx2uqHc7mFidj5yBC/TLU+ZAuh1sXw=; b=aFIVhJuNBLPGPGR1Crv7rPImKZK6oBAI58q1p5SDqpFcRfb730Z/kUA0vUljxHY4jGovVWpjffG9cBktij+ovDFaxJA8WCf10188Dio0nuEYJNVmkDDv9Oq950+8ftDJuiQ/MPPt8N69/Utpjfy8c0FSKlVWMAm6JjFw7o2rXJI= 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 1587072360340181.25942029562748; Thu, 16 Apr 2020 14:26:00 -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-280-dgoLquwwMRSmBZIeI2AF3Q-1; Thu, 16 Apr 2020 17:25:56 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2A237107ACC4; Thu, 16 Apr 2020 21:25:51 +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 E84B8100EBAD; Thu, 16 Apr 2020 21:25:50 +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 7B6AF18089D7; Thu, 16 Apr 2020 21:25:50 +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 03GLPTn8003050 for ; Thu, 16 Apr 2020 17:25:29 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7B34C2166B2C; Thu, 16 Apr 2020 21:25:29 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast06.extmail.prod.ext.rdu2.redhat.com [10.11.55.22]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7755C2166B2F for ; Thu, 16 Apr 2020 21:25:26 +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 BF5B7185A78E for ; Thu, 16 Apr 2020 21:25:26 +0000 (UTC) Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-165-FlgDPtfIMRuqXgCWAMAMiw-1; Thu, 16 Apr 2020 17:25:24 -0400 Received: by mail-qk1-f193.google.com with SMTP id 20so201413qkl.10 for ; Thu, 16 Apr 2020 14:25:24 -0700 (PDT) Received: from rekt.ibmuc.com ([2804:431:c7c6:b6b7:222c:adc1:59c6:6fc1]) by smtp.gmail.com with ESMTPSA id j2sm12059821qtp.5.2020.04.16.14.25.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Apr 2020 14:25:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587072359; 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=gU77uNmlnqvflQx2uqHc7mFidj5yBC/TLU+ZAuh1sXw=; b=eKuVwzXfeLtw1gNRTSn2p+pLVbF+aB6qv3HKNvs3QZzJJIESojgOnHrq7BMq+kyu8uCNo1 5zKbkkZbMqSvoI52nJXVu+kchCVEj3phhgsUxBmsOr8XXNSa15hn6VtSVi0cOVm6tbwPjd iw3f+iJnn3AvtzvMID4X5w2jT6KfFrY= X-MC-Unique: dgoLquwwMRSmBZIeI2AF3Q-1 X-MC-Unique: FlgDPtfIMRuqXgCWAMAMiw-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=VzmU2QXWRWrNzOJYhWxQd4bGQRsUCidqAiCDLSTaJSY=; b=Y4bz8Lgbu2GClcWgQqRsHQ2858LQxYThjYh1U8g78Vm61BnELKDGtlg6N37HCz90Y9 NOx9PW65omwHr+I+uFQ6cXViT8tDbXcVPgAfYTmusPSuqOlUGAYNXqI0XEbbt13nwH1j AMtJqUTjk79w8UXxTHzbOs9A32O1Ba3HvgpMhUvavAeMeBrSBPQf+L8Eg2dcRwS6Ip7q VxPqwVCQaMu832EfYXe5Q4QH30WfIMHkwhtNCrIMhIWCRMvH6S/aUuY2FNF4Y5nKO2ZL rvjx0iNG34wACszbpOF+EeuUrF4V6hxUEHiCg1XPrYLzclqxgrRgAi53lfVim7FGmnS/ 0d4A== X-Gm-Message-State: AGi0PuZnqfaKmT8oG9zq2DbLRCsuJ8BmcrhCj60OocEwVlVideju8jSj cOTs6rcQeJjA/QYcIKKlYhNpXqE3 X-Google-Smtp-Source: APiQypJzgQqBQnz4qZm2T13pK5JX4bqE+qHcdERZyro3AacumuYUi3SbS5Ac+cb776iOgZ1tCYyAuQ== X-Received: by 2002:a37:a650:: with SMTP id p77mr65274qke.342.1587072323809; Thu, 16 Apr 2020 14:25:23 -0700 (PDT) From: Daniel Henrique Barboza To: libvir-list@redhat.com Subject: [PATCH v1 7/7] news: Update for the recent added pSeries features Date: Thu, 16 Apr 2020 18:25:04 -0300 Message-Id: <20200416212504.1302047-8-danielhb413@gmail.com> In-Reply-To: <20200416212504.1302047-1-danielhb413@gmail.com> References: <20200416212504.1302047-1-danielhb413@gmail.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03GLPTn8003050 X-loop: libvir-list@redhat.com Cc: Daniel Henrique Barboza X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Update news.xml to inform about the availability of CFPC, SBBC and IBS features. Signed-off-by: Daniel Henrique Barboza --- docs/news.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 4d0efd4219..2066f0eef3 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -56,6 +56,16 @@ hotplug/unplug attempts, but this is often undesireable). + + + 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.2