From patchwork Tue Sep 27 10:03:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 609595 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp245472pvb; Tue, 27 Sep 2022 03:14:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4LcO/dlWE+GnUz7qH5loyrM3my3kJl/QQNrkAtRWVKhEdgK8R7e/sKjBguMfpCCXdbEKxC X-Received: by 2002:a37:a15:0:b0:6cb:e349:99a9 with SMTP id 21-20020a370a15000000b006cbe34999a9mr16692832qkk.675.1664273653368; Tue, 27 Sep 2022 03:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664273653; cv=none; d=google.com; s=arc-20160816; b=CejnqBh68suQbPx97LYdYHQCmB1LGj98DmmJajgGSY2NLMP8Irpeu8Iq3VserdUvPt M/6+v36PuGzFi5bopFOKuNVIOrM5L1I04sXaM8+Si9G2FTSuQ5cqUV8hk733p+b1ISGL 6WGj8qQPmOIgCXL6tbCcOJldVLiE4HtkPsGy+exTt8bKguAxSERModRtYgp2FRWzlMgw puG4z0FfcjoiqCUHdl0JvIaUdFpcQ6HlZLKMDa+RFB6uHdnpjmPS/prGsjm3VNlQWSXV 4asDgRvafSXAktcU91wnaMXjMQQgGvLQzmZoQY3SiL3tH+41oCnsBbuB/1y2YVbyfsBp acNA== 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:cc:to :from:dkim-signature; bh=gCpSGaH9k9PWhr0Z9u8fR2+dVNRNKa0vVi8uRr2Kuvg=; b=UvC73y2buLE3pFENJ4vNnJH5T6QMxYXtyZW4ejqkTBI6a2wxmEbRqliFT3IevtRIqj fSp4PaL7DH2v0W9u/a/4DeTbAd4eczKxlkEcD9/Ar65BDjzj6ZccbcrLI4fmE16DKa0I eao6OxOCbv8XHEWlyvStK+YG4d/s/ttKb32fnnxdjw3oTKNJlqkXJGwqtJp24x8IzdAi up30a+suiz5SrZRN0OJm6vwE7y6LwIG8Oc9b0L+UNd1Ub/uQ7YKMLm7YjQ5cRohGEkpr tprJHb+/nQLqb55yuuCAz5835hdohXEbzgQQWBgWpoVX5r1BKfqXxCCegK2xXIjjkDui RZZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Psu97blz; 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 bl23-20020a05620a1a9700b006bbe7dedb57si467237qkb.439.2022.09.27.03.14.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 27 Sep 2022 03:14:13 -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=pass header.i=@linaro.org header.s=google header.b=Psu97blz; 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]:43768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1od7bP-0001t8-TR for patch@linaro.org; Tue, 27 Sep 2022 06:14:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40110) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1od7aB-0000wC-R9 for qemu-devel@nongnu.org; Tue, 27 Sep 2022 06:12:55 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]:40583) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1od7a8-0002Wi-JZ for qemu-devel@nongnu.org; Tue, 27 Sep 2022 06:12:55 -0400 Received: by mail-wr1-x429.google.com with SMTP id x18so14203881wrm.7 for ; Tue, 27 Sep 2022 03:12:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=gCpSGaH9k9PWhr0Z9u8fR2+dVNRNKa0vVi8uRr2Kuvg=; b=Psu97blzdsnye9goX9eqqYWBeEpeId+OBpZCTlEAIV73WaOzcKpUHfrXZ4rZEoFyE2 EWlWHVNrR8fQAK75vFldmJlYYhkP8OnLvJNSShB2YfLelX0MHjcxe5SXF+whVEjnmbUG bRzlFh9TB7lZvlE5jsotXr0+K2IbUW8oj533VcqPPQeLKdcANaBj5uWRNwZG34JfQsui ikLcJzKBcgw34gAfgqiwMiHrSlcusOjqiZ1UIvnQ98W/zJ8pg1uEr8kub5hMk29YuPtb tXQk+KxNTOvaYBEJw4ilE1BY6vYOW6EjP/YzgWAMJXIGz8KMmQiSw/FOCvlMbjC4u3Wc lOFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=gCpSGaH9k9PWhr0Z9u8fR2+dVNRNKa0vVi8uRr2Kuvg=; b=mjfODUJ1pymaAhvl7IXCVJ5kjMmk3PvGPpZXpNwhQaSdhAPG+6bi+4M3pjacsbz9AJ 5zjC0vf0wC40GLy2yRWzgJSvtE3Efq+95JsDCJI8Kqs0pYU5SfQzP6W7AP3VpqD0vL8z QPSi27ogYtmoFskOdecp0EUPZ4vBOXxsxeFsagq5gL7M2zfftjmr35gDVq7WwWQetmzg V5FDBFsGqWr+clKaFG/6pVxnDt3D81d893Y+djFI9GmyFYy5ZQOw+HzsNluNJNNwbj1l ruKS23ixERRptn9SgjqfupqqqYKxdAbrVA8NkhrN6sta/RdjH2b0ZyL0oXVJs94SMjc4 C7BQ== X-Gm-Message-State: ACrzQf3JTQfo7F2pbYuJp94VntGAZjkcUT+S5/EkafDFaRu4QllsxFzJ g7Ro6uXFkFPKCrNLFXd7HFNEug== X-Received: by 2002:a05:6000:15c5:b0:22a:49c2:4c58 with SMTP id y5-20020a05600015c500b0022a49c24c58mr15991749wry.362.1664273571139; Tue, 27 Sep 2022 03:12:51 -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 w6-20020adfd4c6000000b00223b8168b15sm1398387wrk.66.2022.09.27.03.12.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Sep 2022 03:12:50 -0700 (PDT) From: Jean-Philippe Brucker To: peter.maydell@linaro.org Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, robh+dt@kernel.org, Jean-Philippe Brucker Subject: [PATCH v2 7/8] hw/arm/virt: Fix devicetree warnings about the virtio-iommu node Date: Tue, 27 Sep 2022 11:03:48 +0100 Message-Id: <20220927100347.176606-8-jean-philippe@linaro.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220927100347.176606-1-jean-philippe@linaro.org> References: <20220927100347.176606-1-jean-philippe@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=jean-philippe@linaro.org; helo=mail-wr1-x429.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.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" The "PCI Bus Binding to: IEEE Std 1275-1994" defines the compatible string for a PCIe bus or endpoint as "pci," or similar. Since the initial binding for PCI virtio-iommu didn't follow this rule, it was modified to accept both strings and ensure backward compatibility. Also, the unit-name for the node should be "device,function". Fix corresponding dt-validate and dtc warnings: pcie@10000000: virtio_iommu@16:compatible: ['virtio,pci-iommu'] does not contain items matching the given schema pcie@10000000: Unevaluated properties are not allowed (... 'virtio_iommu@16' were unexpected) From schema: linux/Documentation/devicetree/bindings/pci/host-generic-pci.yaml virtio_iommu@16: compatible: 'oneOf' conditional failed, one must be fixed: ['virtio,pci-iommu'] is too short 'pci1af4,1057' was expected From schema: dtschema/schemas/pci/pci-bus.yaml Warning (pci_device_reg): /pcie@10000000/virtio_iommu@16: PCI unit address format error, expected "2,0" Signed-off-by: Jean-Philippe Brucker --- hw/arm/virt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 2de16f6324..5e16d54bbb 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1372,14 +1372,15 @@ static void create_smmu(const VirtMachineState *vms, static void create_virtio_iommu_dt_bindings(VirtMachineState *vms) { - const char compat[] = "virtio,pci-iommu"; + const char compat[] = "virtio,pci-iommu\0pci1af4,1057"; uint16_t bdf = vms->virtio_iommu_bdf; MachineState *ms = MACHINE(vms); char *node; vms->iommu_phandle = qemu_fdt_alloc_phandle(ms->fdt); - node = g_strdup_printf("%s/virtio_iommu@%d", vms->pciehb_nodename, bdf); + node = g_strdup_printf("%s/virtio_iommu@%x,%x", vms->pciehb_nodename, + PCI_SLOT(bdf), PCI_FUNC(bdf)); qemu_fdt_add_subnode(ms->fdt, node); qemu_fdt_setprop(ms->fdt, node, "compatible", compat, sizeof(compat)); qemu_fdt_setprop_sized_cells(ms->fdt, node, "reg",