From nobody Wed Apr 24 11:59:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1549796997822456.46327856194523; Sun, 10 Feb 2019 03:09:57 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id BC1AA66962; Sun, 10 Feb 2019 11:09:54 +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 3FFD96017A; Sun, 10 Feb 2019 11:09:54 +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 A61F43F954; Sun, 10 Feb 2019 11:09:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1AB9mqG016655 for ; Sun, 10 Feb 2019 06:09:48 -0500 Received: by smtp.corp.redhat.com (Postfix) id 976046017A; Sun, 10 Feb 2019 11:09:48 +0000 (UTC) Received: from mx1.redhat.com (ext-mx04.extmail.prod.ext.phx2.redhat.com [10.5.110.28]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8DDDF6013E for ; Sun, 10 Feb 2019 11:09:46 +0000 (UTC) Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B756385550 for ; Sun, 10 Feb 2019 11:09:44 +0000 (UTC) Received: by mail-lf1-f66.google.com with SMTP id n15so1510606lfe.5 for ; Sun, 10 Feb 2019 03:09:44 -0800 (PST) Received: from kloomba.my.domain ([31.29.234.59]) by smtp.gmail.com with ESMTPSA id x16sm411442lff.72.2019.02.10.03.09.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Feb 2019 03:09:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VBBR0D5zemOZgH6fvLRkrLtSfg8rhkEhn6VMh48p55Q=; b=gABwWpto7vL3QZdkzstolYKEG05Zx/snkPKk3hPXbcFOYoMzEVdEr+LvS2wz+5awzM WJfvHBhIZvPxsGK5swE+t7Z/FBbQ8AnRn3MojZe+Htfgg/GvhGKm+wajMKUZNMmEqQY9 HbMbyzX1xQK9Pnr63dZzE46bFD5tNICv4+z878OnXggCtQ20XB7aCwyecr8T4NLFwlnI Snas16XfB0+PERhrAxMpHi80Fm4rrT1ttqEI17Rh6aMosSyNlb1pc9162rbJvNIoKHyY Bvwgp9BYTCfJXlPOYNUOs6J0zka9Cafd0oMdoAnG6xNv/bur22vKX2SRNs8Mf9BoHW28 r/uQ== 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=VBBR0D5zemOZgH6fvLRkrLtSfg8rhkEhn6VMh48p55Q=; b=E5+su5i4knMG5cYmNmujtNK0CagpfcEGUVr0aDCqkyE7MsFug3GWain8jVX+ulsfFt uYpHo/QmlpDfJrOAnpAyQ1QkM3grBJNbzEOTeN+PeTaLqcOEjP16zb1lgxbQNBojPINP e5OYlCFdyE3WBFqaeKHcYu1mZQVwWQA7mz5jVzJWqZETGmbwrfj6nkT7rjQ6efREYjU7 IkTeQZjrDDfr3GmV3FrACwrvUY6J74WpeQnXs4WHLF0Tb5jd9TniKWhmPhTfy4FKt6CX fiurQmwuH48k99Yn4IswPx1GaqV4MxRYWOq2ZEkMBzTbQVhi7JQhsWLJ3CMFh+XIh6LO wYNw== X-Gm-Message-State: AHQUAuaxFkSAA+GfSWNkHKJwCmZz4yGM31fD5eFZp869DMtd7q19ndip NZ3cJIyT5OJpvkfVMJmWSHYg3CII X-Google-Smtp-Source: AHgI3IaT69RG32WVPXcxnHvMgUerG4YwpGcr36clW7Ivgn+y2k42TOKAoHRW+dlvpck4bgqVbuM8oA== X-Received: by 2002:ac2:53b1:: with SMTP id j17mr12563214lfh.143.1549796982677; Sun, 10 Feb 2019 03:09:42 -0800 (PST) From: Roman Bogorodskiy To: libvir-list@redhat.com Date: Sun, 10 Feb 2019 15:09:30 +0400 Message-Id: <20190210110932.61316-2-bogorodskiy@gmail.com> In-Reply-To: <20190210110932.61316-1-bogorodskiy@gmail.com> References: <20190210110932.61316-1-bogorodskiy@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sun, 10 Feb 2019 11:09:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sun, 10 Feb 2019 11:09:45 +0000 (UTC) for IP:'209.85.167.66' DOMAIN:'mail-lf1-f66.google.com' HELO:'mail-lf1-f66.google.com' FROM:'bogorodskiy@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.167.66 mail-lf1-f66.google.com 209.85.167.66 mail-lf1-f66.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Roman Bogorodskiy Subject: [libvirt] [PATCH v2 1/3] conf: introduce 'msrs' feature 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: , Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sun, 10 Feb 2019 11:09:55 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Introduce the 'msrs' feature element that controls Model Specific Registers related behaviour. At this moment it allows only single tunable attribute "unknown": Which tells hypervisor to ignore accesses to unimplemented Model Specific Registers. The only user of that for now is going to be the bhyve driver. Signed-off-by: Roman Bogorodskiy Reviewed-by: Cole Robinson --- docs/formatdomain.html.in | 1 + docs/schemas/domaincommon.rng | 14 +++++++++++++ src/conf/domain_conf.c | 38 +++++++++++++++++++++++++++++++++++ src/conf/domain_conf.h | 16 +++++++++++++++ src/qemu/qemu_domain.c | 1 + 5 files changed, 70 insertions(+) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 2ae5006849..5b03812b16 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2010,6 +2010,7 @@ <tlbflush state=3D'on'/> <ipi state=3D'on'/> <evmcs state=3D'on'/> + <msrs unknown=3D'ignore'/> </hyperv> <kvm> <hidden state=3D'on'/> diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index ba80440c72..5345e54342 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -4997,6 +4997,9 @@ + + + @@ -5245,6 +5248,17 @@ =20 + + + + + ignore + fault + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 6772c327ed..a3c43037d7 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -157,6 +157,7 @@ VIR_ENUM_IMPL(virDomainFeature, VIR_DOMAIN_FEATURE_LAST, "vmcoreinfo", "htm", "nested-hv", + "msrs", ); =20 VIR_ENUM_IMPL(virDomainCapabilitiesPolicy, VIR_DOMAIN_CAPABILITIES_POLICY_= LAST, @@ -186,6 +187,11 @@ VIR_ENUM_IMPL(virDomainKVM, VIR_DOMAIN_KVM_LAST, "hidden", ); =20 +VIR_ENUM_IMPL(virDomainMsrsUnknown, VIR_DOMAIN_MSRS_UNKNOWN_LAST, + "ignore", + "fault", +); + VIR_ENUM_IMPL(virDomainCapsFeature, VIR_DOMAIN_CAPS_FEATURE_LAST, "audit_control", "audit_write", @@ -20330,6 +20336,7 @@ virDomainDefParseXML(xmlDocPtr xml, case VIR_DOMAIN_FEATURE_PRIVNET: case VIR_DOMAIN_FEATURE_HYPERV: case VIR_DOMAIN_FEATURE_KVM: + case VIR_DOMAIN_FEATURE_MSRS: def->features[val] =3D VIR_TRISTATE_SWITCH_ON; break; =20 @@ -20618,6 +20625,26 @@ virDomainDefParseXML(xmlDocPtr xml, def->tseg_specified =3D rv; } =20 + if (def->features[VIR_DOMAIN_FEATURE_MSRS] =3D=3D VIR_TRISTATE_SWITCH_= ON) { + if ((node =3D virXPathNode("./features/msrs", ctxt)) =3D=3D NULL) + goto error; + + if (!(tmp =3D virXMLPropString(node, "unknown"))) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("missing 'unknown' attribute for feature '%s'= "), + virDomainFeatureTypeToString(VIR_DOMAIN_FEATURE= _MSRS)); + goto error; + } + + if ((def->msrs_features[VIR_DOMAIN_MSRS_UNKNOWN] =3D virDomainMsrs= UnknownTypeFromString(tmp)) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("unknown 'unknown' value '%s'"), + tmp); + goto error; + } + VIR_FREE(tmp); + } + if ((n =3D virXPathNodeSet("./features/capabilities/*", ctxt, &nodes))= < 0) goto error; =20 @@ -22678,6 +22705,9 @@ virDomainDefFeaturesCheckABIStability(virDomainDefP= tr src, } break; =20 + case VIR_DOMAIN_FEATURE_MSRS: + break; + case VIR_DOMAIN_FEATURE_LAST: break; } @@ -28735,6 +28765,14 @@ virDomainDefFormatInternal(virDomainDefPtr def, } break; =20 + case VIR_DOMAIN_FEATURE_MSRS: + if (def->features[i] !=3D VIR_TRISTATE_SWITCH_ON) + break; + + virBufferAsprintf(buf, "\n", + virDomainMsrsUnknownTypeToString(def->ms= rs_features[VIR_DOMAIN_MSRS_UNKNOWN])); + 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 2bc3f879f7..21357cc7d2 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1782,6 +1782,7 @@ typedef enum { VIR_DOMAIN_FEATURE_VMCOREINFO, VIR_DOMAIN_FEATURE_HTM, VIR_DOMAIN_FEATURE_NESTED_HV, + VIR_DOMAIN_FEATURE_MSRS, =20 VIR_DOMAIN_FEATURE_LAST } virDomainFeature; @@ -1813,6 +1814,19 @@ typedef enum { VIR_DOMAIN_KVM_LAST } virDomainKVM; =20 +typedef enum { + VIR_DOMAIN_MSRS_UNKNOWN =3D 0, + + VIR_DOMAIN_MSRS_LAST +} virDomainMsrs; + +typedef enum { + VIR_DOMAIN_MSRS_UNKNOWN_IGNORE =3D 0, + VIR_DOMAIN_MSRS_UNKNOWN_FAULT, + + VIR_DOMAIN_MSRS_UNKNOWN_LAST +} virDomainMsrsUnknown; + typedef enum { VIR_DOMAIN_CAPABILITIES_POLICY_DEFAULT =3D 0, VIR_DOMAIN_CAPABILITIES_POLICY_ALLOW, @@ -2466,6 +2480,7 @@ struct _virDomainDef { int caps_features[VIR_DOMAIN_CAPS_FEATURE_LAST]; int hyperv_features[VIR_DOMAIN_HYPERV_LAST]; int kvm_features[VIR_DOMAIN_KVM_LAST]; + int msrs_features[VIR_DOMAIN_MSRS_LAST]; unsigned int hyperv_spinlocks; virGICVersion gic_version; virDomainHPTResizing hpt_resizing; @@ -3468,6 +3483,7 @@ VIR_ENUM_DECL(virDomainGraphicsSpiceMouseMode); VIR_ENUM_DECL(virDomainGraphicsVNCSharePolicy); VIR_ENUM_DECL(virDomainHyperv); VIR_ENUM_DECL(virDomainKVM); +VIR_ENUM_DECL(virDomainMsrsUnknown); VIR_ENUM_DECL(virDomainRNGModel); VIR_ENUM_DECL(virDomainRNGBackend); VIR_ENUM_DECL(virDomainTPMModel); diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 801d25a44b..d96bf24ae1 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -4033,6 +4033,7 @@ qemuDomainDefValidateFeatures(const virDomainDef *def, case VIR_DOMAIN_FEATURE_PMU: case VIR_DOMAIN_FEATURE_VMPORT: case VIR_DOMAIN_FEATURE_VMCOREINFO: + case VIR_DOMAIN_FEATURE_MSRS: case VIR_DOMAIN_FEATURE_LAST: break; } --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 11:59:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 15497969975191005.420051834489; Sun, 10 Feb 2019 03:09:57 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id 7A352E6A7F; Sun, 10 Feb 2019 11:09:54 +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 3F2BE6013E; Sun, 10 Feb 2019 11:09:54 +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 D8FA03F7CB; Sun, 10 Feb 2019 11:09:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1AB9omd016664 for ; Sun, 10 Feb 2019 06:09:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2C49F103BAB8; Sun, 10 Feb 2019 11:09:50 +0000 (UTC) Received: from mx1.redhat.com (ext-mx05.extmail.prod.ext.phx2.redhat.com [10.5.110.29]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 23AE91048138 for ; Sun, 10 Feb 2019 11:09:47 +0000 (UTC) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1804F461D1 for ; Sun, 10 Feb 2019 11:09:46 +0000 (UTC) Received: by mail-lj1-f182.google.com with SMTP id f21-v6so5047686ljj.8 for ; Sun, 10 Feb 2019 03:09:46 -0800 (PST) Received: from kloomba.my.domain ([31.29.234.59]) by smtp.gmail.com with ESMTPSA id x16sm411442lff.72.2019.02.10.03.09.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Feb 2019 03:09:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CyJLVcqyrRGSQEtnPeBVPpmCRQyInN8R/z6+TfNjEdE=; b=ChXVkgvU6tD4PXkDgySKIhfv2oTCCC6gpoFoHwfmwWqPli7E9kZGgKoep1D5IBbzPh zKpvZ+fihn98RyHT2GqztCzxMnhE1ZbB626Bxg56Y2Z9VQdS95cF5lNMEgNKWiTMwiba no/DLUeWLD7RARSMcopZlvm9G9aLkEwRCidCCvOqryO/shYx7Sc07fZeKgu7OUPIwzz/ mOMtH2CQ9GRIp0tW65BWdFGi6x3EtLRZHw7ksE46IX9O1eZWUDcAeLEPINOs5SShXrsA YWF3q15zBiap8Y2gLhbALevXMBoKJ16PrBltcNuCQYserdkIX0Krd54pCnhD4S6aqKKl QKSg== 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=CyJLVcqyrRGSQEtnPeBVPpmCRQyInN8R/z6+TfNjEdE=; b=KVh+e6AT32yaEkMYMAoQ4MepGjIzrVlFyeHVagqVK0r/z8UDyCzpLVYq+fzrb46Qm/ JcBybG1Ko91dmXAV5J1QJD10Lf4ufJsMktPn/W8K45tAxxupaHpJR4M8l+4KKjCaHZZW IEMW4cKPYB+pJP/mwrgrTyfQtS5i44Wq5kjWapcznR6ZzrU7871uyaNWtMPeanQK8SEq tv9Po3lW8iI5L7IVfqjyCTzS/tORfAfega5YscnESK0InaRyAPgdcN6qJdcVMR/BvNSl 3vR9dl3odIAAEwRu6iYZtdnqLYfW6kmZfrVGU8GpMo1jb705rEhO77CWYRNiONXSrIHQ R5Jg== X-Gm-Message-State: AHQUAuae7IIW3YDRkCevreOExDrOz5RJxzjM0aqeODz61qorJBk6S6Ic bn2ISN3DSqbGXT64PPJA/nkMHcc+ X-Google-Smtp-Source: AHgI3IajJaQnRJnYMR5L+bfzDRUWPJb3JfRA+elI4ddM4D7lyxCaMFeHHz3H8MhqFF+Tg8dyF1zpqA== X-Received: by 2002:a2e:870c:: with SMTP id m12-v6mr7455304lji.180.1549796984118; Sun, 10 Feb 2019 03:09:44 -0800 (PST) From: Roman Bogorodskiy To: libvir-list@redhat.com Date: Sun, 10 Feb 2019 15:09:31 +0400 Message-Id: <20190210110932.61316-3-bogorodskiy@gmail.com> In-Reply-To: <20190210110932.61316-1-bogorodskiy@gmail.com> References: <20190210110932.61316-1-bogorodskiy@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sun, 10 Feb 2019 11:09:46 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Sun, 10 Feb 2019 11:09:46 +0000 (UTC) for IP:'209.85.208.182' DOMAIN:'mail-lj1-f182.google.com' HELO:'mail-lj1-f182.google.com' FROM:'bogorodskiy@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.11 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS) 209.85.208.182 mail-lj1-f182.google.com 209.85.208.182 mail-lj1-f182.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.29 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Roman Bogorodskiy Subject: [libvirt] [PATCH v2 2/3] bhyve: implement ignore unknown MSRs feature 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: , Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sun, 10 Feb 2019 11:09:55 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Implement the MSRs ignore unknown reads and writes feature that's specified using: ... ... in the domain XML. In bhyve, it's just passing '-w' command line argument to the bhyve(8) executable. Signed-off-by: Roman Bogorodskiy Reviewed-by: Cole Robinson --- docs/drvbhyve.html.in | 22 ++++++++++++ src/bhyve/bhyve_command.c | 4 +++ .../bhyvexml2argvdata/bhyvexml2argv-msrs.args | 10 ++++++ .../bhyvexml2argv-msrs.ldargs | 3 ++ .../bhyvexml2argvdata/bhyvexml2argv-msrs.xml | 26 ++++++++++++++ tests/bhyvexml2argvtest.c | 1 + .../bhyvexml2xmlout-msrs.xml | 36 +++++++++++++++++++ tests/bhyvexml2xmltest.c | 1 + 8 files changed, 103 insertions(+) create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-msrs.args create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-msrs.ldargs create mode 100644 tests/bhyvexml2argvdata/bhyvexml2argv-msrs.xml create mode 100644 tests/bhyvexml2xmloutdata/bhyvexml2xmlout-msrs.xml diff --git a/docs/drvbhyve.html.in b/docs/drvbhyve.html.in index 2e9cf5551b..97f6f1b900 100644 --- a/docs/drvbhyve.html.in +++ b/docs/drvbhyve.html.in @@ -462,6 +462,23 @@ Example:

</domain> =20 +

Ignoring unknown MSRs writes

+ +

Some guests might require ignoring unknown Model Specific Registers (MS= Rs) +reads and writes. +Since 5.1.0 it's possible to switch this on u= sing:

+
+<domain type=3D"bhyve">
+    ...
+  <features>
+    <msrs unknown=3D'ignore'/>
+  </features>
+    ...
+</domain>
+
+ +

By default unknown reads and writes are not ignored.

+

Pass-through of arbitrary bhyve commands =20

Since 5.1.0, it's possible to pass additio= nal command-line @@ -489,5 +506,10 @@ They are unsupported, using them may result in = inconsistent state, and upgrading either bhyve or libvirtd maybe break behavior of a domain th= at was relying on a specific commands pass-through.

=20 + +>>>>>>> 525918ac5c... bhyve: implement MSRs ignore unknown writes feature +=3D=3D=3D=3D=3D=3D=3D +>>>>>>> 93d9056998... fixup! bhyve: implement MSRs ignore unknown writes f= eature + diff --git a/src/bhyve/bhyve_command.c b/src/bhyve/bhyve_command.c index 1f215dac08..52ad3e3714 100644 --- a/src/bhyve/bhyve_command.c +++ b/src/bhyve/bhyve_command.c @@ -506,6 +506,10 @@ virBhyveProcessBuildBhyveCmd(virConnectPtr conn, virCommandAddArg(cmd, "-A"); /* Create an ACPI table */ if (def->features[VIR_DOMAIN_FEATURE_APIC] =3D=3D VIR_TRISTATE_SWITCH_= ON) virCommandAddArg(cmd, "-I"); /* Present ioapic to the guest */ + if (def->features[VIR_DOMAIN_FEATURE_MSRS] =3D=3D VIR_TRISTATE_SWITCH_= ON) { + if (def->msrs_features[VIR_DOMAIN_MSRS_UNKNOWN] =3D=3D VIR_DOMAIN_= MSRS_UNKNOWN_IGNORE) + virCommandAddArg(cmd, "-w"); + } =20 switch (def->clock.offset) { case VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME: diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-msrs.args b/tests/bhyvex= ml2argvdata/bhyvexml2argv-msrs.args new file mode 100644 index 0000000000..dbe377421b --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-msrs.args @@ -0,0 +1,10 @@ +/usr/sbin/bhyve \ +-c 1 \ +-m 214 \ +-w \ +-u \ +-H \ +-P \ +-s 0:0,hostbridge \ +-s 2:0,ahci,hd:/tmp/freebsd.img \ +-s 3:0,virtio-net,faketapdev,mac=3D52:54:00:b9:94:02 bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-msrs.ldargs b/tests/bhyv= exml2argvdata/bhyvexml2argv-msrs.ldargs new file mode 100644 index 0000000000..32538b558e --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-msrs.ldargs @@ -0,0 +1,3 @@ +/usr/sbin/bhyveload \ +-m 214 \ +-d /tmp/freebsd.img bhyve diff --git a/tests/bhyvexml2argvdata/bhyvexml2argv-msrs.xml b/tests/bhyvexm= l2argvdata/bhyvexml2argv-msrs.xml new file mode 100644 index 0000000000..dc9de93abc --- /dev/null +++ b/tests/bhyvexml2argvdata/bhyvexml2argv-msrs.xml @@ -0,0 +1,26 @@ + + bhyve + df3be7e7-a104-11e3-aeb0-50e5492bd3dc + 219136 + 1 + + hvm + + + + + + + + + +
+ + + + + +
+ + + diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c index 4a7f65a8e2..c84925c57b 100644 --- a/tests/bhyvexml2argvtest.c +++ b/tests/bhyvexml2argvtest.c @@ -211,6 +211,7 @@ mymain(void) DO_TEST("cputopology"); DO_TEST_FAILURE("cputopology-nvcpu-mismatch"); DO_TEST("commandline"); + DO_TEST("msrs"); =20 /* Address allocation tests */ DO_TEST("addr-single-sata-disk"); diff --git a/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-msrs.xml b/tests/bhy= vexml2xmloutdata/bhyvexml2xmlout-msrs.xml new file mode 100644 index 0000000000..7c8594fed8 --- /dev/null +++ b/tests/bhyvexml2xmloutdata/bhyvexml2xmlout-msrs.xml @@ -0,0 +1,36 @@ + + bhyve + df3be7e7-a104-11e3-aeb0-50e5492bd3dc + 219136 + 219136 + 1 + + hvm + + + + + + + destroy + restart + destroy + + + + + +
+ + + +
+ + + + + +
+ + + diff --git a/tests/bhyvexml2xmltest.c b/tests/bhyvexml2xmltest.c index ed421b8839..e8a6867fcd 100644 --- a/tests/bhyvexml2xmltest.c +++ b/tests/bhyvexml2xmltest.c @@ -111,6 +111,7 @@ mymain(void) DO_TEST_DIFFERENT("vnc-vgaconf-io"); DO_TEST_DIFFERENT("vnc-autoport"); DO_TEST_DIFFERENT("commandline"); + DO_TEST_DIFFERENT("msrs"); =20 /* Address allocation tests */ DO_TEST_DIFFERENT("addr-single-sata-disk"); --=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Wed Apr 24 11:59:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1549797022155219.84931768787408; Sun, 10 Feb 2019 03:10:22 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 031B5C0669AC; Sun, 10 Feb 2019 11:10:19 +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 B84195DEFC; Sun, 10 Feb 2019 11:10:18 +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 60F7E18033A7; Sun, 10 Feb 2019 11:10:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1AB9oL0016663 for ; Sun, 10 Feb 2019 06:09:50 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2BB7310E81C0; Sun, 10 Feb 2019 11:09:50 +0000 (UTC) Received: from mx1.redhat.com (ext-mx06.extmail.prod.ext.phx2.redhat.com [10.5.110.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 238F51048134 for ; Sun, 10 Feb 2019 11:09:48 +0000 (UTC) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 71F1D3E2CB for ; Sun, 10 Feb 2019 11:09:47 +0000 (UTC) Received: by mail-lj1-f193.google.com with SMTP id f24-v6so6526909ljk.0 for ; Sun, 10 Feb 2019 03:09:47 -0800 (PST) Received: from kloomba.my.domain ([31.29.234.59]) by smtp.gmail.com with ESMTPSA id x16sm411442lff.72.2019.02.10.03.09.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Feb 2019 03:09:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Smski7HZhDYxG9VJM3vTYDgZDP7aQtB9TScXrHBICrA=; b=Xm9Ic5W7xy32VnU6w4KUzXg14x59lpn0Hryfv/+3q+5mgY1pIC2zQ0sufVqJ4GjjO4 4Ra41gGR/XOWl87/Xdoflywl7GkfRFBXS8PZtzkyllv7g/Q1ZfillUwRmcx7zhygZIXl bRG3fGrVgnuDrAJcj+zbs1J6m3KmaHTDpq7oPjm5LexmaYe4BVRJcq02WTPC8EKtYloE ZvjtfC30tJlH3i66AJ74545REbMa7hxMwzAFzPgcLPaSR5Hv8s57a/zO1O+5MFR3t12w wIaYgF3Q8BWhAYauQXTfYmTfYu7/6Xh7WtzyTGcRztsmkQmgmkSsm+HE8auyaWz9rzge O51Q== 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=Smski7HZhDYxG9VJM3vTYDgZDP7aQtB9TScXrHBICrA=; b=hM/hcnohYXdQxxu//ONMqbSgF4wZv870cwNBArN4X3S554mUsOLv7PfwSm7tJ91u9R +FKozun35eCjDk4UHEuHkbG74Q+iOazpDVFesD2WNP8t+o8wQrhlcYFZE76n57WM7EyB 0bq/7xv5Cn8UwmDB1MDRcjkScezOH0oudAxPalbJK0l4Af9Qx7y/rrA36/BItFEFfvyX nuGEleKEK9EHWjUII3JnWfjVhZsWxGCuXONYSvInaljtZYSSoCUO2DbBeONhlZGSg7Ay oTW6p5ycDM9+e0/VUYGBrj+Z5BqLLlCcdFlQkOIMch4FxWP9bopS7Vu3OWq78gnfFaLv tsQA== X-Gm-Message-State: AHQUAuYQQR8P3DOTw0ulbErQjs+6zPf8S8kb/QDHnpThbMMf0JV89dfF WL1UhAkVlnTQIztcyiKmO/ENtX4C X-Google-Smtp-Source: AHgI3IbaACLLxH6YvAAHwyhfNTG0JDF0Oz5DtVFxrwwYIzu/1dYsDGXxS9ulfFzEWU5MxqH29TQlRA== X-Received: by 2002:a2e:9f0b:: with SMTP id u11-v6mr17236942ljk.99.1549796985606; Sun, 10 Feb 2019 03:09:45 -0800 (PST) From: Roman Bogorodskiy To: libvir-list@redhat.com Date: Sun, 10 Feb 2019 15:09:32 +0400 Message-Id: <20190210110932.61316-4-bogorodskiy@gmail.com> In-Reply-To: <20190210110932.61316-1-bogorodskiy@gmail.com> References: <20190210110932.61316-1-bogorodskiy@gmail.com> MIME-Version: 1.0 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sun, 10 Feb 2019 11:09:47 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sun, 10 Feb 2019 11:09:47 +0000 (UTC) for IP:'209.85.208.193' DOMAIN:'mail-lj1-f193.google.com' HELO:'mail-lj1-f193.google.com' FROM:'bogorodskiy@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.111 (DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS) 209.85.208.193 mail-lj1-f193.google.com 209.85.208.193 mail-lj1-f193.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.30 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: Roman Bogorodskiy Subject: [libvirt] [PATCH v2 3/3] news: document bhyve msrs feature 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Sun, 10 Feb 2019 11:10:19 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Describe bhyve's ignoring unknown MSRs writes feature introduced by commit 525918ac5c. Signed-off-by: Roman Bogorodskiy Reviewed-by: Cole Robinson --- docs/news.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 8d6d58ae6a..cb23b63143 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -59,6 +59,16 @@ of the network's bridge element. + + + bhyve: support for ignoring unknown MSRs reads and writes + + + A new features element <msrs unknown=3D'ignore'/> was + introduced and the bhyve driver supports it to control unknown + Model Specific Registers (MSRs) reads and writes. + +
--=20 2.20.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list