From patchwork Wed Dec 15 10:40:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 524268 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp245131imb; Wed, 15 Dec 2021 03:31:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwk4ifVInjm2E6dK9jVTQr67aigL/eFBKp1fKqTLAcNFhPIOfsAOEdS7P/m2sJ0wTMSdJbJ X-Received: by 2002:a5b:108:: with SMTP id 8mr5867876ybx.623.1639567907222; Wed, 15 Dec 2021 03:31:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639567907; cv=none; d=google.com; s=arc-20160816; b=WFVemrIkvWqERmkgd0oqmYdF3xQaMfllg09yM3pVD5CGdjb7uBxgDIILTbN9kSsVK/ sQIhsT1421Atx9boWmOOX2ZUSqm6SJG2dClRPqdxpjWay0kgboJUyfrd0h/0jAvF7ptN f3TfeU3IF9GXEry3TqMojOytW2O98Gv5d0nhjCRM6DHDFFV3sDht9X89CiW2D1T+c0DM MG9kuX0CggTxDM8v+TGzTk7sBnbYCxKFm9c6ivUE14r30pRSPhaz0WaRCh0hkhgyclD2 nxbw5kHU/98Pv8S61uMuhkbOqOGRU17v4JmI7ONF6D2e1QP5JB9IZMx3LIpoMOvqxcFQ Q9gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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=LQfvPnAnSV9TH7ItFcMu9ilDeSCvJK9/sHlcO51QJJ0=; b=B95/XqoER+1vd8+Y6pMfUKMzcGAIU4csuX35F+KohjuqDw1M6pUeLYClKRyiTlwvJI CkofZvyCwpqFpoTj6VJi4e25F+F/GuDe6Iq8NNPox60Y+fsYH0tYxknwuVmccq1jQzUU +uScf4q98akygHarpEvDEf5Cyjbs98BFTMYjoYFh3SYyJftXejC9ZppYnJZqiS/0OnKi fxlUPekWZHlZ3dFP0KjDNjaT/Lx7q6rkZnGs/hrE6xWsJom9EX1k7KYMEoNzqAdihpvv NlUwWbgln6/X6uB0ZAY6rsgCNp+/JILYhQPKs3cg2KtLo5TrNbDVZnu7GueesWbIf23T 0+0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OS2HOkyd; 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=pass (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 135si1742655ybd.644.2021.12.15.03.31.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Dec 2021 03:31:47 -0800 (PST) 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=pass header.i=@linaro.org header.s=google header.b=OS2HOkyd; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:32834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mxSVd-0008Ad-FO for patch@linaro.org; Wed, 15 Dec 2021 06:31:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mxRih-0007HW-Ma for qemu-devel@nongnu.org; Wed, 15 Dec 2021 05:41:11 -0500 Received: from [2a00:1450:4864:20::435] (port=37643 helo=mail-wr1-x435.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mxRic-0000Al-Ju for qemu-devel@nongnu.org; Wed, 15 Dec 2021 05:41:11 -0500 Received: by mail-wr1-x435.google.com with SMTP id t26so1057171wrb.4 for ; Wed, 15 Dec 2021 02:41:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=LQfvPnAnSV9TH7ItFcMu9ilDeSCvJK9/sHlcO51QJJ0=; b=OS2HOkydTr9j8PsD7AfHWNrpbSzCavB/IVi5Rx4x6+PPQrXec8SPN5KBRZpT88TnLk QTcp99AOODOppUBoiNy2pUsK9b4C680DRBywqSGFtCHYtzbysmd78QdxfDh0QMM3gAr+ Us3oRFE6cw0ETBRs0j0xDSf70ERMiw91H/T6glCzADr7aeV/QNAR1C69w5/gP22AW8v1 p2th+YCUP8+vX3FeHYlzsiNHPHN+dGqOhmtL0pSeAB8BOFMvy1/OhNJyCRrAmc3a2k+n X0KlOfqHDEDq3LeSBjnqiLvAIn5CZo0gC/fFcmWQcN5yZOwzJGkDJmgH/e0NQzOJXoyF Lc9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LQfvPnAnSV9TH7ItFcMu9ilDeSCvJK9/sHlcO51QJJ0=; b=l0wLJoI++dAu8+Bw3R6GGnQawsWjp/SWchbtBJgX9Rb31nLXi5H57QGonIWTz+OFIF fF3MOhDtRhhtjzpOl+0vp/DXQ4zKnZ763R7Svm/aqZIdOJXrtAGmuesqRA5H+oa2ANWa vbx1OOn4BkEtZ2OUorrq9DrRek6eyVbbzoGUz2LkHZGpT3o0P6Fm5MjguiQKh98tlgKQ hwbO6rbPx7XcmW+Gr6Sm4esoJuL+jEXT2415RLJhrSR0e6kAngKyrZSabVN5niXrvXSI y4qKUXlO75mVNfY0DCTJ4WqZ9p1G96kYxsSrVYpFI4TqGdXBIzMp3ChsjIGnrht485p3 0K2w== X-Gm-Message-State: AOAM5307Y0mfU9i1aAWCoq3y8VqnyFO4uRediwnOlexfpUUVcAnFWCGs waXxV+9nDdOylYCkNz1cWDrz/Ei5nalEJQ== X-Received: by 2002:a05:6000:2a2:: with SMTP id l2mr3825920wry.110.1639564865407; Wed, 15 Dec 2021 02:41:05 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id e18sm1600815wrs.48.2021.12.15.02.41.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Dec 2021 02:41:05 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 26/33] hw/arm/virt-acpi-build: Add VIOT table for virtio-iommu Date: Wed, 15 Dec 2021 10:40:42 +0000 Message-Id: <20211215104049.2030475-27-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211215104049.2030475-1-peter.maydell@linaro.org> References: <20211215104049.2030475-1-peter.maydell@linaro.org> MIME-Version: 1.0 X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::435 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x435.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Jean-Philippe Brucker When a virtio-iommu is instantiated, describe it using the ACPI VIOT table. Acked-by: Igor Mammedov Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker Message-id: 20211210170415.583179-2-jean-philippe@linaro.org Signed-off-by: Peter Maydell --- hw/arm/virt-acpi-build.c | 7 +++++++ hw/arm/Kconfig | 1 + 2 files changed, 8 insertions(+) diff --git a/hw/arm/virt-acpi-build.c b/hw/arm/virt-acpi-build.c index 674f9026525..d0f4867fdfe 100644 --- a/hw/arm/virt-acpi-build.c +++ b/hw/arm/virt-acpi-build.c @@ -55,6 +55,7 @@ #include "kvm_arm.h" #include "migration/vmstate.h" #include "hw/acpi/ghes.h" +#include "hw/acpi/viot.h" #define ARM_SPI_BASE 32 @@ -1011,6 +1012,12 @@ void virt_acpi_build(VirtMachineState *vms, AcpiBuildTables *tables) } #endif + if (vms->iommu == VIRT_IOMMU_VIRTIO) { + acpi_add_table(table_offsets, tables_blob); + build_viot(ms, tables_blob, tables->linker, vms->virtio_iommu_bdf, + vms->oem_id, vms->oem_table_id); + } + /* XSDT is pointed to by RSDP */ xsdt = tables_blob->len; build_xsdt(tables_blob, tables->linker, table_offsets, vms->oem_id, diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 2d37d29f02b..e6525909438 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -27,6 +27,7 @@ config ARM_VIRT select DIMM select ACPI_HW_REDUCED select ACPI_APEI + select ACPI_VIOT config CHEETAH bool