From nobody Mon May 6 04:03:49 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 1527770422156131.2757157561416; Thu, 31 May 2018 05:40:22 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 05CC51907FA; Thu, 31 May 2018 12:40:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9815F608EF; Thu, 31 May 2018 12:40:19 +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 37E306B548; Thu, 31 May 2018 12:40:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4VCe4ft016486 for ; Thu, 31 May 2018 08:40:04 -0400 Received: by smtp.corp.redhat.com (Postfix) id AE8442010CC0; Thu, 31 May 2018 12:40:04 +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 A1A9E2010CBF for ; Thu, 31 May 2018 12:40:01 +0000 (UTC) Received: from mail-wr0-f169.google.com (mail-wr0-f169.google.com [209.85.128.169]) (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 DE6AB10DA9 for ; Thu, 31 May 2018 12:39:49 +0000 (UTC) Received: by mail-wr0-f169.google.com with SMTP id d2-v6so17406711wrm.10 for ; Thu, 31 May 2018 05:39:49 -0700 (PDT) Received: from filip.redhat.com ([213.175.37.12]) by smtp.googlemail.com with ESMTPSA id l5-v6sm19444452wrn.92.2018.05.31.05.39.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 05:39:47 -0700 (PDT) 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; bh=4nJn+x/JzIhGTBsljPH1o5ch3GXx3667b9I4hb0QwYc=; b=kmenEfw95B9JHMrfJnogOPGfqnLkywGrwZJDoCnLoRDeG9HYgbQlF2pVTgwXuRTy7J fW8s+IjZwCj4jMmChmNQ5dHnFOcLDqSKhG3/vccD+dwxDS6eAez4XDigh5HFug6J8ENa KN8n5/I/SIffdOSJ+DdLRBE45c340ayOmFeLI8LBweWR3VtIxHqbvFIqzmGczK7FAADp H7jzoQUyWp95S/e9J1siTjYH5NsvvvX/AtJQ1x8GIFN3UafUmtLVz/6iOgj3gFU1ViYv bXcB8In4pssKRJbznQ9AK+8n7MLeX2J9jJrb8qF9Ak5OAG/hKF7DED1muTONLKj+OGIj dzfQ== 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; bh=4nJn+x/JzIhGTBsljPH1o5ch3GXx3667b9I4hb0QwYc=; b=DJ1jZDrtYxYeoOb7EZFwC6c6EosLQKSg6rw0uCwdHRkTYptF3RCiqaoDL08h2H76nJ 94AcoXqbt6b8bsKCtNXCXL973aME/1DEqewTwajwDF11Bh/3MKuLuxgClq4kDuy0wWYo U6bK/148nw5kRNt26gHWckOUWK0PyaAF54sBZTlaNwk+6L+uNxJhTrS1q1fdLHU3W7Wa 4yjwFL2dmEFlDTHVR8nm3mBRcuP2OqQWlPj9znkxgxOKw7YutY2qwlCtxqqrvbo/xdVS XwhJNKWI5WeTHYWil71+i3geGvA4vM2meW4bo1fcNApyja74kGBGR5yD7ZLtCKEA8V3m /Klg== X-Gm-Message-State: ALKqPwet5Re98g73fdKapr4JjoEoyq7ptIHCPYG5z8tW5t2r2UXDMG00 UbPQbpPeHMx6RmgTb+Z6SPt2yA== X-Google-Smtp-Source: ADUXVKI+lKBYbu4wQfGpZdSyo0SE+CV/oXdVAQrpbSV+HpU8Hpbo7XviX6DTn0ua5vx02qQcLis20Q== X-Received: by 2002:adf:c4b6:: with SMTP id m51-v6mr5330036wrf.103.1527770388371; Thu, 31 May 2018 05:39:48 -0700 (PDT) From: Filip Alac To: libvir-list@redhat.com Date: Thu, 31 May 2018 14:30:51 +0200 Message-Id: <20180531123054.13831-2-filipalac@gmail.com> In-Reply-To: <20180531123054.13831-1-filipalac@gmail.com> References: <20180531123054.13831-1-filipalac@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 31 May 2018 12:39:50 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Thu, 31 May 2018 12:39:50 +0000 (UTC) for IP:'209.85.128.169' DOMAIN:'mail-wr0-f169.google.com' HELO:'mail-wr0-f169.google.com' FROM:'filipalac@gmail.com' RCPT:'' X-RedHat-Spam-Score: 1.301 * (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, SPF_PASS, T_DKIM_INVALID) 209.85.128.169 mail-wr0-f169.google.com 209.85.128.169 mail-wr0-f169.google.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.28 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-loop: libvir-list@redhat.com Cc: Filip Alac Subject: [libvirt] [PATCH v3 1/4] virutil: Introduce virHostHasIOMMU 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: , MIME-Version: 1.0 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 31 May 2018 12:40:20 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- src/conf/capabilities.c | 6 ++++++ src/conf/capabilities.h | 3 +++ src/util/virutil.c | 28 ++++++++++++++++++++++++++++ src/util/virutil.h | 2 ++ 4 files changed, 39 insertions(+) diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index dd2fc77f91..ba19d5db8c 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -1743,3 +1743,9 @@ virCapabilitiesInitCaches(virCapsPtr caps) virBitmapFree(cpus); return ret; } + +void +virCapabilitiesHostInitIOMMU(virCapsPtr caps) +{ + caps->host.iommu =3D virHostHasIOMMU(); +} diff --git a/src/conf/capabilities.h b/src/conf/capabilities.h index f0a06a24df..fe1b9ea455 100644 --- a/src/conf/capabilities.h +++ b/src/conf/capabilities.h @@ -183,6 +183,7 @@ struct _virCapsHost { int nPagesSize; /* size of pagesSize array */ unsigned int *pagesSize; /* page sizes support on the system */ unsigned char host_uuid[VIR_UUID_BUFLEN]; + bool iommu; }; =20 typedef int (*virDomainDefNamespaceParse)(xmlDocPtr, xmlNodePtr, @@ -327,4 +328,6 @@ void virCapsHostCacheBankFree(virCapsHostCacheBankPtr p= tr); =20 int virCapabilitiesInitCaches(virCapsPtr caps); =20 +void virCapabilitiesHostInitIOMMU(virCapsPtr caps); + #endif /* __VIR_CAPABILITIES_H */ diff --git a/src/util/virutil.c b/src/util/virutil.c index bb4474acd5..7edcda0ee7 100644 --- a/src/util/virutil.c +++ b/src/util/virutil.c @@ -2090,3 +2090,31 @@ virMemoryMaxValue(bool capped) else return LLONG_MAX; } + +bool +virHostHasIOMMU(void) +{ + DIR *iommuDir =3D NULL; + struct dirent *iommuGroup =3D NULL; + bool ret =3D false; + int direrr; + + /* condition 1 - /sys/kernel/iommu_groups/ contains entries */ + if (virDirOpenQuiet(&iommuDir, "/sys/kernel/iommu_groups/") < 0) + goto cleanup; + + while ((direrr =3D virDirRead(iommuDir, &iommuGroup, NULL)) > 0) { + /* assume we found a group */ + break; + } + + if (direrr < 0 || !iommuGroup) + goto cleanup; + /* okay, iommu is on and recognizes groups */ + + ret =3D true; + + cleanup: + VIR_DIR_CLOSE(iommuDir); + return ret; +} diff --git a/src/util/virutil.h b/src/util/virutil.h index be0f6b0ea8..1ba9635bd9 100644 --- a/src/util/virutil.h +++ b/src/util/virutil.h @@ -216,6 +216,8 @@ unsigned long long virMemoryLimitTruncate(unsigned long= long value); bool virMemoryLimitIsSet(unsigned long long value); unsigned long long virMemoryMaxValue(bool ulong) ATTRIBUTE_NOINLINE; =20 +bool virHostHasIOMMU(void); + /** * VIR_ASSIGN_IS_OVERFLOW: * @rvalue: value that is checked (evaluated twice) --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 04:03:49 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 1527770413912217.28471865744746; Thu, 31 May 2018 05:40:13 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C932026AC52; Thu, 31 May 2018 12:40:11 +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 5857B5F7C0; Thu, 31 May 2018 12:40:11 +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 B7D3C180BA81; Thu, 31 May 2018 12:40:10 +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 w4VCe8t7016501 for ; Thu, 31 May 2018 08:40:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2283F60181; Thu, 31 May 2018 12:40:08 +0000 (UTC) Received: from mx1.redhat.com (ext-mx12.extmail.prod.ext.phx2.redhat.com [10.5.110.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1534460177 for ; Thu, 31 May 2018 12:40:02 +0000 (UTC) Received: from mail-wr0-f174.google.com (mail-wr0-f174.google.com [209.85.128.174]) (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 4B9A1316EB6B for ; Thu, 31 May 2018 12:39:51 +0000 (UTC) Received: by mail-wr0-f174.google.com with SMTP id d8-v6so1661024wro.4 for ; Thu, 31 May 2018 05:39:51 -0700 (PDT) Received: from filip.redhat.com ([213.175.37.12]) by smtp.googlemail.com with ESMTPSA id l5-v6sm19444452wrn.92.2018.05.31.05.39.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 05:39:49 -0700 (PDT) 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; bh=Pkq6/2kNg4OPSRhPv7Ih4fSKSZAoZv9jy0wd1UOc3To=; b=jPUXW5Y1VswbY+pszOsOGWZoW8h/z3Shp/a3c2DVg2JE4UnmhU8mI3zwbwl551DutD soj9ZKyKEWi+GcBKriy28adT9hYVf3Adj0AeXA/dGIuLmbcgTDvkhBuxFrM2B7KQsQh+ 9gIKsoA/0y0aHzcQ/e/WRCMf0iQkkSia8FdMEf+vClPUT8eijllhZM0gNPOEz/Oxudkj L+DDQHiqSlvyAbgiIqm24dej0auGVJWJ5EFiAa0qyG49ia9S5GNqZ7vkNyuYIgJZIeoj e+RCCd5lQJzSjpkcQ+eR36AW8FY3oBqzeNeNyMWqE2vQicrTKDZUwinnFDbwEqppch8n uUYw== 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; bh=Pkq6/2kNg4OPSRhPv7Ih4fSKSZAoZv9jy0wd1UOc3To=; b=q1dJ7iGvzQHRZ3zceQdouSm88jqp8abo4HaC/dVC0o8mK3kSIyDDXxWtJqsqjueArW UPi48hUk27O/xHjC57i+C7z5eyIfI1YhJ2VfuPeASiqX2kQAH23F1mp2djHEuYXSATy0 SpTG4hUoksclU+LbkcEzTgopVQS6spcn7mJf/YmJslqXXTkBystth/hJHN11Xgi5RAt2 0nv6AN5LsDOL7qvXc9l/VOHWKFc9nNFfooNvRVo37ZFUXd9w0Olx/dVwuIvort4A5jJz Z6hWUkbNrACl04RI8h/aYLkOVEXI7E1cM8IvlURCqvFX2wQ3E+Jz0gfUkUwV03ncawas clKg== X-Gm-Message-State: ALKqPwegZsTzfKHFYPXkFMH5H4blZpLWv0rdv3phnBx4zXtcfsg6dZ2x QLsO70BbScJLxotPavlQDl9fOw== X-Google-Smtp-Source: ADUXVKI9CGTK7AnnUIi8pAuTfFlltbM+vqGEC6oArw5Z+6XinMxYrAH+rTE4X+jU24TKURQtGIhVMA== X-Received: by 2002:adf:a925:: with SMTP id u34-v6mr5825746wrc.248.1527770389791; Thu, 31 May 2018 05:39:49 -0700 (PDT) From: Filip Alac To: libvir-list@redhat.com Date: Thu, 31 May 2018 14:30:52 +0200 Message-Id: <20180531123054.13831-3-filipalac@gmail.com> In-Reply-To: <20180531123054.13831-1-filipalac@gmail.com> References: <20180531123054.13831-1-filipalac@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 31 May 2018 12:39:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.41]); Thu, 31 May 2018 12:39:51 +0000 (UTC) for IP:'209.85.128.174' DOMAIN:'mail-wr0-f174.google.com' HELO:'mail-wr0-f174.google.com' FROM:'filipalac@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.396 (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS, T_DKIM_INVALID) 209.85.128.174 mail-wr0-f174.google.com 209.85.128.174 mail-wr0-f174.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.41 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Cc: Filip Alac Subject: [libvirt] [PATCH v3 2/4] qemu: hostdev: Refactor code 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: , MIME-Version: 1.0 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 31 May 2018 12:40:12 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Make qemuHostdevHostSupportsPassthroughVFIO use virHostHasIOMMU. --- src/libvirt_private.syms | 2 ++ src/qemu/qemu_hostdev.c | 29 ++++------------------------- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 6001635916..99a14ab460 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -58,6 +58,7 @@ virCapabilitiesFreeMachines; virCapabilitiesFreeNUMAInfo; virCapabilitiesGetCpusForNodemask; virCapabilitiesGetNodeInfo; +virCapabilitiesHostInitIOMMU; virCapabilitiesHostSecModelAddBaseLabel; virCapabilitiesInitCaches; virCapabilitiesInitNUMA; @@ -3073,6 +3074,7 @@ virGetUserName; virGetUserRuntimeDirectory; virGetUserShell; virHexToBin; +virHostHasIOMMU; virIndexToDiskName; virIsDevMapperDevice; virIsSUID; diff --git a/src/qemu/qemu_hostdev.c b/src/qemu/qemu_hostdev.c index 955b5df1a3..25e2dcf868 100644 --- a/src/qemu/qemu_hostdev.c +++ b/src/qemu/qemu_hostdev.c @@ -23,7 +23,6 @@ =20 #include =20 -#include #include #include #include @@ -124,33 +123,13 @@ qemuHostdevUpdateActiveDomainDevices(virQEMUDriverPtr= driver, bool qemuHostdevHostSupportsPassthroughVFIO(void) { - DIR *iommuDir =3D NULL; - struct dirent *iommuGroup =3D NULL; - bool ret =3D false; - int direrr; - - /* condition 1 - /sys/kernel/iommu_groups/ contains entries */ - if (virDirOpenQuiet(&iommuDir, "/sys/kernel/iommu_groups/") < 0) - goto cleanup; - - while ((direrr =3D virDirRead(iommuDir, &iommuGroup, NULL)) > 0) { - /* assume we found a group */ - break; - } - - if (direrr < 0 || !iommuGroup) - goto cleanup; - /* okay, iommu is on and recognizes groups */ + if (!virHostHasIOMMU()) + return false; =20 - /* condition 2 - /dev/vfio/vfio exists */ if (!virFileExists("/dev/vfio/vfio")) - goto cleanup; - - ret =3D true; + return false; =20 - cleanup: - VIR_DIR_CLOSE(iommuDir); - return ret; + return true; } =20 =20 --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 04:03:49 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 1527770426803171.0456291339932; Thu, 31 May 2018 05:40:26 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8B7B2C057E07; Thu, 31 May 2018 12:40:24 +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 555AD90CEC; Thu, 31 May 2018 12:40:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id EBFD56B548; Thu, 31 May 2018 12:40:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4VCe7WG016494 for ; Thu, 31 May 2018 08:40:07 -0400 Received: by smtp.corp.redhat.com (Postfix) id 06641308BDAA; Thu, 31 May 2018 12:40:07 +0000 (UTC) Received: from mx1.redhat.com (ext-mx14.extmail.prod.ext.phx2.redhat.com [10.5.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F10E7308BDAC for ; Thu, 31 May 2018 12:40:04 +0000 (UTC) Received: from mail-wr0-f177.google.com (mail-wr0-f177.google.com [209.85.128.177]) (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 A65C130A4CA5 for ; Thu, 31 May 2018 12:39:52 +0000 (UTC) Received: by mail-wr0-f177.google.com with SMTP id i14-v6so32854480wre.2 for ; Thu, 31 May 2018 05:39:52 -0700 (PDT) Received: from filip.redhat.com ([213.175.37.12]) by smtp.googlemail.com with ESMTPSA id l5-v6sm19444452wrn.92.2018.05.31.05.39.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 05:39:50 -0700 (PDT) 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; bh=Dr/EnUIBLVH71t8f0Nd0wTeG0we7d20in2LNxuf+S/s=; b=djDszsMp6saAO3nWo/A1SBJYZOdSh0idtzFs/Pim+6jDU+KxJ6lL4wIIx9M0qBMBNA 3o77cWnCGrZCI6YX+7H92XWI6xh8FV+JZCBBoNMOhvJfOiQKZ65NIdv9WEdeLi+/+Tk6 LTMuFqgRISEfiwA/CW/bnbecLzwoWE7Lq/AxDbmCdz2aRxQOsXlYAIcSHiqcmd2u1i1r VP8vZeo6QPlmjnSRwobOvi6YQZZsxHqA5ItepESPK0v3oa6s92rO8K6q8s9lmvvTXa+8 wltWzuHKmsJxunsYYXGiO3r4VFuqei2KH34BefJjACOYYvd8IMBOPzMeALiA6c7kiTUv b1Ng== 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; bh=Dr/EnUIBLVH71t8f0Nd0wTeG0we7d20in2LNxuf+S/s=; b=SPp/HA3ztSBz4PazCmJqEbKSB85Tv9JGXZoHrwITThp02xjZwc7hbX7c+mKn0jQrcN uXZo0Qogunm8o8vjeHUfO7H6A8tdVgpDtkpza/mC88MelIl7tFjzzZQVGJ69k3BfGjJd I3wCi544J2x3JnWg0v6KokSRdVDkcQ4J2PLynKY3EZZLgVOaij6HE3LTgeKDWK9T2RMd d1tWYKqI8T7ILFQzLopXEOhOnCevDM8sba0/+Vy0NnGtIzyOI+Hv+2ovZX0+HAgX6tQ3 oI7jXIAPzRZssBcKDgsHePsvdxZFOMY7EgUyN92+w/PanLY6VBJV8Ikxm9q44ieghyYl d80A== X-Gm-Message-State: ALKqPwfdGREOgYAekYL1FsCXHV3TITyLnY/Gyvi62N/WlSryjWDs65pd aosILKPkKCStLm3IoAMbytBBoQ== X-Google-Smtp-Source: ADUXVKL98NoLR+3wQR6j/2C8NG9Rghj7zAH4uVD7v1V4ffKZOZ0RmJ1N82hKpyeQVY/9qKpdvFLwiQ== X-Received: by 2002:adf:be81:: with SMTP id i1-v6mr5236006wrh.86.1527770391044; Thu, 31 May 2018 05:39:51 -0700 (PDT) From: Filip Alac To: libvir-list@redhat.com Date: Thu, 31 May 2018 14:30:53 +0200 Message-Id: <20180531123054.13831-4-filipalac@gmail.com> In-Reply-To: <20180531123054.13831-1-filipalac@gmail.com> References: <20180531123054.13831-1-filipalac@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 31 May 2018 12:39:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 31 May 2018 12:39:53 +0000 (UTC) for IP:'209.85.128.177' DOMAIN:'mail-wr0-f177.google.com' HELO:'mail-wr0-f177.google.com' FROM:'filipalac@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.396 (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS, T_DKIM_INVALID) 209.85.128.177 mail-wr0-f177.google.com 209.85.128.177 mail-wr0-f177.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.43 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.24 X-loop: libvir-list@redhat.com Cc: Filip Alac Subject: [libvirt] [PATCH v3 3/4] capabilities: Extend capabilities with iommu_support 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 31 May 2018 12:40:25 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- docs/schemas/capability.rng | 13 +++++++++++++ src/conf/capabilities.c | 3 +++ src/qemu/qemu_capabilities.c | 3 +++ src/test/test_driver.c | 2 ++ tests/qemucaps2xmldata/all_1.6.0-1.xml | 1 + tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml | 1 + tests/vircaps2xmldata/vircaps-aarch64-basic.xml | 1 + tests/vircaps2xmldata/vircaps-x86_64-basic.xml | 1 + tests/vircaps2xmldata/vircaps-x86_64-caches.xml | 1 + .../vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml | 1 + .../vircaps-x86_64-resctrl-skx-twocaches.xml | 1 + .../vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml | 1 + tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml | 1 + 13 files changed, 30 insertions(+) diff --git a/docs/schemas/capability.rng b/docs/schemas/capability.rng index 66c5de62e5..52164d5ecb 100644 --- a/docs/schemas/capability.rng +++ b/docs/schemas/capability.rng @@ -39,6 +39,9 @@ + + + @@ -155,6 +158,16 @@ =20 + + + + + + + + + + diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c index ba19d5db8c..0de1440349 100644 --- a/src/conf/capabilities.c +++ b/src/conf/capabilities.c @@ -1025,6 +1025,9 @@ virCapabilitiesFormatXML(virCapsPtr caps) virBufferAddLit(&buf, "\n"); } =20 + virBufferAsprintf(&buf, "\n", + caps->host.iommu ? "yes" : "no"); + if (caps->host.offlineMigrate) { virBufferAddLit(&buf, "\n"); virBufferAdjustIndent(&buf, 2); diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index e2e76e4dd8..9b5423944b 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -948,6 +948,9 @@ virQEMUCapsInit(virFileCachePtr cache) if (virNodeSuspendGetTargetMask(&caps->host.powerMgmt) < 0) VIR_WARN("Failed to get host power management capabilities"); =20 + /* Add IOMMU info */ + virCapabilitiesHostInitIOMMU(caps); + /* Add huge pages info */ if (virCapabilitiesInitPages(caps) < 0) VIR_WARN("Failed to get pages info"); diff --git a/src/test/test_driver.c b/src/test/test_driver.c index a43b9781eb..89121d4220 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -322,6 +322,8 @@ testBuildCapabilities(virConnectPtr conn) if (virCapabilitiesAddHostFeature(caps, "nonpae") < 0) goto error; =20 + virCapabilitiesHostInitIOMMU(caps); + if (VIR_ALLOC_N(caps->host.pagesSize, 4) < 0) goto error; =20 diff --git a/tests/qemucaps2xmldata/all_1.6.0-1.xml b/tests/qemucaps2xmldat= a/all_1.6.0-1.xml index 84d60008d8..efe86b9a12 100644 --- a/tests/qemucaps2xmldata/all_1.6.0-1.xml +++ b/tests/qemucaps2xmldata/all_1.6.0-1.xml @@ -5,6 +5,7 @@ i686 + =20 diff --git a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml b/tests/qemu= caps2xmldata/nodisksnapshot_1.6.0-1.xml index 28762c263b..981344e6fd 100644 --- a/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml +++ b/tests/qemucaps2xmldata/nodisksnapshot_1.6.0-1.xml @@ -5,6 +5,7 @@ i686 + =20 diff --git a/tests/vircaps2xmldata/vircaps-aarch64-basic.xml b/tests/vircap= s2xmldata/vircaps-aarch64-basic.xml index ce156a364e..50466f9162 100644 --- a/tests/vircaps2xmldata/vircaps-aarch64-basic.xml +++ b/tests/vircaps2xmldata/vircaps-aarch64-basic.xml @@ -5,6 +5,7 @@ aarch64 + diff --git a/tests/vircaps2xmldata/vircaps-x86_64-basic.xml b/tests/vircaps= 2xmldata/vircaps-x86_64-basic.xml index 1f2c6659a5..e7be6def3e 100644 --- a/tests/vircaps2xmldata/vircaps-x86_64-basic.xml +++ b/tests/vircaps2xmldata/vircaps-x86_64-basic.xml @@ -5,6 +5,7 @@ x86_64 + diff --git a/tests/vircaps2xmldata/vircaps-x86_64-caches.xml b/tests/vircap= s2xmldata/vircaps-x86_64-caches.xml index 0c6f3769a2..ca671a1640 100644 --- a/tests/vircaps2xmldata/vircaps-x86_64-caches.xml +++ b/tests/vircaps2xmldata/vircaps-x86_64-caches.xml @@ -5,6 +5,7 @@ x86_64 + diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml b/tests/v= ircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml index 443917c62d..1d3df318c5 100644 --- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml +++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-cdp.xml @@ -5,6 +5,7 @@ x86_64 + diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx-twocaches.xml= b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx-twocaches.xml index d18665b24f..44c1042afe 100644 --- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx-twocaches.xml +++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx-twocaches.xml @@ -5,6 +5,7 @@ x86_64 + diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml b/tests/v= ircaps2xmldata/vircaps-x86_64-resctrl-skx.xml index 0cd25e59a9..8382a26c7a 100644 --- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml +++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl-skx.xml @@ -5,6 +5,7 @@ x86_64 + diff --git a/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml b/tests/virca= ps2xmldata/vircaps-x86_64-resctrl.xml index 7629259294..4840614e86 100644 --- a/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml +++ b/tests/vircaps2xmldata/vircaps-x86_64-resctrl.xml @@ -5,6 +5,7 @@ x86_64 + --=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon May 6 04:03:49 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 1527770413512321.740003775236; Thu, 31 May 2018 05:40:13 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 8255A30A542A; Thu, 31 May 2018 12:40:11 +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 42119100194F; Thu, 31 May 2018 12:40:11 +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 C6F67180BA82; Thu, 31 May 2018 12:40:10 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4VCe8YB016507 for ; Thu, 31 May 2018 08:40:08 -0400 Received: by smtp.corp.redhat.com (Postfix) id 95D8260240; Thu, 31 May 2018 12:40:08 +0000 (UTC) Received: from mx1.redhat.com (ext-mx11.extmail.prod.ext.phx2.redhat.com [10.5.110.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8DB0818A6F for ; Thu, 31 May 2018 12:40:04 +0000 (UTC) Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) (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 BDA4430014CD for ; Thu, 31 May 2018 12:39:53 +0000 (UTC) Received: by mail-wr0-f195.google.com with SMTP id o12-v6so1798906wrm.12 for ; Thu, 31 May 2018 05:39:53 -0700 (PDT) Received: from filip.redhat.com ([213.175.37.12]) by smtp.googlemail.com with ESMTPSA id l5-v6sm19444452wrn.92.2018.05.31.05.39.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 05:39:51 -0700 (PDT) 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; bh=qhfQnHWbBupwEd8YPnhZ90MRbTdthGe/NGB8D6IQ1jc=; b=O8bImfYiRUrqKfDbTXzIkHsACvEkAarI7zJhx2ZmD6kowh0rSDvK+rY4iwHh7aOoQS 8vUdvEs+6qwRtfRJJQiV4fb9Czm819PHTFIF9pKXWdJ7O0LAcYKan0QlgSUEiRVCQrcI R8Tbc7Fxn2F0Dmk+5MAxwnwod1BNpDWBso3pmvFuFrucvHtz58J6IU0VhGZalIowLhop 0sBGkNDDBZaifpS7+gNKp4LOyDrQdoHJDa0rrE4zj499hQvgTUOjci8YB+Z/zUZ39DPu cQsxIX/Gg2JfmjQ0+v7hR0qRwXWrLWfvzwB8P9FeJFt7rNZgPReT4rv6Wpi+GA97vc/X fO2w== 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; bh=qhfQnHWbBupwEd8YPnhZ90MRbTdthGe/NGB8D6IQ1jc=; b=BABBuAqENCKqLOSztpVniC970TxTwriYl2pzphR5KQDOn1zCoX/mjtD7Gw3U+Bn0xn iY+6OJAvtZYwM/sYqROYTO581Kch/Na9X5oCq9OzlmjMbx5TScNlI2qElj/jkaMZzJrG by7ATLKp3q7QWrUYCsXHE+lKgIeuMqg2qvAfXuBZNouRdLJoGsQLuF8NnFC1VZiEBGzy ADVdUODydIor2m1dJpOLYUTTRwU2VKmHf6VwSjSFIkEaqWw/gE26NfaxbyyBiA58LSHX rR0ryzvdQ0MobNXIbxJuT1xB3CU6IipRuE6kRQoWYYPfV/+UDiKlPNai4Vc/ZNgilm3X tDOQ== X-Gm-Message-State: ALKqPwfpOMnhaCWz2ywDcpFTot/L1MdPoc+qWn6JAWha9agKZhxbPYa2 pUwh+lyubLqFJOyi7JqXWdqUAg== X-Google-Smtp-Source: ADUXVKLJutmsgu/TBB1ntNXdOMNVE+OdfjodHDRNRJHipC8ZuNeOcUNH+i5BuawcZoTu9Jsn+6D7LQ== X-Received: by 2002:adf:9a4c:: with SMTP id z70-v6mr1935904wrb.118.1527770392222; Thu, 31 May 2018 05:39:52 -0700 (PDT) From: Filip Alac To: libvir-list@redhat.com Date: Thu, 31 May 2018 14:30:54 +0200 Message-Id: <20180531123054.13831-5-filipalac@gmail.com> In-Reply-To: <20180531123054.13831-1-filipalac@gmail.com> References: <20180531123054.13831-1-filipalac@gmail.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 31 May 2018 12:39:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Thu, 31 May 2018 12:39:53 +0000 (UTC) for IP:'209.85.128.195' DOMAIN:'mail-wr0-f195.google.com' HELO:'mail-wr0-f195.google.com' FROM:'filipalac@gmail.com' RCPT:'' X-RedHat-Spam-Score: -0.396 (DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_PASS, T_DKIM_INVALID) 209.85.128.195 mail-wr0-f195.google.com 209.85.128.195 mail-wr0-f195.google.com X-Scanned-By: MIMEDefang 2.84 on 10.5.110.40 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Cc: Filip Alac Subject: [libvirt] [PATCH v3 4/4] docs: news: Explain iommu_support improvement 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Thu, 31 May 2018 12:40:12 +0000 (UTC) X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" --- docs/news.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index c45850f625..b5ac50f3a1 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -123,6 +123,14 @@ secret-event, pool-event and nodedev-event) + + + capabilities: Provide info about host IOMMU support + + + Capabilities XML now provide information about host IOMMU suppor= t. + +
--=20 2.17.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list