From nobody Wed Jan 15 11:45:47 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684234469; cv=none; d=zohomail.com; s=zohoarc; b=AXPuyMP747ZdjJQXF+ko7eRQmpqLQIveFzvdLB49BhChEX6FbOJb46myIBZEfyr6RlZ+NzfJTLi277k7uO+9ZUa3Vf33yU01FhfC9mZJnykcA6Eh9pd3Uv45SlL3gPypI5ypaSQukCVTicqo0gFlbFJG6cG4KHhaZz+CD7cY4Vw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684234469; h=Content-Type:Content-Transfer-Encoding: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=5IKM/xc8C3UBvBlX3YnH3BYOF70HTzPpC4KydfM7laM=; b=G/FRE5yBPDVSYcA2+SWdW8cxmPokvLZGr+rroyLgYQ1kU1XXdpqXLXqTiN37NneZNxQWkTgKGYwGW6NbCckzZSKVH0DF2IPmozUIQUKmaLMfCiEyYRQeZtBSMr2SjludbkpEwO3tapdIEgrztJI7ro+LoETy5MLIEFGxHu3IYNA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 16842344692221018.1654905796607; Tue, 16 May 2023 03:54:29 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-647-3JCHIq3WNfuXiOKm4jX_3A-1; Tue, 16 May 2023 06:54:25 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8A8C685A5B1; Tue, 16 May 2023 10:54:21 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7691814171C1; Tue, 16 May 2023 10:54:21 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5B92E19466DF; Tue, 16 May 2023 10:54:20 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id D4D0619465A3 for ; Tue, 16 May 2023 10:54:18 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 5057C2026D16; Tue, 16 May 2023 10:54:18 +0000 (UTC) Received: from localhost.localdomain (unknown [10.43.2.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC1C82027043 for ; Tue, 16 May 2023 10:54:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684234468; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=5IKM/xc8C3UBvBlX3YnH3BYOF70HTzPpC4KydfM7laM=; b=EmjjWDRd25VU7bgbNP0UIW5TAz55kEHuVaZQNI0v97K/r9fGCscKh+qxMFc95nnKHjxAxV s6cRMgXWvlaPFk4aW1pKrlw0Qmdr4iroQic4/ecdp9H5m4siIh2gCulhLVuzGT6JLpCitC /CRuULE21W1RTNV+T520+q8qQ2m4NYU= X-MC-Unique: 3JCHIq3WNfuXiOKm4jX_3A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/4] conf: Introduce MTE domain feature Date: Tue, 16 May 2023 12:54:13 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684234471190100005 Content-Type: text/plain; charset="utf-8"; x-default="true" The Memory Tagging Extensions are hardware acceleration present in some ARM processors that allow memory error detection [1]. Introduce a domain XML knob that turns them on or off. 1: https://www.arm.com/blogs/blueprint/memory-safety-arm-memory-tagging-ext= ension Signed-off-by: Michal Privoznik --- docs/formatdomain.rst | 7 +++++++ src/conf/domain_conf.c | 6 +++++- src/conf/domain_conf.h | 1 + src/conf/schemas/domaincommon.rng | 5 +++++ src/qemu/qemu_validate.c | 1 + tests/qemuxml2argvdata/aarch64-gic-v3.xml | 1 + tests/qemuxml2xmloutdata/aarch64-gic-v3.aarch64-latest.xml | 1 + 7 files changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 99383e725c..1f52f58d37 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -2000,6 +2000,7 @@ Hypervisors may allow certain CPU / machine features = to be toggled on/off. 128 + ... =20 @@ -2230,6 +2231,12 @@ are: tb-cache The size of translation block cache size an integer (= a multiple of MiB) :since:`8.0.0` =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D =20 +``mte`` + Configure Memory Tagging Extensions for ARM guests. Possible values for= the + ``state`` attribute are ``on`` and ``off``. If the attribute is not + defined, the hypervisor default will be used. :since:`Since 9.4.0` (QEM= U/KVM + only) + Time keeping ------------ =20 diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6a864a8db9..047a4c97bf 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -181,6 +181,7 @@ VIR_ENUM_IMPL(virDomainFeature, "sbbc", "ibs", "tcg", + "mte", ); =20 VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, @@ -16645,7 +16646,8 @@ virDomainFeaturesDefParse(virDomainDef *def, =20 case VIR_DOMAIN_FEATURE_HTM: case VIR_DOMAIN_FEATURE_NESTED_HV: - case VIR_DOMAIN_FEATURE_CCF_ASSIST: { + case VIR_DOMAIN_FEATURE_CCF_ASSIST: + case VIR_DOMAIN_FEATURE_MTE: { virTristateSwitch state; =20 if (virXMLPropTristateSwitch(nodes[i], "state", @@ -20486,6 +20488,7 @@ virDomainDefFeaturesCheckABIStability(virDomainDef = *src, case VIR_DOMAIN_FEATURE_HTM: case VIR_DOMAIN_FEATURE_NESTED_HV: case VIR_DOMAIN_FEATURE_CCF_ASSIST: + case VIR_DOMAIN_FEATURE_MTE: if (src->features[i] !=3D dst->features[i]) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, _("State of feature '%1$s' differs: source:= '%2$s', destination: '%3$s'"), @@ -27005,6 +27008,7 @@ virDomainDefFormatFeatures(virBuffer *buf, case VIR_DOMAIN_FEATURE_HTM: case VIR_DOMAIN_FEATURE_NESTED_HV: case VIR_DOMAIN_FEATURE_CCF_ASSIST: + case VIR_DOMAIN_FEATURE_MTE: switch ((virTristateSwitch) def->features[i]) { case VIR_TRISTATE_SWITCH_LAST: case VIR_TRISTATE_SWITCH_ABSENT: diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index c1cb2ed69d..3f8d6e81c0 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2169,6 +2169,7 @@ typedef enum { VIR_DOMAIN_FEATURE_SBBC, VIR_DOMAIN_FEATURE_IBS, VIR_DOMAIN_FEATURE_TCG, + VIR_DOMAIN_FEATURE_MTE, =20 VIR_DOMAIN_FEATURE_LAST } virDomainFeature; diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincom= mon.rng index f8c7b6a648..37e350ac2c 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -6653,6 +6653,11 @@ + + + + + diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index da4b9a3b35..99c7775e9b 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -123,6 +123,7 @@ qemuValidateDomainDefFeatures(const virDomainDef *def, break; =20 case VIR_DOMAIN_FEATURE_GIC: + case VIR_DOMAIN_FEATURE_MTE: if (def->features[i] =3D=3D VIR_TRISTATE_SWITCH_ON && !qemuDomainIsARMVirt(def)) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, diff --git a/tests/qemuxml2argvdata/aarch64-gic-v3.xml b/tests/qemuxml2argv= data/aarch64-gic-v3.xml index 247d6025f7..b9317284b0 100644 --- a/tests/qemuxml2argvdata/aarch64-gic-v3.xml +++ b/tests/qemuxml2argvdata/aarch64-gic-v3.xml @@ -10,6 +10,7 @@ + diff --git a/tests/qemuxml2xmloutdata/aarch64-gic-v3.aarch64-latest.xml b/t= ests/qemuxml2xmloutdata/aarch64-gic-v3.aarch64-latest.xml index 5b2fb7df75..1a74903aaa 100644 --- a/tests/qemuxml2xmloutdata/aarch64-gic-v3.aarch64-latest.xml +++ b/tests/qemuxml2xmloutdata/aarch64-gic-v3.aarch64-latest.xml @@ -10,6 +10,7 @@ + --=20 2.39.3