From patchwork Wed Oct 20 17:27:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 516024 Delivered-To: patch@linaro.org Received: by 2002:ac0:cd8c:0:0:0:0:0 with SMTP id d12csp2027387imp; Wed, 20 Oct 2021 10:36:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyAd2Nw+bkaJw21wUR+m70sqZr7LCGlLvqPIP83/r68VSq9dqmB7xaYI1eh3mva9CujTSiB X-Received: by 2002:ab0:3d09:: with SMTP id f9mr715648uax.135.1634751408432; Wed, 20 Oct 2021 10:36:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634751408; cv=none; d=google.com; s=arc-20160816; b=ov6AUrIEqn7OHM6XQNjzOB+SjynZ3Uc/go6NYdqVpZNf+9C5KJfInRmcPtGW7TnTDh irFSCzS0HLfjkJOZsXR6i3M5pZV8JrZ+yrMEMWFBOyD9is9twqfuB1m0JAo1cHxUzdOt LqkSE9l7oBio6b6vixuNnDV30V8VJXOxUP4vRMsRZ3MOJNfnt9Kvka8pEj52bGCG7i6y E5D5z/F0qYlxmZFJ5xQhSu4JP6LGz8FnAdVkKs4343NY26JVMEcv9iKo01LRZMLNGacJ 1rh78tDYFXAb4FCK7Ma8T5A9jZOAllDjHDOAuNTgeiVXnIevMOd4r1f0dnii/aqAPPAO mrzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=JOvNgK26X/wymWFWaeD3t7rim5VIlCPCs1/Ursd+4V0=; b=bqeRtVYirUzI7ElQ4aQ9H1sadbrIIQKjj0mctHoZWys0RXv2BppOk08bwaf58iGZVZ jj14aWqzISirx1habpqwVtzsmz35QVyj/mgXteIUocZ3+PQXfP7EfWwXGCANvQd6JfOP MzHAol1KLTrp2ORfgwxJk/3m3+CzlhrJ+rN505elPntFdY4HtXHKsel/5D0p10KeuPvi v9h2CfsqO4lthWRpNDLsIvD9kSMXqcWfK+RusXuWZK36e/xSYbXs3/kuuKxrlvEn/Y67 fw4nx/ajzmzTv7pryQiSPwDrwCTNw4FHbbnUI/0b3CkNxYJ09ClGOiFjarEF8qkGbdHP EFFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=qwjl8s3o; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k11si2832927vsh.326.2021.10.20.10.36.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Oct 2021 10:36:48 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=qwjl8s3o; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:34520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mdFWB-0005FD-Pt for patch@linaro.org; Wed, 20 Oct 2021 13:36:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mdFUZ-00058s-BN for qemu-devel@nongnu.org; Wed, 20 Oct 2021 13:35:07 -0400 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:37508) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mdFUX-0002cG-8j for qemu-devel@nongnu.org; Wed, 20 Oct 2021 13:35:07 -0400 Received: by mail-wr1-x42d.google.com with SMTP id e12so58606wra.4 for ; Wed, 20 Oct 2021 10:35:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JOvNgK26X/wymWFWaeD3t7rim5VIlCPCs1/Ursd+4V0=; b=qwjl8s3o1f2q3K1oOpPZc9k7QGqhi+1+0Tmuprq6lDL1XG1trhS/0CXtnqSWlV0T80 yOqbQges4GBGe06ADqsGNdqgN5LHeQF8gVLUidp1H9GpPdfGyV2o5gtOfrq6ii9tBlZq p5fBkMneaSALGkqaqn0Bu42Chnewa7vasqGBDNJt9C8uhkhdlj3vFlTrdnkPCI9Ps9Zt IqiDq3hTiSgUBVpRMyQq4DlLFHXbrRzH3xn8fUO51ISheXQRoJ4fwv425nawazbGpFn9 KrRWOOXFcKHE2y0WrLMS7KNDdBIwsNotZDe8OdqBHQLM3+GXRjyN4ervkPLjB9J4UK92 5YRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JOvNgK26X/wymWFWaeD3t7rim5VIlCPCs1/Ursd+4V0=; b=MOyEsyaBnB+XeQ06bGRaCLKu2NUH/bSvNYJujBQxPMg8oyvhrYJZg10Atetf0eJEL4 B/IhizP6CVCOfuE+VIvy0+sNnVeYgMzGhYFkHX9ABwrfXMtG326e4JwOlqJ5AR/aBLUZ LvkX5cVdAoAjzrxScNFmAOTShkfIsXA+/TR7WnnFBXJ29GpMgXXlAJC4yC4vFx65dMxx N16YIOwAMB+U3hUVz0eIn3Q3iUTYLkZMI+ZAjbn/cDuANLZ1+KZ9jkhO1X0/IDwoslRa f3uhxWTpm8wfuB2mfMfvCh6CQp3RnGHBB369FDqV+BjthLJoIHp7NvNY1X2aTYblCs1n 2Xmw== X-Gm-Message-State: AOAM533Fuiw8fyl4ZD6ujgXSxILHbgKwmlWra68l6vuphTKyHMSmCFve HKwEshrj75jlkOIShnQgi8U6UQ== X-Received: by 2002:adf:d1c2:: with SMTP id b2mr725748wrd.73.1634751303921; Wed, 20 Oct 2021 10:35:03 -0700 (PDT) Received: from localhost.localdomain (cpc92880-cmbg19-2-0-cust679.5-4.cable.virginm.net. [82.27.106.168]) by smtp.gmail.com with ESMTPSA id n7sm2662270wrp.17.2021.10.20.10.35.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Oct 2021 10:35:03 -0700 (PDT) From: Jean-Philippe Brucker To: mst@redhat.com, imammedo@redhat.com, peter.maydell@linaro.org Subject: [PATCH v5 06/12] hw/arm/virt: Remove device tree restriction for virtio-iommu Date: Wed, 20 Oct 2021 18:27:40 +0100 Message-Id: <20211020172745.620101-7-jean-philippe@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211020172745.620101-1-jean-philippe@linaro.org> References: <20211020172745.620101-1-jean-philippe@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=jean-philippe@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jean-Philippe Brucker , ehabkost@redhat.com, eric.auger@redhat.com, jasowang@redhat.com, richard.henderson@linaro.org, qemu-devel@nongnu.org, peterx@redhat.com, shannon.zhaosl@gmail.com, qemu-arm@nongnu.org, ani@anisinha.ca, pbonzini@redhat.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" virtio-iommu is now supported with ACPI VIOT as well as device tree. Remove the restriction that prevents from instantiating a virtio-iommu device under ACPI. Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker Acked-by: Igor Mammedov --- hw/arm/virt.c | 10 ++-------- hw/virtio/virtio-iommu-pci.c | 12 ++---------- 2 files changed, 4 insertions(+), 18 deletions(-) -- 2.33.0 diff --git a/hw/arm/virt.c b/hw/arm/virt.c index f7f456bf58..3da7a86e37 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -2561,16 +2561,10 @@ static HotplugHandler *virt_machine_get_hotplug_handler(MachineState *machine, MachineClass *mc = MACHINE_GET_CLASS(machine); if (device_is_dynamic_sysbus(mc, dev) || - (object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM))) { + object_dynamic_cast(OBJECT(dev), TYPE_PC_DIMM) || + object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_IOMMU_PCI)) { return HOTPLUG_HANDLER(machine); } - if (object_dynamic_cast(OBJECT(dev), TYPE_VIRTIO_IOMMU_PCI)) { - VirtMachineState *vms = VIRT_MACHINE(machine); - - if (!vms->bootinfo.firmware_loaded || !virt_is_acpi_enabled(vms)) { - return HOTPLUG_HANDLER(machine); - } - } return NULL; } diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c index 770c286be7..5c0b87316a 100644 --- a/hw/virtio/virtio-iommu-pci.c +++ b/hw/virtio/virtio-iommu-pci.c @@ -48,16 +48,8 @@ static void virtio_iommu_pci_realize(VirtIOPCIProxy *vpci_dev, Error **errp) VirtIOIOMMU *s = VIRTIO_IOMMU(vdev); if (!qdev_get_machine_hotplug_handler(DEVICE(vpci_dev))) { - MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); - - error_setg(errp, - "%s machine fails to create iommu-map device tree bindings", - mc->name); - error_append_hint(errp, - "Check your machine implements a hotplug handler " - "for the virtio-iommu-pci device\n"); - error_append_hint(errp, "Check the guest is booted without FW or with " - "-no-acpi\n"); + error_setg(errp, "Check your machine implements a hotplug handler " + "for the virtio-iommu-pci device"); return; } for (int i = 0; i < s->nb_reserved_regions; i++) {