From patchwork Fri Oct 1 17:33:51 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: 515100 Delivered-To: patch@linaro.org Received: by 2002:a02:606e:0:0:0:0:0 with SMTP id d46csp1028473jaf; Fri, 1 Oct 2021 10:53:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5/zjrr4iKw/YB8MP+EZGhFPdjlHuhcOgr6uVcHR7ohc0E5IgWzJBF3srB9EDjT3lSxFEP X-Received: by 2002:a67:ce14:: with SMTP id s20mr5481731vsl.34.1633110802823; Fri, 01 Oct 2021 10:53:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633110802; cv=none; d=google.com; s=arc-20160816; b=vKYxrPeFbtO+AJF3nAYC6ZQMQpCN24ULyAb9WdzHHryEOZw9legv+yu7u7l1Z7zzMk JcJEJxRJfgSRp3UxV+uoVi2KI0Kb6hXeldxkfmNVuQKaORp6D1muaAVrN3iJ87m/XUtR L3RG7bDKuAXpo0m6NXAvwlVCbKcbu1cPY7Am1H11Pm48gZAalqWFLUPVkI/yislClb9X 89b4O83AvfBf+EaE1mfiI2a2lHKc5dh3OIrNcUmjyLyw2BN7wOmQ4va0c+KvcIrQrZZV L0lzaJ4Ixm7ngAOzWOpCCnIwR5Ci3XlM40nBbjr9DgdZXKBMT+fpNgH+wslfxV5HhYnZ 6l9Q== 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=GfzrfQuCesRig+urnKnz4Z2aAE6Gevuk3T+hVeRIpxs=; b=LByhKXLenDrIVj310JGKBUjt/wmi5i0zodR34uXwvM8Bjc61CBqVbp2DCdPE//noNr K/y6UwJGyoV5OtVnZqxqnQrNZ1TqzEm2ODaOVv5Iw6uHCCGK1ByD5xu0PfZwlyRmed5x gR7BFi4pLEAxyQTsvveooO+EB9yjmPAbYd4Q7wt1jxcqdHwC4bJuFEwYbv80UB83oDaq XOUszc8GfGjUSIpu/LYKWwzM2cDa+cLsH6fGd+Pg8XnRTS9E78sOJIXUETByOy8FM0R1 OXOt3QSNSbB70dz9sR3FctEDZ1qM+qkOybJ/DjB6v40v4iVDJewDBDN07HcV6faqIwlN hcPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xQ8Jn0vr; 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 r6si3024946vsj.56.2021.10.01.10.53.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Oct 2021 10:53:22 -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=xQ8Jn0vr; 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]:60610 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWMio-0003av-6Z for patch@linaro.org; Fri, 01 Oct 2021 13:53:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60882) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWMUO-0000ax-MK for qemu-devel@nongnu.org; Fri, 01 Oct 2021 13:38:30 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:38656) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWMUB-0000he-8x for qemu-devel@nongnu.org; Fri, 01 Oct 2021 13:38:26 -0400 Received: by mail-wm1-x32c.google.com with SMTP id g193-20020a1c20ca000000b0030d55f1d984so584659wmg.3 for ; Fri, 01 Oct 2021 10:38:14 -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=GfzrfQuCesRig+urnKnz4Z2aAE6Gevuk3T+hVeRIpxs=; b=xQ8Jn0vrk2k89rjJuHqRFACYxlijBivZZRJc8Yex/E0fS8B34rbVAyQuwY69WAZPY8 yLJjlsJxwF3no34xYeFXJdup+O1DGoLPsUto6T90QurgEr8SxmGU65mYC+yw2EtH3Vae WJQbcM/+0e+mQlXQp534eVQUgZa5bI33+VL6/y2mmKZSCRIo9yoqielkI9aq8LolUFHm /o9VYXQzYdOq3o027KGZQIXCFqmgNtbxZ8CDI7Hg5ujnBwgAWOS4V0ciYKqwbfE8E+Dp LBAExP4QY3tnFuyBQ6+iBxEBRvt2TlzEelavoL+vxOdu4SopLWn1IorTe3odWh+g/WxA 4+JA== 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=GfzrfQuCesRig+urnKnz4Z2aAE6Gevuk3T+hVeRIpxs=; b=ZnuDUvJYEjsIlmE595QYXMMJwhkVS1+CqHU0PAqLzhImfiKLRHtFuX7dTY50M7qbFo EqnVKzySaqpAa/8h62LgyVGHR4B/WPOMRZGYB/r+jPmu5dO8nHqYJ2a5rzPMWdn+CPcq Dh2IlorMNgW2LF3d+r8B+SuKKvy5MouOdEs+ROQZzj8m/cwML7CCHPHKu6Qdq1kyKe3f LIcA4qZ7uDSUxl1KBwMkR/CID180dPSDGy4fYkVektL50/wc2lOdWhtzEqRTd8vee/OK 4Q7urY5tJKHqZ9nFTHJEWnsDm1cIqHekkM3qsY7sQp9rTxXPk7VpbmsgsfXbuNJssFBk L4MQ== X-Gm-Message-State: AOAM530wgc5I7pwKZhiCULVr3RcZZdNEO5aJs8E/YV1d6Y2cQzG3BMsB MUayaHkBKpRvckulHZfgq1G8pw== X-Received: by 2002:a05:600c:4e86:: with SMTP id f6mr6076321wmq.52.1633109893772; Fri, 01 Oct 2021 10:38:13 -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 k9sm6186592wrz.22.2021.10.01.10.38.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Oct 2021 10:38:13 -0700 (PDT) From: Jean-Philippe Brucker To: eric.auger@redhat.com, imammedo@redhat.com Subject: [PATCH v4 03/11] hw/arm/virt: Remove device tree restriction for virtio-iommu Date: Fri, 1 Oct 2021 18:33:51 +0100 Message-Id: <20211001173358.863017-4-jean-philippe@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211001173358.863017-1-jean-philippe@linaro.org> References: <20211001173358.863017-1-jean-philippe@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=jean-philippe@linaro.org; helo=mail-wm1-x32c.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=unavailable 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: peter.maydell@linaro.org, ehabkost@redhat.com, mst@redhat.com, richard.henderson@linaro.org, qemu-devel@nongnu.org, shannon.zhaosl@gmail.com, Jean-Philippe Brucker , 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 --- hw/arm/virt.c | 10 ++-------- hw/virtio/virtio-iommu-pci.c | 7 ------- 2 files changed, 2 insertions(+), 15 deletions(-) -- 2.33.0 diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 1d59f0e59f..56e8fc7059 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..f30eb16cbf 100644 --- a/hw/virtio/virtio-iommu-pci.c +++ b/hw/virtio/virtio-iommu-pci.c @@ -48,16 +48,9 @@ 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"); return; } for (int i = 0; i < s->nb_reserved_regions; i++) {