From nobody Sat May 4 08:52:43 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623183444; cv=none; d=zohomail.com; s=zohoarc; b=IE84e/WygM0/qebxmbIEFDCebsmiCGlvMM65N70H/YJep02ZJcVasBoLFbQ7Uk6OnLc3QhmsbNMVtiyzp1oUqWyR607N3QGWWADrnICMSxeUhi5xieITdywpF/0r+0hKjncHxDqbuelLbsgAUcF0Doh/apQwYsxad51zQlt1JtQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623183444; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=LzrgAPXWONiNsbasYQwRromxLijoINN0hDM4URejtiM=; b=jDBVtKyOqru/KUPha52oo9gtUyQEpJkJ222iEgzN+3KoMyroJcxvun/BrA8bhaunSut7LCqoEzopogVKrQX7IbAzh2SdJcCblx/ywYC2Fgeqv9bBx/cg/GfNpP/m2Z1BoyKw4wW04XF4WxlJUE986iZa7zqmSxZ+ey0zx+fpPQ4= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1623183444352970.5012286235019; Tue, 8 Jun 2021 13:17: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-33-JoPVig7WNMOljJn7DoaDQQ-1; Tue, 08 Jun 2021 16:17:21 -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 13BA0107ACCD; Tue, 8 Jun 2021 20:17:15 +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 929C65D9DC; Tue, 8 Jun 2021 20:17:14 +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 5AA801800BB4; Tue, 8 Jun 2021 20:17:11 +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 158KHA3s008432 for ; Tue, 8 Jun 2021 16:17:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id EEA55103F268; Tue, 8 Jun 2021 20:17:09 +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 EA337114B31D for ; Tue, 8 Jun 2021 20:17:04 +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-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9F1AB1857F2B for ; Tue, 8 Jun 2021 20:17:04 +0000 (UTC) Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-121-qiXiwPNGN1O6lXZpoM-H7w-1; Tue, 08 Jun 2021 16:17:02 -0400 Received: by mail-wr1-f52.google.com with SMTP id c9so14231903wrt.5 for ; Tue, 08 Jun 2021 13:17:02 -0700 (PDT) Received: from quino.redhat.com ([83.240.60.216]) by smtp.googlemail.com with ESMTPSA id l31sm7415623wms.31.2021.06.08.13.17.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 13:17:00 -0700 (PDT) X-MC-Unique: JoPVig7WNMOljJn7DoaDQQ-1 X-MC-Unique: qiXiwPNGN1O6lXZpoM-H7w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LzrgAPXWONiNsbasYQwRromxLijoINN0hDM4URejtiM=; b=c3QTeNuTA9VGqs9N4LvCNIX74OAWQ6gr8CK/8cSJLdkAFPH+4cJdWGVrieF6TKy9ZW GJoVVwXQNeJccQHIC9P5m/uT8pRDeNhX2PPiuTdeMmTbyQadfxxZXC1fiwU3HA37x8l7 qCLxIIY87zbX3s155i0Zu/g+lKeCkBD9L5l3D6EduU12bkBbqCN1QIYe5sCfXDIiD7HS DQF+C58kIdJp3d5UJIW2Slefj2Ew8391ez7mCoz3PBnw/tZ/Qvzho3Lg0FVXejg+eZKj SU3+4bWmAO+Xe7hTEnlSUar29kh4FU330rEmSyUilxozYo7/kiv0uoXlAtT7bb4tbkIT c1DA== X-Gm-Message-State: AOAM532ZbKziGapyNtZ0jtaQ/BOSEuW6vcj3611gHJw2fgce5Xrqxmo/ SbFOgwAUFSpDGt2uOLiEcaLQDYRZVrodgIPpTC0= X-Google-Smtp-Source: ABdhPJyi+KOD7tZ9NNSUVF8rZS95Uu0FUFnUiE8WRg6ksBtAdYn99ErqdHDZNn7C74yLIDW6sJaAVw== X-Received: by 2002:adf:ee85:: with SMTP id b5mr24208137wro.95.1623183421022; Tue, 08 Jun 2021 13:17:01 -0700 (PDT) From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= To: libvir-list@redhat.com Subject: [PATCH] virt-host-validate: Fix IOMMU output on aarch64 Date: Tue, 8 Jun 2021 22:16:42 +0200 Message-Id: <20210608201642.109722-1-fabiano@fidencio.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= 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 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable virt-host-validate should print "Checking for device assignment IOMMU support" for all architectures, not only for Intel / AMD. This is the output without the patch: ``` [fidencio@dentola libvirt]$ virt-host-validate QEMU: comprobando if device /dev/kvm exists = : PASA QEMU: comprobando if device /dev/kvm is accessible = : PASA QEMU: comprobando if device /dev/vhost-net exists = : PASA QEMU: comprobando if device /dev/net/tun exists = : PASA QEMU: comprobando for cgroup 'cpu' controller support = : PASA QEMU: comprobando for cgroup 'cpuacct' controller support = : PASA QEMU: comprobando for cgroup 'cpuset' controller support = : PASA QEMU: comprobando for cgroup 'memory' controller support = : PASA QEMU: comprobando for cgroup 'devices' controller support = : ADVERTENCIA (Enable 'devices' in kernel Kconfig file or mount/enable= cgroup controller in your system) QEMU: comprobando for cgroup 'blkio' controller support = : PASA ADVERTENCIA (Unknown if this platform has IOMMU support) QEMU: comprobando for secure guest support = : ADVERTENCIA (Unknown if this platform has Secure Guest support) ``` This is the output with the patch: ``` [fidencio@dentola libvirt]$ ./build/tools/virt-host-validate QEMU: Checking if device /dev/kvm exists = : PASS QEMU: Checking if device /dev/kvm is accessible = : PASS QEMU: Checking if device /dev/vhost-net exists = : PASS QEMU: Checking if device /dev/net/tun exists = : PASS QEMU: Checking for cgroup 'cpu' controller support = : PASS QEMU: Checking for cgroup 'cpuacct' controller support = : PASS QEMU: Checking for cgroup 'cpuset' controller support = : PASS QEMU: Checking for cgroup 'memory' controller support = : PASS QEMU: Checking for cgroup 'devices' controller support = : WARN (Enable 'devices' in kernel Kconfig file or mount/enable cgroup co= ntroller in your system) QEMU: Checking for cgroup 'blkio' controller support = : PASS QEMU: Checking for device assignment IOMMU support = : WARN (Unknown if this platform has IOMMU support) QEMU: Checking for secure guest support = : WARN (Unknown if this platform has Secure Guest support) ``` Signed-off-by: Fabiano Fid=C3=AAncio Reviewed-by: Michal Privoznik --- This is a follow-up on https://listman.redhat.com/archives/libvir-list/2021= -June/msg00190.html --- tools/virt-host-validate-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/virt-host-validate-common.c b/tools/virt-host-validate-c= ommon.c index 9412bb7514..ee22a88b31 100644 --- a/tools/virt-host-validate-common.c +++ b/tools/virt-host-validate-common.c @@ -335,6 +335,8 @@ int virHostValidateIOMMU(const char *hvname, struct dirent *dent; int rc; =20 + virHostMsgCheck(hvname, "%s", _("for device assignment IOMMU support")= ); + flags =3D virHostValidateGetCPUFlags(); =20 if (flags && virBitmapIsBitSet(flags, VIR_HOST_VALIDATE_CPU_FLAG_VMX)) @@ -345,7 +347,6 @@ int virHostValidateIOMMU(const char *hvname, virBitmapFree(flags); =20 if (isIntel) { - virHostMsgCheck(hvname, "%s", _("for device assignment IOMMU suppo= rt")); if (access("/sys/firmware/acpi/tables/DMAR", F_OK) =3D=3D 0) { virHostMsgPass(); bootarg =3D "intel_iommu=3Don"; @@ -357,7 +358,6 @@ int virHostValidateIOMMU(const char *hvname, return VIR_HOST_VALIDATE_FAILURE(level); } } else if (isAMD) { - virHostMsgCheck(hvname, "%s", _("for device assignment IOMMU suppo= rt")); if (access("/sys/firmware/acpi/tables/IVRS", F_OK) =3D=3D 0) { virHostMsgPass(); bootarg =3D "iommu=3Dpt iommu=3D1"; --=20 2.31.1