From nobody Mon Apr 29 11:13:39 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 ARC-Seal: i=1; a=rsa-sha256; t=1587162657; cv=none; d=zohomail.com; s=zohoarc; b=d3OJT8HmOyw2svYa8hIlHf0dztT+TYE9BaHDNmPPjvH6R/6JyUlJ9ZAXa8EN5BK+pyshWETIWNdQvHCAyv2IN8gkRxofl+74O/DyB6JPaZX6dwh6n50ePXbn/hw2b74BtVBb0uDrGzcxGNjI9VQHUYhcrtorMqN6dFI/T50gfGU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587162657; 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=/DHsmUCLdLW3uVFgZKy3PT2D4Ft+6IKB/biiPHfEGnw=; b=UzGrjInAianXS3xwfGGXOQf7u//xWCL72T7hHqo2EO3e/BENgkW/4GuDMiNH0zA4tLVkziw4goRSqXLtm5byasZHTRs41rqoltidQF/6gUe5jWEYUijj3GRPBO4OJPOcMqP1wV/8uIPwxOvqJ4LGPHoXe+mwFW1OqwvZiPONuEI= 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 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 15871626574241004.2537341909863; Fri, 17 Apr 2020 15:30:57 -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-142-zYyS5BLEMsudmBSVkTIWbA-1; Fri, 17 Apr 2020 18:30:52 -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 CEAAA801FB4; Fri, 17 Apr 2020 22:30:46 +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 4C3D41036D12; Fri, 17 Apr 2020 22:30:44 +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 41B589339D; Fri, 17 Apr 2020 22:30:39 +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 03HMUbNl007651 for ; Fri, 17 Apr 2020 18:30:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 40069101B54B; Fri, 17 Apr 2020 22:30:37 +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 3B0DE101B549 for ; Fri, 17 Apr 2020 22:30:34 +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 5AF9D8FF66A for ; Fri, 17 Apr 2020 22:30:34 +0000 (UTC) Received: from m9a0014g.houston.softwaregrp.com (m9a0014g.houston.softwaregrp.com [15.124.64.90]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-219-0kplQmrbMDS_HcrobqdKxQ-1; Fri, 17 Apr 2020 18:30:31 -0400 Received: FROM m9a0014g.houston.softwaregrp.com (15.121.0.190) BY m9a0014g.houston.softwaregrp.com WITH ESMTP; Fri, 17 Apr 2020 22:29:47 +0000 Received: from M4W0335.microfocus.com (2002:f78:1193::f78:1193) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Fri, 17 Apr 2020 22:30:01 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (15.124.8.12) by M4W0335.microfocus.com (15.120.17.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Fri, 17 Apr 2020 22:30:01 +0000 Received: from MWHPR1801MB2080.namprd18.prod.outlook.com (2603:10b6:301:69::25) by MWHPR1801MB1918.namprd18.prod.outlook.com (2603:10b6:301:68::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.25; Fri, 17 Apr 2020 22:30:00 +0000 Received: from MWHPR1801MB2080.namprd18.prod.outlook.com ([fe80::b0f9:1d00:2adb:4e89]) by MWHPR1801MB2080.namprd18.prod.outlook.com ([fe80::b0f9:1d00:2adb:4e89%5]) with mapi id 15.20.2921.027; Fri, 17 Apr 2020 22:30:00 +0000 Received: from linux-tbji.provo.novell.com (75.169.7.53) by SN1PR12CA0103.namprd12.prod.outlook.com (2603:10b6:802:21::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.27 via Frontend Transport; Fri, 17 Apr 2020 22:29:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587162656; 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=/DHsmUCLdLW3uVFgZKy3PT2D4Ft+6IKB/biiPHfEGnw=; b=ROTzWjQ78mlCNb9lWrSOLx2f0ZOKqOreRrtyXMOoxOJP3aYZWwfNf3SuZBzT9Q7d4ocOSN Vr9eKyz5Y+i0PyJsldJxgf0MDqSW/wvnvHaIBkigCm9dsV9P3elNA23SNzjidpdOPjsMeo fUur+0DjOUrQjOWtb+gNDBsEpyuazn0= X-MC-Unique: zYyS5BLEMsudmBSVkTIWbA-1 X-MC-Unique: 0kplQmrbMDS_HcrobqdKxQ-1 From: Jim Fehlig To: Subject: [PATCH 1/5] conf: add xen hypervisor feature 'passthrough' Date: Fri, 17 Apr 2020 16:29:35 -0600 Message-ID: <20200417222939.15618-2-jfehlig@suse.com> In-Reply-To: <20200417222939.15618-1-jfehlig@suse.com> References: <20200417222939.15618-1-jfehlig@suse.com> X-ClientProxiedBy: SN1PR12CA0103.namprd12.prod.outlook.com (2603:10b6:802:21::38) To MWHPR1801MB2080.namprd18.prod.outlook.com (2603:10b6:301:69::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Originating-IP: [75.169.7.53] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 24ce399b-45d1-467e-b2de-08d7e31edd54 X-MS-TrafficTypeDiagnostic: MWHPR1801MB1918: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1728; X-Forefront-PRVS: 0376ECF4DD X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1801MB2080.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(4636009)(136003)(396003)(346002)(366004)(376002)(39860400002)(4326008)(36756003)(107886003)(6512007)(86362001)(2906002)(6486002)(186003)(2616005)(16526019)(956004)(6506007)(52116002)(66556008)(66476007)(478600001)(81156014)(66946007)(8676002)(26005)(8936002)(316002)(6916009)(6666004)(1076003)(5660300002); DIR:OUT; SFP:1102; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: onD3RrCsqWJT6BMqq8nwKcl5bzzoppoFcEtCsG1b7oNBMiP0TvLf4OJe+fyJo59paKkwVl3tb97Fzwz2nt317xpltnshh/aAz6vsaEIAO/zt2HikbQw6MMtSz6LWuEl9Vma5wXrd06Zxv2DUUTWerR+rGqmHlNvclV7wqOugxiJf8SkK3KYuWE+/B8d7L0JaSGfxU/pZw5bbmeXzpvlMfKEhSYrVXFUYNPlQxa9nyFy2ehn0CHyR8HrJEJa1krS3gzEqtKIqWpKYtaETgGiJTw4RMlIzVSTDr+t2fn1Wc4C3qXRBnWeN/fMwBwjRrpkGwcQX6uxZqpU16B8tqRuyQn7ZkFy9jAa+3/B8MDjeQPX/qqamcIr+GWkT1/bePxMUidieuAiuLiEkA/2L4hog5VaabMaR+3miz7WkVaqlGON6vYs/TAIbgGnefazAfJgO X-MS-Exchange-AntiSpam-MessageData: x0amnhb30iiFma2ujM3auUvDWGEWH/dWTURxYFUv5c9imWcDMPAUvmwN6hPahRKNDf//8bJcmOhXBt1VybY590nyLXHj9Bd5m2CeROjcdCkpMrEIQSaBbZ7nSzqCKVwYdTbPOwSa0OnL5niWhurr4A== X-MS-Exchange-CrossTenant-Network-Message-Id: 24ce399b-45d1-467e-b2de-08d7e31edd54 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2020 22:30:00.1492 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6msrYf9cdosldQiqIj/Z+/1g7ZoloAb4ufUEBab7OomYWDcn2EytSROEJvLxOJST8HGI6bExLktIA5RI/hlepA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1801MB1918 X-OriginatorOrg: suse.com 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 03HMUbNl007651 X-loop: libvir-list@redhat.com 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" 'passthrough' is Xen-Specific guest configuration option new to Xen 4.13 that enables IOMMU mappings for a guest and hence whether it supports PCI passthrough. The default is disabled. See the xl.cfg(5) man page and xen.git commit babde47a3fe for more details. The default state of disabled prevents hotlugging PCI devices. However, if the guest configuration contains a PCI passthrough device at time of creation, libxl will automatically enable 'passthrough' and subsequent hotplugging of PCI devices will also be possible. It is not possible to unconditionally enable 'passthrough' since it would introduce a migration incompatibility due to guest ABI change. Instead, introduce another Xen hypervisor feature that can be used to enable guest PCI passthrough To allow finer control over how IOMMU maps to guest P2M table, the passthrough element also supports a 'mode' attribute with values restricted to snyc_pt and share_pt, similar to xl.cfg(5) 'passthrough' setting . Signed-off-by: Jim Fehlig Reviewed-by: Michal Privoznik --- docs/formatdomain.html.in | 7 +++ docs/schemas/domaincommon.rng | 12 ++++ src/conf/domain_conf.c | 115 ++++++++++++++++++++++++++-------- src/conf/domain_conf.h | 11 ++++ 4 files changed, 119 insertions(+), 26 deletions(-) diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 81060d6730..9ccae54e04 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -2063,6 +2063,7 @@ </kvm> <xen> <e820_host state=3D'on'/> + <passthrough state=3D'on' mode=3D'share_pt'/> </xen> <pvspinlock state=3D'on'/> <gic version=3D'2'/> @@ -2260,6 +2261,12 @@ on, off 6.3.0 + + passthrough + Enable IOMMU mappings allowing PCI passthrough) + on, off; mode - optional string sync_pt or share_pt + 6.3.0 +
pmu
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 2b5f844658..a6f6e8ab83 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -6349,6 +6349,18 @@ + + + + + + + (sync_pt|share_pt) + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index dabbceb265..9f3362c934 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -209,7 +209,15 @@ VIR_ENUM_IMPL(virDomainKVM, =20 VIR_ENUM_IMPL(virDomainXen, VIR_DOMAIN_XEN_LAST, - "e820_host" + "e820_host", + "passthrough", +); + +VIR_ENUM_IMPL(virDomainXenPassthroughMode, + VIR_DOMAIN_XEN_PASSTHROUGH_MODE_LAST, + "default", + "sync_pt", + "share_pt", ); =20 VIR_ENUM_IMPL(virDomainMsrsUnknown, @@ -21182,6 +21190,8 @@ virDomainDefParseXML(xmlDocPtr xml, if (def->features[VIR_DOMAIN_FEATURE_XEN] =3D=3D VIR_TRISTATE_SWITCH_O= N) { int feature; int value; + g_autofree char *ptval =3D NULL; + if ((n =3D virXPathNodeSet("./features/xen/*", ctxt, &nodes)) < 0) goto error; =20 @@ -21194,27 +21204,53 @@ virDomainDefParseXML(xmlDocPtr xml, goto error; } =20 + if (!(tmp =3D virXMLPropString(nodes[i], "state"))) { + virReportError(VIR_ERR_XML_ERROR, + _("missing 'state' attribute for " + "Xen feature '%s'"), + nodes[i]->name); + goto error; + } + + if ((value =3D virTristateSwitchTypeFromString(tmp)) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("invalid value of state argument " + "for Xen feature '%s'"), + nodes[i]->name); + goto error; + } + + VIR_FREE(tmp); + def->xen_features[feature] =3D value; + switch ((virDomainXen) feature) { case VIR_DOMAIN_XEN_E820_HOST: - if (!(tmp =3D virXMLPropString(nodes[i], "state"))) { - virReportError(VIR_ERR_XML_ERROR, - _("missing 'state' attribute for " - "Xen feature '%s'"), - nodes[i]->name); - goto error; - } + break; =20 - if ((value =3D virTristateSwitchTypeFromString(tmp)) <= 0) { + case VIR_DOMAIN_XEN_PASSTHROUGH: + if (value !=3D VIR_TRISTATE_SWITCH_ON) + break; + + if ((ptval =3D virXMLPropString(nodes[i], "mode"))) { + int mode =3D virDomainXenPassthroughModeTypeFromString= (ptval); + + if (mode < 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("invalid value of state argument " - "for Xen feature '%s'"), - nodes[i]->name); + _("unsupported mode '%s' for Xen pa= ssthrough feature"), + ptval); goto error; } =20 - VIR_FREE(tmp); - def->xen_features[feature] =3D value; - break; + if (mode !=3D VIR_DOMAIN_XEN_PASSTHROUGH_MODE_SYNC_PT = && + mode !=3D VIR_DOMAIN_XEN_PASSTHROUGH_MODE_SHARE_PT= ) { + virReportError(VIR_ERR_XML_ERROR, "%s", + _("'mode' attribute for Xen feature= " + "'passthrough' must be 'sync_pt' = or 'share_pt'")); + goto error; + } + def->xen_passthrough_mode =3D mode; + } + break; =20 /* coverity[dead_error_begin] */ case VIR_DOMAIN_XEN_LAST: @@ -23400,18 +23436,28 @@ virDomainDefFeaturesCheckABIStability(virDomainDe= fPtr src, /* xen */ if (src->features[VIR_DOMAIN_FEATURE_XEN] =3D=3D VIR_TRISTATE_SWITCH_O= N) { for (i =3D 0; i < VIR_DOMAIN_XEN_LAST; i++) { + if (src->xen_features[i] !=3D dst->xen_features[i]) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("State of Xen feature '%s' differs: " + "source: '%s', destination: '%s'"), + virDomainXenTypeToString(i), + virTristateSwitchTypeToString(src->xen_feat= ures[i]), + virTristateSwitchTypeToString(dst->xen_feat= ures[i])); + return false; + } switch ((virDomainXen) i) { case VIR_DOMAIN_XEN_E820_HOST: - if (src->xen_features[i] !=3D dst->xen_features[i]) { + break; + + case VIR_DOMAIN_XEN_PASSTHROUGH: + if (src->xen_passthrough_mode !=3D dst->xen_passthrough_mo= de) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("State of Xen feature '%s' differs: " + _("'mode' of Xen passthrough feature di= ffers: " "source: '%s', destination: '%s'"), - virDomainXenTypeToString(i), - virTristateSwitchTypeToString(src->xen_= features[i]), - virTristateSwitchTypeToString(dst->xen_= features[i])); + virDomainXenPassthroughModeTypeToString= (src->xen_passthrough_mode), + virDomainXenPassthroughModeTypeToString= (dst->xen_passthrough_mode)); return false; } - break; =20 /* coverity[dead_error_begin] */ @@ -29047,13 +29093,30 @@ virDomainDefFormatFeatures(virBufferPtr buf, virBufferAddLit(&childBuf, "\n"); virBufferAdjustIndent(&childBuf, 2); for (j =3D 0; j < VIR_DOMAIN_XEN_LAST; j++) { + if (def->xen_features[j] =3D=3D VIR_TRISTATE_SWITCH_ABSENT) + continue; + + virBufferAsprintf(&childBuf, "<%s state=3D'%s'", + virDomainXenTypeToString(j), + virTristateSwitchTypeToString( + def->xen_features[j])); + switch ((virDomainXen) j) { case VIR_DOMAIN_XEN_E820_HOST: - if (def->xen_features[j]) - virBufferAsprintf(&childBuf, "<%s state=3D'%s'/>\n= ", - virDomainXenTypeToString(j), - virTristateSwitchTypeToString( - def->xen_features[j])); + virBufferAddLit(&childBuf, "/>\n"); + break; + case VIR_DOMAIN_XEN_PASSTHROUGH: + if (def->xen_features[j] !=3D VIR_TRISTATE_SWITCH_ON) { + virBufferAddLit(&childBuf, "/>\n"); + break; + } + if (def->xen_passthrough_mode =3D=3D VIR_DOMAIN_XEN_PA= SSTHROUGH_MODE_SYNC_PT || + def->xen_passthrough_mode =3D=3D VIR_DOMAIN_XEN_PA= SSTHROUGH_MODE_SHARE_PT) { + virBufferEscapeString(&childBuf, " mode=3D'%s'/>\n= ", + virDomainXenPassthroughModeT= ypeToString(def->xen_passthrough_mode)); + } else { + virBufferAddLit(&childBuf, "/>\n"); + } break; =20 /* coverity[dead_error_begin] */ diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 0374494076..dabcd5197d 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1862,10 +1862,19 @@ typedef enum { =20 typedef enum { VIR_DOMAIN_XEN_E820_HOST =3D 0, + VIR_DOMAIN_XEN_PASSTHROUGH, =20 VIR_DOMAIN_XEN_LAST } virDomainXen; =20 +typedef enum { + VIR_DOMAIN_XEN_PASSTHROUGH_MODE_DEFAULT =3D 0, + VIR_DOMAIN_XEN_PASSTHROUGH_MODE_SYNC_PT, + VIR_DOMAIN_XEN_PASSTHROUGH_MODE_SHARE_PT, + + VIR_DOMAIN_XEN_PASSTHROUGH_MODE_LAST +} virDomainXenPassthroughMode; + typedef enum { VIR_DOMAIN_CAPABILITIES_POLICY_DEFAULT =3D 0, VIR_DOMAIN_CAPABILITIES_POLICY_ALLOW, @@ -2492,6 +2501,7 @@ struct _virDomainDef { int kvm_features[VIR_DOMAIN_KVM_LAST]; int msrs_features[VIR_DOMAIN_MSRS_LAST]; int xen_features[VIR_DOMAIN_XEN_LAST]; + int xen_passthrough_mode; unsigned int hyperv_spinlocks; int hyperv_stimer_direct; virGICVersion gic_version; @@ -3538,6 +3548,7 @@ VIR_ENUM_DECL(virDomainGraphicsVNCSharePolicy); VIR_ENUM_DECL(virDomainHyperv); VIR_ENUM_DECL(virDomainKVM); VIR_ENUM_DECL(virDomainXen); +VIR_ENUM_DECL(virDomainXenPassthroughMode); VIR_ENUM_DECL(virDomainMsrsUnknown); VIR_ENUM_DECL(virDomainRNGModel); VIR_ENUM_DECL(virDomainRNGBackend); --=20 2.26.0 From nobody Mon Apr 29 11:13:39 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 ARC-Seal: i=1; a=rsa-sha256; t=1587162684; cv=none; d=zohomail.com; s=zohoarc; b=BHGxkamX8qbrSi50XR9CB+siffd5DpIZhUalpT9wrHjGi/t26AE7He2dtr5xTCkOZFZy8tJQt7yEnshDl6DKWYgN6eNJZgrDXhgkFuQxdsHs7LfLAgJX30P0gmRScl//PXSm4mXHidnK02ZABIXvohTiOXilsyGlQsyHMTwiJDA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587162684; 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=7v3AzIbZXnS5uq/hMvB4kzjq24iRtyYoTwJzj1GiY5g=; b=HDiBH2h51UWGdw5MWrlLC9v/ahPM1fLecMpcJ2zz6KPg5gTNosgsaOvGzSIDh44TQnmAJt+8MEk+0PQNvLmOOEbyD4nnSk6WAc9RbKfu8O9vO6EcQCnXkygOmo5knDY8vpWQUp1GC5oZEIuguL41teS/qL9LEMrI2w7DesgLM7U= 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 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 1587162684221459.94453749015247; Fri, 17 Apr 2020 15:31:24 -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-456-77gLzJ6zNpCkmFIVa_kxoA-1; Fri, 17 Apr 2020 18:31:19 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 070CB1088382; Fri, 17 Apr 2020 22:31:14 +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 CEF3F5DA81; Fri, 17 Apr 2020 22:31:13 +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 6C76D18089D6; Fri, 17 Apr 2020 22:31:13 +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 03HMUjvl007689 for ; Fri, 17 Apr 2020 18:30:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id C89762028CD3; Fri, 17 Apr 2020 22:30:45 +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 C2EB12093CED for ; Fri, 17 Apr 2020 22:30:42 +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 CB607800295 for ; Fri, 17 Apr 2020 22:30:42 +0000 (UTC) Received: from m9a0014g.houston.softwaregrp.com (m9a0014g.houston.softwaregrp.com [15.124.64.90]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-502-g9EDAf6XMlKrm4N163W5ZQ-1; Fri, 17 Apr 2020 18:30:40 -0400 Received: FROM m9a0014g.houston.softwaregrp.com (15.121.0.191) BY m9a0014g.houston.softwaregrp.com WITH ESMTP; Fri, 17 Apr 2020 22:29:55 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Fri, 17 Apr 2020 22:30:04 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (15.124.8.13) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Fri, 17 Apr 2020 22:30:04 +0000 Received: from MWHPR1801MB2080.namprd18.prod.outlook.com (2603:10b6:301:69::25) by MWHPR1801MB1839.namprd18.prod.outlook.com (2603:10b6:301:64::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.26; Fri, 17 Apr 2020 22:30:01 +0000 Received: from MWHPR1801MB2080.namprd18.prod.outlook.com ([fe80::b0f9:1d00:2adb:4e89]) by MWHPR1801MB2080.namprd18.prod.outlook.com ([fe80::b0f9:1d00:2adb:4e89%5]) with mapi id 15.20.2921.027; Fri, 17 Apr 2020 22:30:01 +0000 Received: from linux-tbji.provo.novell.com (75.169.7.53) by SN1PR12CA0103.namprd12.prod.outlook.com (2603:10b6:802:21::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.27 via Frontend Transport; Fri, 17 Apr 2020 22:30:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587162682; 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=7v3AzIbZXnS5uq/hMvB4kzjq24iRtyYoTwJzj1GiY5g=; b=c52ROEoCvbKuj6MiFJZAmcJoEZ8mGDU19XlyRzGXHsCRSlMO8bEuKbTgGSNFKi6Qg0WW9i GFJm3cdJFDTPW1jcSCuiklcyaHyXBzQCqKcmPoHN5eHmvL920FeyV4VoLyN47fyHQs8MAG xOGY8jYyGuBWW9wYMcB2NnGeZk+db6k= X-MC-Unique: 77gLzJ6zNpCkmFIVa_kxoA-1 X-MC-Unique: g9EDAf6XMlKrm4N163W5ZQ-1 From: Jim Fehlig To: Subject: [PATCH 2/5] libxl: make use of passthrough hypervisor feature Date: Fri, 17 Apr 2020 16:29:36 -0600 Message-ID: <20200417222939.15618-3-jfehlig@suse.com> In-Reply-To: <20200417222939.15618-1-jfehlig@suse.com> References: <20200417222939.15618-1-jfehlig@suse.com> X-ClientProxiedBy: SN1PR12CA0103.namprd12.prod.outlook.com (2603:10b6:802:21::38) To MWHPR1801MB2080.namprd18.prod.outlook.com (2603:10b6:301:69::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Originating-IP: [75.169.7.53] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0cf23013-0ca0-4e60-9461-08d7e31ede10 X-MS-TrafficTypeDiagnostic: MWHPR1801MB1839: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:147; X-Forefront-PRVS: 0376ECF4DD X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1801MB2080.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(4636009)(376002)(346002)(396003)(39860400002)(366004)(136003)(6506007)(2616005)(36756003)(956004)(52116002)(316002)(1076003)(478600001)(6486002)(66946007)(66476007)(26005)(8676002)(66556008)(4326008)(107886003)(6916009)(86362001)(6512007)(186003)(81156014)(5660300002)(2906002)(6666004)(16526019)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ttou4vH6lb6N1FseSkLPL9oMnZPgmMpmh90z5rgkfWQlh9ZlWqDloU/NIqOy2OoPjxLCBRDpYOclBXiQehgMxPnbIJzZr1609O5cEmBNm/theYHeOL8en277msaM+0Ws9cYjPA82IYGNFH1xDYm7aSNJQd4WvT6V1CpjM9bcoavzcqyk7Szi7XexR/SN3O1vtIuBaV1aSo0mRQqcnU9J/EDYPdgvJonGnQ8yeo7fko0QM3UtsBj5TEmHir/yVYARy7VCVAkBmoE9zNm2/5UD678Nu7/tp8xVKZWBXn/MlNrzMtKkKzRxuLd3n5QDGfyReS6PKhIvI/9BIiBlVkFZz9L/I0vggjPYZ3yc8AkTbDKuFjRUXKTmOteC4FFlY8S/0WscbO0f40etYA8IXJ0Ok4YXSP1soeNlCxgbpH+4dviR5DWxD6dzfleZXcV0q+Nr X-MS-Exchange-AntiSpam-MessageData: /L4C7VF7vtSJNeQswGhE6az3uets5AuEbhqIAgc9QperByGwrAmKDTGvF7Ma58eA894zNRo+0qp4kIZxQ7oZT95Stw5MN8osDN0o4k4jYI9z1pjmSBfqZ/YZQFerjfjM2VdJ/vw8z+DV6Uzyv/8DqA== X-MS-Exchange-CrossTenant-Network-Message-Id: 0cf23013-0ca0-4e60-9461-08d7e31ede10 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2020 22:30:01.3485 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 1yDR1CPW0Lq81ijGzqGXjHGaxSWaJY007HF1FvWjaKZbtxA5UuF8fO0QPaTK8B/Ai7Nw1TlZBFOjYQJaaKdVGg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1801MB1839 X-OriginatorOrg: suse.com 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 03HMUjvl007689 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Signed-off-by: Jim Fehlig Reviewed-by: Michal Privoznik --- src/libxl/libxl_conf.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c index 05d671bae7..458dfc2399 100644 --- a/src/libxl/libxl_conf.c +++ b/src/libxl/libxl_conf.c @@ -158,6 +158,27 @@ libxlMakeDomCreateInfo(libxl_ctx *ctx, c_info->type =3D LIBXL_DOMAIN_TYPE_PV; } =20 +#ifdef LIBXL_HAVE_CREATEINFO_PASSTHROUGH + if (def->features[VIR_DOMAIN_FEATURE_XEN] =3D=3D VIR_TRISTATE_SWITCH_O= N) { + switch ((virTristateSwitch) def->xen_features[VIR_DOMAIN_XEN_PASST= HROUGH]) { + case VIR_TRISTATE_SWITCH_ON: + if (def->xen_passthrough_mode =3D=3D VIR_DOMAIN_XEN_PASSTHROUG= H_MODE_SYNC_PT) + c_info->passthrough =3D LIBXL_PASSTHROUGH_SYNC_PT; + else if (def->xen_passthrough_mode =3D=3D VIR_DOMAIN_XEN_PASST= HROUGH_MODE_SHARE_PT) + c_info->passthrough =3D LIBXL_PASSTHROUGH_SHARE_PT; + else + c_info->passthrough =3D LIBXL_PASSTHROUGH_ENABLED; + break; + case VIR_TRISTATE_SWITCH_OFF: + c_info->passthrough =3D LIBXL_PASSTHROUGH_DISABLED; + break; + case VIR_TRISTATE_SWITCH_ABSENT: + case VIR_TRISTATE_SWITCH_LAST: + break; + } + } +#endif + c_info->name =3D g_strdup(def->name); =20 if (def->nseclabels && --=20 2.26.0 From nobody Mon Apr 29 11:13:39 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 ARC-Seal: i=1; a=rsa-sha256; t=1587162658; cv=none; d=zohomail.com; s=zohoarc; b=d1zt3DSDUv1KERqM36bu+QSYTfbo+5m0fFFgRn46lhJ/OHeBt824yIRknSC/iL1DMPTk91fAaOa7bmIopPT8CbVjFqsdUOUnTxI2rz1ko196X6YAJrKsHLs9Tr9AOqaBUxf33523ugnUUa08CAp55+YAnQWmcEFTvQf+SiyJYLE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587162658; 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=4b/pVtCPnK9V5vEO5CLim9b2fmW9y11QvviWIH9TbLc=; b=PXy1mkzbGySgQbwvFLRcugg8Of6fWVssH0QzCU1+GPmW5a5fy5Q1Y33+m9FgXHrgSooT5EqZmcMYB1AQj4r9GnSSi3/hyCczcKrUtGkrlQL0WDqF/Thl7UG98wxZ2MsTftgMvuXwr+SNrdUYaYrMUm5pihL6kr3beNLj286ooko= 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 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 1587162658556371.6525952125637; Fri, 17 Apr 2020 15:30:58 -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-382-83gNZALLOwKXoL-SFVM6Fg-1; Fri, 17 Apr 2020 18:30:54 -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 22B078017F5; Fri, 17 Apr 2020 22:30:49 +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 D6C0511A08F; Fri, 17 Apr 2020 22:30:48 +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 E721A9351F; Fri, 17 Apr 2020 22:30:47 +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 03HMUj7r007688 for ; Fri, 17 Apr 2020 18:30:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id AC295101B549; Fri, 17 Apr 2020 22:30:45 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7802101B546 for ; Fri, 17 Apr 2020 22:30:45 +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 8E3DC800A18 for ; Fri, 17 Apr 2020 22:30:45 +0000 (UTC) Received: from m9a0013g.houston.softwaregrp.com (m9a0013g.houston.softwaregrp.com [15.124.64.91]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-376-RXWVCZxwOiWF4NCcNFjT7Q-1; Fri, 17 Apr 2020 18:30:43 -0400 Received: FROM m9a0013g.houston.softwaregrp.com (15.121.0.191) BY m9a0013g.houston.softwaregrp.com WITH ESMTP; Fri, 17 Apr 2020 22:29:57 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0068.microfocus.com (2002:f79:bf::f79:bf) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Fri, 17 Apr 2020 22:30:04 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (15.124.8.13) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Fri, 17 Apr 2020 22:30:04 +0000 Received: from MWHPR1801MB2080.namprd18.prod.outlook.com (2603:10b6:301:69::25) by MWHPR1801MB1839.namprd18.prod.outlook.com (2603:10b6:301:64::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.26; Fri, 17 Apr 2020 22:30:02 +0000 Received: from MWHPR1801MB2080.namprd18.prod.outlook.com ([fe80::b0f9:1d00:2adb:4e89]) by MWHPR1801MB2080.namprd18.prod.outlook.com ([fe80::b0f9:1d00:2adb:4e89%5]) with mapi id 15.20.2921.027; Fri, 17 Apr 2020 22:30:02 +0000 Received: from linux-tbji.provo.novell.com (75.169.7.53) by SN1PR12CA0103.namprd12.prod.outlook.com (2603:10b6:802:21::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.27 via Frontend Transport; Fri, 17 Apr 2020 22:30:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587162657; 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=4b/pVtCPnK9V5vEO5CLim9b2fmW9y11QvviWIH9TbLc=; b=id86EEb8lw4Xj+hEb5vWaRV4X4oCHsBtLqbi2Kxft/THEWIum1apri+B8z0quoWax/wCTZ 4wCk/YoapgcxicdkT2fnlVExRxhNGI7d9UeJUhh+6FGYQcPC0grLFeO8YYEIJx6au7/x1e qWWUL5+q6n0rWljiKIKjM7B5lSvQf/I= X-MC-Unique: 83gNZALLOwKXoL-SFVM6Fg-1 X-MC-Unique: RXWVCZxwOiWF4NCcNFjT7Q-1 From: Jim Fehlig To: Subject: [PATCH 3/5] libxl: refactor cpu and hypervisor feature parser/formatter Date: Fri, 17 Apr 2020 16:29:37 -0600 Message-ID: <20200417222939.15618-4-jfehlig@suse.com> In-Reply-To: <20200417222939.15618-1-jfehlig@suse.com> References: <20200417222939.15618-1-jfehlig@suse.com> X-ClientProxiedBy: SN1PR12CA0103.namprd12.prod.outlook.com (2603:10b6:802:21::38) To MWHPR1801MB2080.namprd18.prod.outlook.com (2603:10b6:301:69::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Originating-IP: [75.169.7.53] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ec9f4878-7e10-4f70-39bf-08d7e31edec4 X-MS-TrafficTypeDiagnostic: MWHPR1801MB1839: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:125; X-Forefront-PRVS: 0376ECF4DD X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1801MB2080.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(4636009)(376002)(346002)(396003)(39860400002)(366004)(136003)(6506007)(2616005)(36756003)(956004)(52116002)(316002)(1076003)(478600001)(6486002)(66946007)(66476007)(26005)(8676002)(66556008)(4326008)(107886003)(6916009)(86362001)(6512007)(186003)(81156014)(5660300002)(2906002)(6666004)(16526019)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /Tk4koA5tTsBm0Ymca5SP4rFw0Q12B0uKdY+1fu/Y5kBGtZTPFuL+QtK6wNTmEHQ9/fo3caMS1vDXm+o7tKOWrsPq+SyoyHw3l0ndkLNNQHHat4d/E/vChemcQMjiVUi8SzBcNUodpz5n5cl4OF8XWmckCd9UO4LlHwfldXZYueayNztGF6l6CM3+8YWXQY8dvw6RnStIMeeV5zAoHG1LrNFjzctufqcO2LuzdDElfehns4PerFhQhELpHl1PzK2LJIYCcfajV7ZhWWiEknbnPhPvzEtlbk8zbBHXlNIkt95yJR6tkiniEZT55y+4LTbXbwCB2bmGd//BBkFXjGc8TdQQ6hmqAkcirpWhTEcTlr6FvbGSYGQJVH9YXKE3hhqF6igoQLOKFdC0OYjuSvc7morH7Qc2rrBnQcr5D6wKb+W51eTubbTdJjyczRk7cQF X-MS-Exchange-AntiSpam-MessageData: Q24Due4ZnSN4IIgL1p2pspj+rrKKWxisoawKCkdNzcnKLCDoKZD1nwmI9+mO74QXLM1gX1TWeXITCjqALrDCEz6mHhUqBCfVDHahsyvINkzIS5gMJOjlYmJs/w1fWslis7OMH0+xLZKqR8Y2K/Iekg== X-MS-Exchange-CrossTenant-Network-Message-Id: ec9f4878-7e10-4f70-39bf-08d7e31edec4 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2020 22:30:02.5878 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Fgacqi+Ty7tr3r0z7Te2FoOkbI26bE3plyXlVfPdYaS7NTzl/KdvNOFCjqe04N4mSn2kxtcR6hz94UHIbLRSWg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1801MB1839 X-OriginatorOrg: suse.com 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 03HMUj7r007688 X-loop: libvir-list@redhat.com 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" Signed-off-by: Jim Fehlig Reviewed-by: Michal Privoznik --- src/libxl/xen_common.c | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c index bbb9739e01..87c66becaf 100644 --- a/src/libxl/xen_common.c +++ b/src/libxl/xen_common.c @@ -493,15 +493,12 @@ xenParsePCIList(virConfPtr conf, virDomainDefPtr def) =20 =20 static int -xenParseCPUFeatures(virConfPtr conf, - virDomainDefPtr def, - virDomainXMLOptionPtr xmlopt) +xenParseCPU(virConfPtr conf, + virDomainDefPtr def, + virDomainXMLOptionPtr xmlopt) { unsigned long count =3D 0; g_autofree char *cpus =3D NULL; - g_autofree char *tsc_mode =3D NULL; - int val =3D 0; - virDomainTimerDefPtr timer; =20 if (xenConfigGetULong(conf, "vcpus", &count, 1) < 0) return -1; @@ -526,6 +523,17 @@ xenParseCPUFeatures(virConfPtr conf, if (cpus && (virBitmapParse(cpus, &def->cpumask, 4096) < 0)) return -1; =20 + return 0; +} + + +static int +xenParseHypervisorFeatures(virConfPtr conf, virDomainDefPtr def) +{ + g_autofree char *tsc_mode =3D NULL; + virDomainTimerDefPtr timer; + int val =3D 0; + if (xenConfigGetString(conf, "tsc_mode", &tsc_mode, NULL) < 0) return -1; =20 @@ -552,27 +560,26 @@ xenParseCPUFeatures(virConfPtr conf, if (def->os.type =3D=3D VIR_DOMAIN_OSTYPE_HVM) { if (xenConfigGetBool(conf, "pae", &val, 1) < 0) return -1; - else if (val) def->features[VIR_DOMAIN_FEATURE_PAE] =3D VIR_TRISTATE_SWITCH_= ON; + if (xenConfigGetBool(conf, "acpi", &val, 1) < 0) return -1; - else if (val) def->features[VIR_DOMAIN_FEATURE_ACPI] =3D VIR_TRISTATE_SWITCH= _ON; + if (xenConfigGetBool(conf, "apic", &val, 1) < 0) return -1; - else if (val) def->features[VIR_DOMAIN_FEATURE_APIC] =3D VIR_TRISTATE_SWITCH= _ON; + if (xenConfigGetBool(conf, "hap", &val, 1) < 0) return -1; - else if (!val) def->features[VIR_DOMAIN_FEATURE_HAP] =3D VIR_TRISTATE_SWITCH_= OFF; + if (xenConfigGetBool(conf, "viridian", &val, 0) < 0) return -1; - else if (val) def->features[VIR_DOMAIN_FEATURE_VIRIDIAN] =3D VIR_TRISTATE_SW= ITCH_ON; =20 @@ -1483,7 +1490,10 @@ xenParseConfigCommon(virConfPtr conf, if (xenParseEventsActions(conf, def) < 0) return -1; =20 - if (xenParseCPUFeatures(conf, def, xmlopt) < 0) + if (xenParseCPU(conf, def, xmlopt) < 0) + return -1; + + if (xenParseHypervisorFeatures(conf, def) < 0) return -1; =20 if (xenParseTimeOffset(conf, def) < 0) @@ -2115,7 +2125,7 @@ xenFormatCPUAllocation(virConfPtr conf, virDomainDefP= tr def) =20 =20 static int -xenFormatCPUFeatures(virConfPtr conf, virDomainDefPtr def) +xenFormatHypervisorFeatures(virConfPtr conf, virDomainDefPtr def) { size_t i; bool hvm =3D !!(def->os.type =3D=3D VIR_DOMAIN_OSTYPE_HVM); @@ -2423,7 +2433,7 @@ xenFormatConfigCommon(virConfPtr conf, if (xenFormatCPUAllocation(conf, def) < 0) return -1; =20 - if (xenFormatCPUFeatures(conf, def) < 0) + if (xenFormatHypervisorFeatures(conf, def) < 0) return -1; =20 if (xenFormatTimeOffset(conf, def) < 0) --=20 2.26.0 From nobody Mon Apr 29 11:13:39 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 ARC-Seal: i=1; a=rsa-sha256; t=1587162679; cv=none; d=zohomail.com; s=zohoarc; b=iVYdWbQw0X0G/9pSZOqhR8iAXDeRy4Zd0OHl6Z+4ZAkBti3x+JdpzSO1e2DEABWkco5HKxUvWBnRAK/Thbt4gMU5BEsRetT00DC34O9uFeCVnUqoDiL64KMP+L60EObFOHOHnUFl/P6EzOU9FTfgvzuG0UgECoOdYuKOoq7Abv0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587162679; 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=QOwcKFvTnk5uM6sln8QdsQv37+6w+oqiw+u8CvaD6bs=; b=kyabEIxB2WRfufBoAFsG3aScVvXSk8tJEaBw6o/7f2ejMc4gnlJzl+37KUI0+pyvDonRsd0QaQCjfYGP+hwBVmX2PVT2bRaHZFMFg5NntgBiBNeSjolzCzV8I0YdCrLjD011/Zn3VM2wCqQnjhgLOSipQg1/EnuvT2UsHqM7Tdc= 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 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 1587162679143736.5147093013255; Fri, 17 Apr 2020 15:31:19 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-302-pehjDoj0Nru3ZJJGmAC6nQ-1; Fri, 17 Apr 2020 18:31:15 -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 023FD801FA2; Fri, 17 Apr 2020 22:31:10 +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 CE8C87E7EF; Fri, 17 Apr 2020 22:31:09 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7F39218089D6; Fri, 17 Apr 2020 22:31:09 +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 03HMUesl007662 for ; Fri, 17 Apr 2020 18:30:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0A5FC101B549; Fri, 17 Apr 2020 22:30:40 +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 05A77101B546 for ; Fri, 17 Apr 2020 22:30:40 +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 E1249185A790 for ; Fri, 17 Apr 2020 22:30:39 +0000 (UTC) Received: from m9a0014g.houston.softwaregrp.com (m9a0014g.houston.softwaregrp.com [15.124.64.90]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-300-0Vf2alxpPumulA0fMZxPeQ-1; Fri, 17 Apr 2020 18:30:37 -0400 Received: FROM m9a0014g.houston.softwaregrp.com (15.121.0.190) BY m9a0014g.houston.softwaregrp.com WITH ESMTP; Fri, 17 Apr 2020 22:29:53 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Fri, 17 Apr 2020 22:30:04 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (15.124.8.13) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Fri, 17 Apr 2020 22:30:04 +0000 Received: from MWHPR1801MB2080.namprd18.prod.outlook.com (2603:10b6:301:69::25) by MWHPR1801MB1839.namprd18.prod.outlook.com (2603:10b6:301:64::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.26; Fri, 17 Apr 2020 22:30:04 +0000 Received: from MWHPR1801MB2080.namprd18.prod.outlook.com ([fe80::b0f9:1d00:2adb:4e89]) by MWHPR1801MB2080.namprd18.prod.outlook.com ([fe80::b0f9:1d00:2adb:4e89%5]) with mapi id 15.20.2921.027; Fri, 17 Apr 2020 22:30:04 +0000 Received: from linux-tbji.provo.novell.com (75.169.7.53) by SN1PR12CA0103.namprd12.prod.outlook.com (2603:10b6:802:21::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.27 via Frontend Transport; Fri, 17 Apr 2020 22:30:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587162677; 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=QOwcKFvTnk5uM6sln8QdsQv37+6w+oqiw+u8CvaD6bs=; b=ZcLXJu458/qNrilkCEGVYQbhvye4INCqyMbgGRBetVZwrxFRa/+HF1C39KSSWllINOG7WT RjdxMKBLzzJIqf0uA1N+vYIfvI9zcYO3zHRKgHGplp5chMmJNZv/O2cnEHQRTVIpOzLTUR Ws9viOLst8r9UMB7ztC6Fen+pC5hvrA= X-MC-Unique: pehjDoj0Nru3ZJJGmAC6nQ-1 X-MC-Unique: 0Vf2alxpPumulA0fMZxPeQ-1 From: Jim Fehlig To: Subject: [PATCH 4/5] xenconfig: Add support for 'passthrough' hypervisor feature Date: Fri, 17 Apr 2020 16:29:38 -0600 Message-ID: <20200417222939.15618-5-jfehlig@suse.com> In-Reply-To: <20200417222939.15618-1-jfehlig@suse.com> References: <20200417222939.15618-1-jfehlig@suse.com> X-ClientProxiedBy: SN1PR12CA0103.namprd12.prod.outlook.com (2603:10b6:802:21::38) To MWHPR1801MB2080.namprd18.prod.outlook.com (2603:10b6:301:69::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Originating-IP: [75.169.7.53] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cce12df6-88a2-4f34-c438-08d7e31edf83 X-MS-TrafficTypeDiagnostic: MWHPR1801MB1839: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:608; X-Forefront-PRVS: 0376ECF4DD X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1801MB2080.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(4636009)(376002)(346002)(396003)(39860400002)(366004)(136003)(6506007)(2616005)(36756003)(956004)(52116002)(316002)(1076003)(478600001)(6486002)(66946007)(66476007)(26005)(8676002)(66556008)(4326008)(107886003)(6916009)(86362001)(6512007)(186003)(81156014)(5660300002)(2906002)(6666004)(16526019)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QmyoIy/31UMCNrf+b0nv7K8z9EEUbRrPw7KnDXLdzp/8m0IBzXb+eqGZuFtFGuFeH++0BTNqr3+zWy9q26kBhbUcV306NiWYPgtOr9E0LYdsIxYZLEDTTQnYsHPNtmYWB9nbv/NJSMgfE6sf6AiPxF1BlpFlILzXpsyDTcQhMmALG1CP9b0FF/iw4O7vJoO73co1PK6WsdM70mcPl8uhYEWY7I5g4EovJwgaG8i1/WJB55+6IhB9PICmaIFxn0AzD+06Ltmb0hD1Ggap5aCUOke2LbVEkxa29F/uSRa9GvG8EnvZAsoNps3hXHTdfV1+toXYnIOC1fO313EqzuqLkekm7sHXMgnvuikp+C0tK/rordwEbcMWzT3VrrW364DJ3XmCMK13jSoww8aXZpBLyk+KKxXSpVhFT9AkcF1NMfskfu6MaTEGGFM5BRSz+9hT X-MS-Exchange-AntiSpam-MessageData: box1cK+VxZRjoGUPBwpxpiV8a7T0KOLWUhKRz0ZYfRfNtlq66TtvEyNSYhsaOH6mYDFsVPDLA0RQz9F1BaXo+rKGTISuo7R0rA+IO3cUeSbQYiJwBmIt3epxVqrXdAI2Mxa03bP53FmaiR7jqQpvQA== X-MS-Exchange-CrossTenant-Network-Message-Id: cce12df6-88a2-4f34-c438-08d7e31edf83 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2020 22:30:03.8710 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: DUV/e4bXK/7IENRGo+gOpXz0aKveZz9tkQjsRw0q1XJaoFcPSKgJqipi7MwfAe0fAiYH6s5e87IDoBVnjXcfzg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1801MB1839 X-OriginatorOrg: suse.com 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 03HMUesl007662 X-loop: libvir-list@redhat.com 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" Add support for xl.cfg(5) 'passthrough' option in the domXML-to-xenconfig configuration converter. Signed-off-by: Jim Fehlig Reviewed-by: Michal Privoznik --- src/libvirt_private.syms | 2 ++ src/libxl/xen_common.c | 50 +++++++++++++++++++++++++++++++++++----- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index ec367653d5..54a0378f36 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -649,6 +649,8 @@ virDomainWatchdogActionTypeToString; virDomainWatchdogDefFree; virDomainWatchdogModelTypeFromString; virDomainWatchdogModelTypeToString; +virDomainXenPassthroughModeTypeFromString; +virDomainXenPassthroughModeTypeToString; virDomainXMLOptionGetNamespace; virDomainXMLOptionGetSaveCookie; virDomainXMLOptionNew; diff --git a/src/libxl/xen_common.c b/src/libxl/xen_common.c index 87c66becaf..5c37e431eb 100644 --- a/src/libxl/xen_common.c +++ b/src/libxl/xen_common.c @@ -530,14 +530,14 @@ xenParseCPU(virConfPtr conf, static int xenParseHypervisorFeatures(virConfPtr conf, virDomainDefPtr def) { - g_autofree char *tsc_mode =3D NULL; + g_autofree char *strval =3D NULL; virDomainTimerDefPtr timer; int val =3D 0; =20 - if (xenConfigGetString(conf, "tsc_mode", &tsc_mode, NULL) < 0) + if (xenConfigGetString(conf, "tsc_mode", &strval, NULL) < 0) return -1; =20 - if (tsc_mode) { + if (strval) { if (VIR_EXPAND_N(def->clock.timers, def->clock.ntimers, 1) < 0 || VIR_ALLOC(timer) < 0) return -1; @@ -547,16 +547,40 @@ xenParseHypervisorFeatures(virConfPtr conf, virDomain= DefPtr def) timer->tickpolicy =3D -1; timer->mode =3D VIR_DOMAIN_TIMER_MODE_AUTO; timer->track =3D -1; - if (STREQ_NULLABLE(tsc_mode, "always_emulate")) + if (STREQ_NULLABLE(strval, "always_emulate")) timer->mode =3D VIR_DOMAIN_TIMER_MODE_EMULATE; - else if (STREQ_NULLABLE(tsc_mode, "native")) + else if (STREQ_NULLABLE(strval, "native")) timer->mode =3D VIR_DOMAIN_TIMER_MODE_NATIVE; - else if (STREQ_NULLABLE(tsc_mode, "native_paravirt")) + else if (STREQ_NULLABLE(strval, "native_paravirt")) timer->mode =3D VIR_DOMAIN_TIMER_MODE_PARAVIRT; =20 def->clock.timers[def->clock.ntimers - 1] =3D timer; } =20 + if (xenConfigGetString(conf, "passthrough", &strval, NULL) < 0) + return -1; + + if (strval) { + if (STREQ(strval, "disabled")) { + def->features[VIR_DOMAIN_FEATURE_XEN] =3D VIR_TRISTATE_SWITCH_= OFF; + def->xen_features[VIR_DOMAIN_XEN_PASSTHROUGH] =3D VIR_TRISTATE= _SWITCH_OFF; + } else if (STREQ(strval, "enabled")) { + def->features[VIR_DOMAIN_FEATURE_XEN] =3D VIR_TRISTATE_SWITCH_= ON; + def->xen_features[VIR_DOMAIN_XEN_PASSTHROUGH] =3D VIR_TRISTATE= _SWITCH_ON; + } else if (STREQ(strval, "sync_pt")) { + def->features[VIR_DOMAIN_FEATURE_XEN] =3D VIR_TRISTATE_SWITCH_= ON; + def->xen_features[VIR_DOMAIN_XEN_PASSTHROUGH] =3D VIR_TRISTATE= _SWITCH_ON; + def->xen_passthrough_mode =3D VIR_DOMAIN_XEN_PASSTHROUGH_MODE_= SYNC_PT; + } else if (STREQ(strval, "share_pt")) { + def->features[VIR_DOMAIN_FEATURE_XEN] =3D VIR_TRISTATE_SWITCH_= ON; + def->xen_features[VIR_DOMAIN_XEN_PASSTHROUGH] =3D VIR_TRISTATE= _SWITCH_ON; + def->xen_passthrough_mode =3D VIR_DOMAIN_XEN_PASSTHROUGH_MODE_= SHARE_PT; + } else { + virReportError(VIR_ERR_CONF_SYNTAX, + _("Invalid passthrough mode %s"), strval); + } + } + if (def->os.type =3D=3D VIR_DOMAIN_OSTYPE_HVM) { if (xenConfigGetBool(conf, "pae", &val, 1) < 0) return -1; @@ -2163,6 +2187,20 @@ xenFormatHypervisorFeatures(virConfPtr conf, virDoma= inDefPtr def) } } =20 + if (def->features[VIR_DOMAIN_FEATURE_XEN] =3D=3D VIR_TRISTATE_SWITCH_O= N) { + if (def->xen_features[VIR_DOMAIN_XEN_PASSTHROUGH] =3D=3D VIR_TRIST= ATE_SWITCH_ON) { + if (def->xen_passthrough_mode =3D=3D VIR_DOMAIN_XEN_PASSTHROUG= H_MODE_SYNC_PT || + def->xen_passthrough_mode =3D=3D VIR_DOMAIN_XEN_PASSTHROUG= H_MODE_SHARE_PT) { + if (xenConfigSetString(conf, "passthrough", + virDomainXenPassthroughModeTypeToSt= ring(def->xen_passthrough_mode)) < 0) + return -1; + } else { + if (xenConfigSetString(conf, "passthrough", "enabled") < 0) + return -1; + } + } + } + for (i =3D 0; i < def->clock.ntimers; i++) { switch ((virDomainTimerNameType)def->clock.timers[i]->name) { case VIR_DOMAIN_TIMER_NAME_TSC: --=20 2.26.0 From nobody Mon Apr 29 11:13:39 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 ARC-Seal: i=1; a=rsa-sha256; t=1587162693; cv=none; d=zohomail.com; s=zohoarc; b=iv4Ol3y6iiKNrz92+nVlssGH9aYTWze8hEWWQtyAT2mz93EhvcKOB3EL+AyORawGiF68/cQEkUSarkUp9XF992/ey2Ur4jtiqtf7cmNA3nH9VeC7U176hweAc82vz0H7FatENNA9gvv4DVbadPgJqpSskd8gRliBOAUVbzlwuyY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1587162693; 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=MhE5svRtYpLEw6Zu4F0ELApWREOzx/c5RVBJ4LVEbZY=; b=ZSQJYKq9EhrfC9UKN2BamfMiPmpN5Tb32OzaJnwYZlj3GYRiFsndej5ikEIbMEVhdGsU08F7xy7rXX8Fw2HGwL3xE91ln7gPrnaQlbk3Hm3DOrnLF5bsdw0D1RsucCSG7y2icrhTMDuEKOizowN7/nCKH2KRCC1y1NbxNYJLORE= 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 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1587162693880539.1190884442782; Fri, 17 Apr 2020 15:31:33 -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-255-1ZxdxUnKOyKOIjEHy2lSvA-1; Fri, 17 Apr 2020 18:31:12 -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 918DF18C35A1; Fri, 17 Apr 2020 22:31:06 +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 65E411001DC2; Fri, 17 Apr 2020 22:31:06 +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 1CF1518089CE; Fri, 17 Apr 2020 22:31:06 +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 03HMUt8j007718 for ; Fri, 17 Apr 2020 18:30:55 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8F3D72166B2F; Fri, 17 Apr 2020 22:30:55 +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 89EFD2166B31 for ; Fri, 17 Apr 2020 22:30:52 +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 B3D49185A791 for ; Fri, 17 Apr 2020 22:30:52 +0000 (UTC) Received: from m9a0014g.houston.softwaregrp.com (m9a0014g.houston.softwaregrp.com [15.124.64.90]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-92-yt4HtbPHOlWDel-r3iJg1A-1; Fri, 17 Apr 2020 18:30:45 -0400 Received: FROM m9a0014g.houston.softwaregrp.com (15.121.0.190) BY m9a0014g.houston.softwaregrp.com WITH ESMTP; Fri, 17 Apr 2020 22:29:59 +0000 Received: from M4W0334.microfocus.com (2002:f78:1192::f78:1192) by M9W0067.microfocus.com (2002:f79:be::f79:be) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Fri, 17 Apr 2020 22:30:06 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (15.124.8.12) by M4W0334.microfocus.com (15.120.17.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10 via Frontend Transport; Fri, 17 Apr 2020 22:30:06 +0000 Received: from MWHPR1801MB2080.namprd18.prod.outlook.com (2603:10b6:301:69::25) by MWHPR1801MB1839.namprd18.prod.outlook.com (2603:10b6:301:64::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.26; Fri, 17 Apr 2020 22:30:05 +0000 Received: from MWHPR1801MB2080.namprd18.prod.outlook.com ([fe80::b0f9:1d00:2adb:4e89]) by MWHPR1801MB2080.namprd18.prod.outlook.com ([fe80::b0f9:1d00:2adb:4e89%5]) with mapi id 15.20.2921.027; Fri, 17 Apr 2020 22:30:05 +0000 Received: from linux-tbji.provo.novell.com (75.169.7.53) by SN1PR12CA0103.namprd12.prod.outlook.com (2603:10b6:802:21::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2921.27 via Frontend Transport; Fri, 17 Apr 2020 22:30:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587162692; 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=MhE5svRtYpLEw6Zu4F0ELApWREOzx/c5RVBJ4LVEbZY=; b=Z0km4zcbBmZ6uquSLqL+4l2r4B+wttbcCy7/xk/e2IBCX5zIQ8qfEYAk7c/wV7fXRHADkL zp0TkJNJH6iRm2n7kQP07gEUxHVPZXkQq10kRfv5Crqm4DvnqKb/ujwaHTah2Y1J3ErKFH wYFgM/6jTJiL2CQieK+xLfb+K8Cg8rQ= X-MC-Unique: 1ZxdxUnKOyKOIjEHy2lSvA-1 X-MC-Unique: yt4HtbPHOlWDel-r3iJg1A-1 From: Jim Fehlig To: Subject: [PATCH 5/5] tests: check conversion of passthrough hypervisor feature Date: Fri, 17 Apr 2020 16:29:39 -0600 Message-ID: <20200417222939.15618-6-jfehlig@suse.com> In-Reply-To: <20200417222939.15618-1-jfehlig@suse.com> References: <20200417222939.15618-1-jfehlig@suse.com> X-ClientProxiedBy: SN1PR12CA0103.namprd12.prod.outlook.com (2603:10b6:802:21::38) To MWHPR1801MB2080.namprd18.prod.outlook.com (2603:10b6:301:69::25) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-Originating-IP: [75.169.7.53] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 03b8cb28-4c67-4227-aada-08d7e31ee034 X-MS-TrafficTypeDiagnostic: MWHPR1801MB1839: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1186; X-Forefront-PRVS: 0376ECF4DD X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1801MB2080.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(10019020)(4636009)(376002)(346002)(396003)(39860400002)(366004)(136003)(6506007)(2616005)(36756003)(956004)(52116002)(316002)(1076003)(478600001)(6486002)(66946007)(66476007)(26005)(8676002)(66556008)(4326008)(107886003)(6916009)(86362001)(6512007)(186003)(81156014)(5660300002)(2906002)(6666004)(16526019)(8936002); DIR:OUT; SFP:1102; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +JL3F2K0BGGy/zblDPcoZDB50WH8sHjINTTq/QgBikP6nA1Vi+xRIYatkv7eidU81wg+Hb0J6l3IY6/lXS82GFQbnvKsBRXfHOg8Y6NNrpwKOYIm4q4LCTk6pKdKS4d41l5iCvXrLNk4wLuA9MZqfnav3M0CBxl3Y4cJpnlto4Pqx7oJ6IfjCAyDVd0lB3CUBin3x6/gzrfu9l3qad4IEAXKf0G06mwiphkV36Ez5N28iVZlqk1yED225pvfwrb2l0+h4fR67kaNda0yRaL5cKuNJZr35/1cGUoqp7QorGr7C4IpJewlr253B/xiDkTu8HXQKVACF3BaEuodlFMPSVrnNnQT64K/K4hmbqClwa8+TElU61A+wcW6c+xjcWRhoeC9gqkFrsHBeSFKo7TUPKVHdAcjA8My5ya9+BtFphDryFLtgUSX6Ft48BHvLiPt X-MS-Exchange-AntiSpam-MessageData: 2ehcvbvgNkIy2UDxA22g8v1WC+PNyjTO9Ivd0wnUmLLjZyVZ0QIdELELW/z8K+4+9rahnFEtH0Sn64f3+5+Lb3t1f8fXlz8RxcM3lK54guIAIRE02q5Ugv1hgLU5kyI1yHbc6caGdCHPAhkDPPGZLg== X-MS-Exchange-CrossTenant-Network-Message-Id: 03b8cb28-4c67-4227-aada-08d7e31ee034 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2020 22:30:04.9464 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 856b813c-16e5-49a5-85ec-6f081e13b527 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aIGXYoOf0MSuVQm3thbbrGa4bA6DzjMw0ljqCnCVRt19yuWifPVyi/0uyEycVzRVsStIW6QagBv98CU/lNAx3g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1801MB1839 X-OriginatorOrg: suse.com 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 03HMUt8j007718 X-loop: libvir-list@redhat.com 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" Add a new test to check the 'mode' attribute of the passthrough element and augment an existing, related test to check enablement of the passthrough element only. Signed-off-by: Jim Fehlig Reviewed-by: Michal Privoznik --- .../test-fullvirt-hypervisor-features.cfg | 26 ++++++++++ .../test-fullvirt-hypervisor-features.xml | 50 +++++++++++++++++++ .../xlconfigdata/test-paravirt-e820_host.cfg | 1 + .../xlconfigdata/test-paravirt-e820_host.xml | 1 + tests/xlconfigtest.c | 3 ++ 5 files changed, 81 insertions(+) diff --git a/tests/xlconfigdata/test-fullvirt-hypervisor-features.cfg b/tes= ts/xlconfigdata/test-fullvirt-hypervisor-features.cfg new file mode 100644 index 0000000000..88f018c823 --- /dev/null +++ b/tests/xlconfigdata/test-fullvirt-hypervisor-features.cfg @@ -0,0 +1,26 @@ +name =3D "XenGuest2" +uuid =3D "c7a5fdb2-cdaf-9455-926a-d65c16db1809" +maxmem =3D 579 +memory =3D 394 +vcpus =3D 1 +pae =3D 1 +acpi =3D 1 +apic =3D 1 +viridian =3D 0 +passthrough =3D "share_pt" +rtc_timeoffset =3D 0 +localtime =3D 0 +on_poweroff =3D "destroy" +on_reboot =3D "restart" +on_crash =3D "restart" +device_model =3D "/usr/lib/xen/bin/qemu-system-i386" +sdl =3D 0 +vnc =3D 1 +vncunused =3D 1 +vnclisten =3D "127.0.0.1" +vif =3D [ "mac=3D00:16:3e:66:92:9c,bridge=3Dxenbr1,script=3Dvif-bridge,mod= el=3De1000" ] +parallel =3D "none" +serial =3D "none" +builder =3D "hvm" +boot =3D "c" +disk =3D [ "format=3Draw,vdev=3Dhda,access=3Drw,backendtype=3Dphy,target= =3D/dev/HostVG/XenGuest2" ] diff --git a/tests/xlconfigdata/test-fullvirt-hypervisor-features.xml b/tes= ts/xlconfigdata/test-fullvirt-hypervisor-features.xml new file mode 100644 index 0000000000..c36290bb6a --- /dev/null +++ b/tests/xlconfigdata/test-fullvirt-hypervisor-features.xml @@ -0,0 +1,50 @@ + + XenGuest2 + c7a5fdb2-cdaf-9455-926a-d65c16db1809 + 592896 + 403456 + 1 + + hvm + /usr/lib/xen/boot/hvmloader + + + + + + + + + + + + destroy + restart + restart + + /usr/lib/xen/bin/qemu-system-i386 + + + + +
+ + + + + + +