From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 694CEC48BDF for ; Fri, 18 Jun 2021 07:44:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 45F70613BA for ; Fri, 18 Jun 2021 07:44:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230315AbhFRHqR (ORCPT ); Fri, 18 Jun 2021 03:46:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbhFRHqR (ORCPT ); Fri, 18 Jun 2021 03:46:17 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AD01C061574 for ; Fri, 18 Jun 2021 00:44:08 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id n20so7326334edv.8 for ; Fri, 18 Jun 2021 00:44:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=xrVDbV297cRNejKsonngV4vGhbIFMI93Q9VE4px56sk=; b=DJrFso3Sd/PK31zGllWY1zpb+A/KUBtA1E8u5Qir0hsdifTQYSdRZW1U6CNektQcl7 8Gwsv7C1odv1jrBJeUaUkxlcjlp8X1pKeC2J+1DP3IUSv0CsFCITaq8JZc3WjTws7uPQ 4IxWmREr3j6FYQj+LSiYl4jQTvWE68g/xCWzMfT0kpokkoIFlm0HlOIaovz3NUm3XRbN wE7uyBGbqLDvxaWPAzFanMx77+YZjL556iOB0wbtNEUUYyaZWtg3ae9HJjDoNyKVy1IK fvCBuKgdbz3tUsMUMs1z8Q2cwdxKNYtxY/sI/BfDgxkDL/babYZa0vN5UhC3RLA+ilVb 2Qtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xrVDbV297cRNejKsonngV4vGhbIFMI93Q9VE4px56sk=; b=tPHNSfjzq9eCsZmaN/vxQzevE1qBzAyDJ5Y3/dpMVhjFfhfZU0BvVqBtb7zLhrS9na MhshgV0uKKMBNkeuR3nBOJavXPUITd52xV45mogdnj9QfICIRqm1NRUL48+E993PFOy8 J9vc07FADTZthrfEdiYGrV3yZ6KPoTXGtyEgzn9hSJnaFroGVWvJXb/14AzRjH6lloBw IelllvgyFpSzbpJsWwWRkR+KizW87ayIlTA5epb9OBzUCsm5fIjhkF+sXDG/gf8hQT9C xvtoNf98kYLPmWs+aiG9RDxs73eJc3tTFlCzb7sW0o2nvJEhU22EkHWmR4gJtdlVph/7 riwg== X-Gm-Message-State: AOAM531Sa+YDuBv+j9R63G8UkPKJ9AdmOy6njdZ4KuPxrePWjneckFGX +geNuQm7qQpjrAK1gPiQRXrOMQ== X-Google-Smtp-Source: ABdhPJzREIN0+D0Q7W8RSrNNQ4NDgbr/Euk9okd86tzehslscukuMpktyxR1ml4l0LZerVVX4xGYvQ== X-Received: by 2002:a05:6402:17d3:: with SMTP id s19mr1921993edy.222.1624002246807; Fri, 18 Jun 2021 00:44:06 -0700 (PDT) Received: from myrica (adsl-84-226-111-173.adslplus.ch. [84.226.111.173]) by smtp.gmail.com with ESMTPSA id cf26sm680470ejb.38.2021.06.18.00.44.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 00:44:06 -0700 (PDT) Date: Fri, 18 Jun 2021 09:43:47 +0200 From: Jean-Philippe Brucker To: Eric Auger Cc: rjw@rjwysocki.net, lenb@kernel.org, joro@8bytes.org, mst@redhat.com, will@kernel.org, catalin.marinas@arm.com, baolu.lu@linux.intel.com, dwmw2@infradead.org, linux-acpi@vger.kernel.org, iommu@lists.linux-foundation.org, virtualization@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, sebastien.boeuf@intel.com, robin.murphy@arm.com, kevin.tian@intel.com, lorenzo.pieralisi@arm.com, guohanjun@huawei.com, sudeep.holla@arm.com Subject: Re: [PATCH v4 3/6] ACPI: Add driver for the VIOT table Message-ID: References: <20210610075130.67517-1-jean-philippe@linaro.org> <20210610075130.67517-4-jean-philippe@linaro.org> <5a16c21f-ca02-1016-80e9-c374a6fe2b25@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5a16c21f-ca02-1016-80e9-c374a6fe2b25@redhat.com> Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Wed, Jun 16, 2021 at 03:26:08PM +0200, Eric Auger wrote: > > + default: > > + pr_warn("Unsupported node %x\n", hdr->type); > > + ret = 0; > > + goto err_free; > > + } > > + > > + /* > > + * To be compatible with future versions of the table which may include > > + * other node types, keep parsing. > > + */ > nit: doesn't this comment rather apply to the default clause in the > switch. Yes, the comment doesn't accurately explain the code below, I'll tweak it. /* * A future version of the table may use the node for other purposes. * Keep parsing. */ > In case the PCI range node or the single MMIO endoint node does > not refer to any translation element, isn't it simply an error case? It is permissible in my opinion. If a future version of the spec appends new fields to the MMIO endpoint describing some PV property (I can't think of a useful example), then the table can contain the vIOMMU topology as usual plus one MMIO node that's only here to describe that property, and doesn't have a translation element. If we encounter that I think we should keep parsing. > > + if (!ep->viommu) { > > + pr_warn("No IOMMU node found\n"); > > + ret = 0; > > + goto err_free; > > + } > Besides > Reviewed-by: Eric Auger Thanks! Jean From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3895FC48BDF for ; Fri, 18 Jun 2021 07:44:13 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EC992613BD for ; Fri, 18 Jun 2021 07:44:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC992613BD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id AFB3183C9A; Fri, 18 Jun 2021 07:44:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CS9juz5z8PMA; Fri, 18 Jun 2021 07:44:11 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTPS id 9A26083C93; Fri, 18 Jun 2021 07:44:11 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E3297C0023; Fri, 18 Jun 2021 07:44:10 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id B2554C000B for ; Fri, 18 Jun 2021 07:44:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id A03FB40494 for ; Fri, 18 Jun 2021 07:44:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=linaro.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GJpqxiPrIJz2 for ; Fri, 18 Jun 2021 07:44:08 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by smtp4.osuosl.org (Postfix) with ESMTPS id A7B7240462 for ; Fri, 18 Jun 2021 07:44:08 +0000 (UTC) Received: by mail-ed1-x52e.google.com with SMTP id c7so6398762edn.6 for ; Fri, 18 Jun 2021 00:44:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=xrVDbV297cRNejKsonngV4vGhbIFMI93Q9VE4px56sk=; b=DJrFso3Sd/PK31zGllWY1zpb+A/KUBtA1E8u5Qir0hsdifTQYSdRZW1U6CNektQcl7 8Gwsv7C1odv1jrBJeUaUkxlcjlp8X1pKeC2J+1DP3IUSv0CsFCITaq8JZc3WjTws7uPQ 4IxWmREr3j6FYQj+LSiYl4jQTvWE68g/xCWzMfT0kpokkoIFlm0HlOIaovz3NUm3XRbN wE7uyBGbqLDvxaWPAzFanMx77+YZjL556iOB0wbtNEUUYyaZWtg3ae9HJjDoNyKVy1IK fvCBuKgdbz3tUsMUMs1z8Q2cwdxKNYtxY/sI/BfDgxkDL/babYZa0vN5UhC3RLA+ilVb 2Qtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xrVDbV297cRNejKsonngV4vGhbIFMI93Q9VE4px56sk=; b=dVCYRC2ldPAf5NmXJZollzlEcKy5WvUskD9Crj4FCdQxergPWZbhVjpDqMayX4Sfdb ea5UvNy94DFIwWIjS0KAQ/Y2uZqO5d7JwDtQLQW7ulBx4Y4O0DacBoaizj5ELU5gh8R5 AExBxxBzLSygn0sFNLr+jcpPlayT8zFtrsUBh007hl4/O4Xt2ibatLqxI/+A2DECksU/ Pikr85n19aFb762bgcw5wx4eM/iJxRoGJrWeIVmvDhvN88pSI3RnjxkWbKdg7ysOzY3C DI07Mwn8FboDNoEb/SPojUzdaz7sh30VTeV4kmEuOO7oenBTaCqetqLSazDztutuvo6H cVag== X-Gm-Message-State: AOAM531CtzFudKb1wY2bBveBOJAB7k6zUTKyJ0Sst+n5JgDoUVmusvmT OcJvvGUX1TLMiOAfTJvolAzr1A== X-Google-Smtp-Source: ABdhPJzREIN0+D0Q7W8RSrNNQ4NDgbr/Euk9okd86tzehslscukuMpktyxR1ml4l0LZerVVX4xGYvQ== X-Received: by 2002:a05:6402:17d3:: with SMTP id s19mr1921993edy.222.1624002246807; Fri, 18 Jun 2021 00:44:06 -0700 (PDT) Received: from myrica (adsl-84-226-111-173.adslplus.ch. [84.226.111.173]) by smtp.gmail.com with ESMTPSA id cf26sm680470ejb.38.2021.06.18.00.44.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 00:44:06 -0700 (PDT) Date: Fri, 18 Jun 2021 09:43:47 +0200 From: Jean-Philippe Brucker To: Eric Auger Subject: Re: [PATCH v4 3/6] ACPI: Add driver for the VIOT table Message-ID: References: <20210610075130.67517-1-jean-philippe@linaro.org> <20210610075130.67517-4-jean-philippe@linaro.org> <5a16c21f-ca02-1016-80e9-c374a6fe2b25@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5a16c21f-ca02-1016-80e9-c374a6fe2b25@redhat.com> Cc: kevin.tian@intel.com, mst@redhat.com, catalin.marinas@arm.com, sudeep.holla@arm.com, rjw@rjwysocki.net, robin.murphy@arm.com, virtualization@lists.linux-foundation.org, linux-acpi@vger.kernel.org, iommu@lists.linux-foundation.org, sebastien.boeuf@intel.com, guohanjun@huawei.com, will@kernel.org, dwmw2@infradead.org, linux-arm-kernel@lists.infradead.org, lenb@kernel.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Wed, Jun 16, 2021 at 03:26:08PM +0200, Eric Auger wrote: > > + default: > > + pr_warn("Unsupported node %x\n", hdr->type); > > + ret = 0; > > + goto err_free; > > + } > > + > > + /* > > + * To be compatible with future versions of the table which may include > > + * other node types, keep parsing. > > + */ > nit: doesn't this comment rather apply to the default clause in the > switch. Yes, the comment doesn't accurately explain the code below, I'll tweak it. /* * A future version of the table may use the node for other purposes. * Keep parsing. */ > In case the PCI range node or the single MMIO endoint node does > not refer to any translation element, isn't it simply an error case? It is permissible in my opinion. If a future version of the spec appends new fields to the MMIO endpoint describing some PV property (I can't think of a useful example), then the table can contain the vIOMMU topology as usual plus one MMIO node that's only here to describe that property, and doesn't have a translation element. If we encounter that I think we should keep parsing. > > + if (!ep->viommu) { > > + pr_warn("No IOMMU node found\n"); > > + ret = 0; > > + goto err_free; > > + } > Besides > Reviewed-by: Eric Auger Thanks! Jean _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38F38C48BE8 for ; Fri, 18 Jun 2021 07:44:13 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CC672613AA for ; Fri, 18 Jun 2021 07:44:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CC672613AA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=virtualization-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 81DFF40510; Fri, 18 Jun 2021 07:44:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wbseg155KIHP; Fri, 18 Jun 2021 07:44:11 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id DF64D40462; Fri, 18 Jun 2021 07:44:10 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 92A8CC000D; Fri, 18 Jun 2021 07:44:10 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6BD9AC000B for ; Fri, 18 Jun 2021 07:44:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 566EC605F6 for ; Fri, 18 Jun 2021 07:44:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=linaro.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CF2SkWmi5RlA for ; Fri, 18 Jun 2021 07:44:08 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by smtp3.osuosl.org (Postfix) with ESMTPS id 85917605F4 for ; Fri, 18 Jun 2021 07:44:08 +0000 (UTC) Received: by mail-ed1-x529.google.com with SMTP id b11so7341584edy.4 for ; Fri, 18 Jun 2021 00:44:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=xrVDbV297cRNejKsonngV4vGhbIFMI93Q9VE4px56sk=; b=DJrFso3Sd/PK31zGllWY1zpb+A/KUBtA1E8u5Qir0hsdifTQYSdRZW1U6CNektQcl7 8Gwsv7C1odv1jrBJeUaUkxlcjlp8X1pKeC2J+1DP3IUSv0CsFCITaq8JZc3WjTws7uPQ 4IxWmREr3j6FYQj+LSiYl4jQTvWE68g/xCWzMfT0kpokkoIFlm0HlOIaovz3NUm3XRbN wE7uyBGbqLDvxaWPAzFanMx77+YZjL556iOB0wbtNEUUYyaZWtg3ae9HJjDoNyKVy1IK fvCBuKgdbz3tUsMUMs1z8Q2cwdxKNYtxY/sI/BfDgxkDL/babYZa0vN5UhC3RLA+ilVb 2Qtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xrVDbV297cRNejKsonngV4vGhbIFMI93Q9VE4px56sk=; b=BkJFd16/tixETVyNYTCM6DdWxoR+V4M5c/j6tt/or3V+N3R0yrICS6wKh1o0l8UOeP xrDCiyefEu90R0KbMwsUJAWvk4/Lv23HY9AMWpqMcA3b+CnQz8935FYlzchxel1Jklr7 gfrwkciDD7UAcqBDuHtLyPYzf3fDQR0olEEOIjJMyqceOcZaqIRlGhyxCDSfU7h5g7N2 9GPH0Dj9HRIj7ZnfpxIAHjD/QJWmtOhZ96UAkZE7cpv5Rf4mYLbt/yzyO0RTf8efgsh4 k9ajONZE1lKnW83XaZxKj726AhoDBwQr4oO6lKjS1fXOXr6+oUmGMmv0e9uskmGkXjaJ lRYg== X-Gm-Message-State: AOAM532xO/wq9Kl9wCYY3DjGYmEUPSnUGvyDjnVdo3zYrBq79liaHXV/ c0iGGTJrk8IjQpyxOKzl8zE1Eg== X-Google-Smtp-Source: ABdhPJzREIN0+D0Q7W8RSrNNQ4NDgbr/Euk9okd86tzehslscukuMpktyxR1ml4l0LZerVVX4xGYvQ== X-Received: by 2002:a05:6402:17d3:: with SMTP id s19mr1921993edy.222.1624002246807; Fri, 18 Jun 2021 00:44:06 -0700 (PDT) Received: from myrica (adsl-84-226-111-173.adslplus.ch. [84.226.111.173]) by smtp.gmail.com with ESMTPSA id cf26sm680470ejb.38.2021.06.18.00.44.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 00:44:06 -0700 (PDT) Date: Fri, 18 Jun 2021 09:43:47 +0200 From: Jean-Philippe Brucker To: Eric Auger Subject: Re: [PATCH v4 3/6] ACPI: Add driver for the VIOT table Message-ID: References: <20210610075130.67517-1-jean-philippe@linaro.org> <20210610075130.67517-4-jean-philippe@linaro.org> <5a16c21f-ca02-1016-80e9-c374a6fe2b25@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5a16c21f-ca02-1016-80e9-c374a6fe2b25@redhat.com> Cc: lorenzo.pieralisi@arm.com, mst@redhat.com, catalin.marinas@arm.com, joro@8bytes.org, sudeep.holla@arm.com, rjw@rjwysocki.net, robin.murphy@arm.com, virtualization@lists.linux-foundation.org, linux-acpi@vger.kernel.org, iommu@lists.linux-foundation.org, sebastien.boeuf@intel.com, guohanjun@huawei.com, baolu.lu@linux.intel.com, will@kernel.org, dwmw2@infradead.org, linux-arm-kernel@lists.infradead.org, lenb@kernel.org X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" On Wed, Jun 16, 2021 at 03:26:08PM +0200, Eric Auger wrote: > > + default: > > + pr_warn("Unsupported node %x\n", hdr->type); > > + ret = 0; > > + goto err_free; > > + } > > + > > + /* > > + * To be compatible with future versions of the table which may include > > + * other node types, keep parsing. > > + */ > nit: doesn't this comment rather apply to the default clause in the > switch. Yes, the comment doesn't accurately explain the code below, I'll tweak it. /* * A future version of the table may use the node for other purposes. * Keep parsing. */ > In case the PCI range node or the single MMIO endoint node does > not refer to any translation element, isn't it simply an error case? It is permissible in my opinion. If a future version of the spec appends new fields to the MMIO endpoint describing some PV property (I can't think of a useful example), then the table can contain the vIOMMU topology as usual plus one MMIO node that's only here to describe that property, and doesn't have a translation element. If we encounter that I think we should keep parsing. > > + if (!ep->viommu) { > > + pr_warn("No IOMMU node found\n"); > > + ret = 0; > > + goto err_free; > > + } > Besides > Reviewed-by: Eric Auger Thanks! Jean _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21E44C48BDF for ; Fri, 18 Jun 2021 07:45:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D6D4D61209 for ; Fri, 18 Jun 2021 07:45:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6D4D61209 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Qe0Eh2q/EWUht9a5xGPV3aVcw5GjA+veDaqagb/Ei9w=; b=Rgcc+74IpVuhKl 1VprwQz0fRhbDb+ez0JWfxCdNb2hB56T3Mhb9Boj5zyKPiBqlLalTfQXpPkpy2X3oUc9CjUX1r7qt XFspWk3LitFA8oMmmF5FukR4sODobHdCIhaa3PaH4tw4y9PL0uNmzIZ3gwoc1PIQRvHhCFW2wTnQs qcNgSUoEfjDBHNXjRvm3kag/056EgU+s2IsfOQOfnPhjWvlYrnIpLS4ajWQUQ5Dk3QvZ5RsdesEk2 1RYd398j6Xl5LA0cGcOgrF4nhHfzCGLibPDB5hoAFMeWJgISNJJxL2hHBZDGZXA0sh2NVs5y05UMa 9YLRn70PVdDn1EzAPe8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lu9Ai-00D7eM-Iq; Fri, 18 Jun 2021 07:44:12 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lu9Ae-00D7dK-Ht for linux-arm-kernel@lists.infradead.org; Fri, 18 Jun 2021 07:44:09 +0000 Received: by mail-ed1-x533.google.com with SMTP id t3so7322853edc.7 for ; Fri, 18 Jun 2021 00:44:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=xrVDbV297cRNejKsonngV4vGhbIFMI93Q9VE4px56sk=; b=DJrFso3Sd/PK31zGllWY1zpb+A/KUBtA1E8u5Qir0hsdifTQYSdRZW1U6CNektQcl7 8Gwsv7C1odv1jrBJeUaUkxlcjlp8X1pKeC2J+1DP3IUSv0CsFCITaq8JZc3WjTws7uPQ 4IxWmREr3j6FYQj+LSiYl4jQTvWE68g/xCWzMfT0kpokkoIFlm0HlOIaovz3NUm3XRbN wE7uyBGbqLDvxaWPAzFanMx77+YZjL556iOB0wbtNEUUYyaZWtg3ae9HJjDoNyKVy1IK fvCBuKgdbz3tUsMUMs1z8Q2cwdxKNYtxY/sI/BfDgxkDL/babYZa0vN5UhC3RLA+ilVb 2Qtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xrVDbV297cRNejKsonngV4vGhbIFMI93Q9VE4px56sk=; b=PVgSLCmFzBZp0oU9aXuEXnOEfT4A2ZmxcB0KntkZHecN5CDkg0P8yHkYbrIl0lvhV6 5FYZMQpAZxzX8+JvD5ZTxhTnRd7Q8FhKEj3w0qKseI5DypIGM2phqyGwqcStPbptI3n8 0AWn2JHmJdOWBIBwANjSwOJT4rLex7/WXblImVqmSzfBwYmNwsOvNFwmxHeGOfB2Q9ck OECY5mSRSuFxJ0FCzg/UKf2BspadUpcNNppGUGm8jZxAxJLsv1oFUKORAAffv5wZmMJh fDU05JqXQMsYQUd2LdO2fIMvgBk/NrjQ/e1lKveTSbFZ5gZS6loUJeeAf87q5C2nVReI pWsg== X-Gm-Message-State: AOAM532hZGcJWy5fG+/kGHBlB/SJRtrPmpa21NZf2U/1DnBc6g8Pqa/M Xwiv6ecxmOL7XUCHgK9BaNthkw== X-Google-Smtp-Source: ABdhPJzREIN0+D0Q7W8RSrNNQ4NDgbr/Euk9okd86tzehslscukuMpktyxR1ml4l0LZerVVX4xGYvQ== X-Received: by 2002:a05:6402:17d3:: with SMTP id s19mr1921993edy.222.1624002246807; Fri, 18 Jun 2021 00:44:06 -0700 (PDT) Received: from myrica (adsl-84-226-111-173.adslplus.ch. [84.226.111.173]) by smtp.gmail.com with ESMTPSA id cf26sm680470ejb.38.2021.06.18.00.44.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Jun 2021 00:44:06 -0700 (PDT) Date: Fri, 18 Jun 2021 09:43:47 +0200 From: Jean-Philippe Brucker To: Eric Auger Cc: rjw@rjwysocki.net, lenb@kernel.org, joro@8bytes.org, mst@redhat.com, will@kernel.org, catalin.marinas@arm.com, baolu.lu@linux.intel.com, dwmw2@infradead.org, linux-acpi@vger.kernel.org, iommu@lists.linux-foundation.org, virtualization@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, sebastien.boeuf@intel.com, robin.murphy@arm.com, kevin.tian@intel.com, lorenzo.pieralisi@arm.com, guohanjun@huawei.com, sudeep.holla@arm.com Subject: Re: [PATCH v4 3/6] ACPI: Add driver for the VIOT table Message-ID: References: <20210610075130.67517-1-jean-philippe@linaro.org> <20210610075130.67517-4-jean-philippe@linaro.org> <5a16c21f-ca02-1016-80e9-c374a6fe2b25@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <5a16c21f-ca02-1016-80e9-c374a6fe2b25@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210618_004408_652063_B258343B X-CRM114-Status: GOOD ( 17.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 16, 2021 at 03:26:08PM +0200, Eric Auger wrote: > > + default: > > + pr_warn("Unsupported node %x\n", hdr->type); > > + ret = 0; > > + goto err_free; > > + } > > + > > + /* > > + * To be compatible with future versions of the table which may include > > + * other node types, keep parsing. > > + */ > nit: doesn't this comment rather apply to the default clause in the > switch. Yes, the comment doesn't accurately explain the code below, I'll tweak it. /* * A future version of the table may use the node for other purposes. * Keep parsing. */ > In case the PCI range node or the single MMIO endoint node does > not refer to any translation element, isn't it simply an error case? It is permissible in my opinion. If a future version of the spec appends new fields to the MMIO endpoint describing some PV property (I can't think of a useful example), then the table can contain the vIOMMU topology as usual plus one MMIO node that's only here to describe that property, and doesn't have a translation element. If we encounter that I think we should keep parsing. > > + if (!ep->viommu) { > > + pr_warn("No IOMMU node found\n"); > > + ret = 0; > > + goto err_free; > > + } > Besides > Reviewed-by: Eric Auger Thanks! Jean _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel