From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 2002:a19:5205:0:0:0:0:0 with SMTP id m5csp1581905lfb; Fri, 27 Aug 2021 06:24:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcmwtdaGokjrZcfcFXPyP3fjZQBMZkL7dW0vDieDD9qZhmoIkrkIVtDZL+oqrJMejlaxea X-Received: by 2002:a17:906:ce24:: with SMTP id sd4mr9827130ejb.329.1630070693040; Fri, 27 Aug 2021 06:24:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630070693; cv=none; d=google.com; s=arc-20160816; b=f6/nqDPnW10dx+e4yDnCThyMmC4ncWL/WvuPZPc1+LG8SpdO9wojTB4hTjCnRQX/ON HXXREBtm9DHfTjg74J46miNRHrkbi+5asMzPXLfkZbpXwFGs42ZD7TXSMK5WwpUqEo3M ExuXRPNJVE+KeL3umoK0W2nDvZ55S7pW3UamAL3grk691yYgpdhn5+yarR3j6C5TvH5K Vpvquio0YN4zm7XvF34IK/rTkvs/a1/yLYV3IcFYluexcs0VvJH942FlmW01rCdqfCLJ Ol/ZavPSgxuWzPCW1ZwtMecYCgXNUAtiYSgPeQKKM9+w9vV3A11LwEvR5MYH/QVQbPVM 0lAg== 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:in-reply-to:content-disposition :mime-version:references:message-id:subject:to:from:date :dkim-signature; bh=IL0IhZ89qP0aP4cEleW4k8GTKxNWY73C+es1+kPwk0A=; b=WLUjYHezmsXAyFg0GBxdu9LDJ7e4P2nL+0drm9l1neXpWc40u6q+JMLZzHvFgkJA9U /U3xv6rVBwhyY1IV5HWDWMZYXzJrx0hWkq38Jh27W3lebC62mY7Rkb+majZsC3npmqCd O7rWRn7uj8br4sa3kevDKuLMYVH9HaETwUImMOX3WaiIGP+GmL8eI8FJkgPDJoLqjUYs vFNHtwnkQ5sA1U2tqieAQoZsBk8XGvHJUOs5N+duzlP+nRVLs3/4PP7esKIFuckuEoqL PmhmscbqoYUM7alx5zJxBI79LmWu9yyF8oRgvjrySEJA4tRHOtMR0L+y5C7E0OQvNyK6 vUYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=PoyJzcgP; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=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 s20si6112889edw.399.2021.08.27.06.24.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Aug 2021 06:24:53 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=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=PoyJzcgP; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJbqm-0000kr-2B for alex.bennee@linaro.org; Fri, 27 Aug 2021 09:24:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59234) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJbqR-0000j7-S1 for qemu-arm@nongnu.org; Fri, 27 Aug 2021 09:24:31 -0400 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]:41928) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJbqM-0000qJ-L0 for qemu-arm@nongnu.org; Fri, 27 Aug 2021 09:24:31 -0400 Received: by mail-wm1-x334.google.com with SMTP id c129-20020a1c35870000b02902e6b6135279so4394333wma.0 for ; Fri, 27 Aug 2021 06:24:25 -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=IL0IhZ89qP0aP4cEleW4k8GTKxNWY73C+es1+kPwk0A=; b=PoyJzcgPrlJ87BcQi8swMmF7BlfJd844Apw3LR68kMm/Av1hDvUGraBPqYDCgo89+P +AVZ6lBRpUu3Wdvg6NM559tQ5QDJ4hHkYcMlTYde2UYiOqueXafwSXOvk4rbP/NNwTKC G0K9Szg+D1m/hhXVUHxvOZV/sCxNl41D3ZyYZCF6jRg/kg5zerLpNsKAgpddSkXdg6K6 Ry/tQ+I0jPKpCwA73dU/T7k+EWSICRpvgsSZ108BtUbvKfPjmiddC49A1pDYFSzYcu+D 4B2AbfBMLUt6BKbAbpb0AIyQIqL5waq04C44cTHG+DkNIFKNV+jDQPpf7/ESS7ENTWFi Y9hA== 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=IL0IhZ89qP0aP4cEleW4k8GTKxNWY73C+es1+kPwk0A=; b=o7snW5etNCip1c5927GEut3Jk2xMaEeHx1w5FiffzbCIxw6IY8wt9TiKxRDexZpfIz 2/TpkdkERP8zTDhOeOwxF9hR/WtWtCY464/2bY/xBAa/tmBo1jpMZCit6Nm2+Oo0NLRu ddNDzpdZ0jG3of5sCyI33iMj5GwSSJUERx28qlFuDi3v9crcXs8H3r7rw5fZEsnCzpii /deQSHA4bsJOFyAU6WWDqQutlZSJwpjkOtyLuvThqkHisBy161vPOsS2dDUrXonKRIMh GfVeRxuYcGPjZ4xwzWYviAjhD2AAclZ9kc1bY4hTCrzLiMo+EH/Hysam5fvSHB6mfQF5 rQrQ== X-Gm-Message-State: AOAM531TECbbp1KLX0lotD/dD8NCsKSIL/qUP9K6eIMp24+2UnaUTwna PBQE8nlzmKvMFIpvt8EjOR1StQ== X-Received: by 2002:a7b:c405:: with SMTP id k5mr8871274wmi.87.1630070663958; Fri, 27 Aug 2021 06:24:23 -0700 (PDT) Received: from larix (19.11.114.78.rev.sfr.net. [78.114.11.19]) by smtp.gmail.com with ESMTPSA id n8sm5331351wmq.18.2021.08.27.06.24.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Aug 2021 06:24:23 -0700 (PDT) Date: Fri, 27 Aug 2021 15:26:33 +0200 From: Jean-Philippe Brucker To: Eric Auger Subject: Re: [PATCH 6/6] pc: Allow instantiating a virtio-iommu device Message-ID: References: <20210810084505.2257983-1-jean-philippe@linaro.org> <20210810084505.2257983-7-jean-philippe@linaro.org> <41720de5-ce29-dd79-2911-d974408af544@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41720de5-ce29-dd79-2911-d974408af544@redhat.com> Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=jean-philippe@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 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, RCVD_IN_SORBS_WEB=1.5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-arm@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, qemu-arm@nongnu.org, marcel.apfelbaum@gmail.com, pbonzini@redhat.com, imammedo@redhat.com Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: J3sr/R3w3jSI On Tue, Aug 17, 2021 at 04:11:49PM +0200, Eric Auger wrote: > Hi Jean, > > On 8/10/21 10:45 AM, Jean-Philippe Brucker wrote: > > From: Eric Auger > > > > Add a hotplug handler for virtio-iommu on x86 and set the necessary > > reserved region property. On x86, the [0xfee00000, 0xfeefffff] DMA > > region is reserved for MSIs. DMA transactions to this range either > > trigger IRQ remapping in the IOMMU or bypasses IOMMU translation. > > > > Although virtio-iommu does not support IRQ remapping it must be informed > > of the reserved region so that it can forward DMA transactions targeting > > this region. > > > > Signed-off-by: Eric Auger > > Signed-off-by: Jean-Philippe Brucker > > I think we need to handle the case where the end-user gets lost with > iommu options and use an invalid combination such as > > -M q35,iommu=on,int_remap=on,kernel_irqchip=off -device -device virtio-iommu-pci I guess that would be "-M q35,kernel_irqchip=off -device intel-iommu,intremap=on -device virtio-iommu-pci" I'll add the checks, similar to the one in x86_iommu_set_default(). > We may also document somewhere that the virtio-iommu-pci > does not support irq remapping as this may be an important limitation on x86. I'll mention it in the commit message, unless you had another place in mind? 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 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 6AEF3C432BE for ; Fri, 27 Aug 2021 13:26:10 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (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 B635760E93 for ; Fri, 27 Aug 2021 13:26:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B635760E93 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:37262 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJbs0-0001ym-Nt for qemu-devel@archiver.kernel.org; Fri, 27 Aug 2021 09:26:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJbqR-0000iS-C2 for qemu-devel@nongnu.org; Fri, 27 Aug 2021 09:24:31 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]:46958) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJbqM-0000qG-ON for qemu-devel@nongnu.org; Fri, 27 Aug 2021 09:24:29 -0400 Received: by mail-wm1-x32f.google.com with SMTP id m25-20020a7bcb99000000b002e751bcb5dbso4351815wmi.5 for ; Fri, 27 Aug 2021 06:24:25 -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=IL0IhZ89qP0aP4cEleW4k8GTKxNWY73C+es1+kPwk0A=; b=PoyJzcgPrlJ87BcQi8swMmF7BlfJd844Apw3LR68kMm/Av1hDvUGraBPqYDCgo89+P +AVZ6lBRpUu3Wdvg6NM559tQ5QDJ4hHkYcMlTYde2UYiOqueXafwSXOvk4rbP/NNwTKC G0K9Szg+D1m/hhXVUHxvOZV/sCxNl41D3ZyYZCF6jRg/kg5zerLpNsKAgpddSkXdg6K6 Ry/tQ+I0jPKpCwA73dU/T7k+EWSICRpvgsSZ108BtUbvKfPjmiddC49A1pDYFSzYcu+D 4B2AbfBMLUt6BKbAbpb0AIyQIqL5waq04C44cTHG+DkNIFKNV+jDQPpf7/ESS7ENTWFi Y9hA== 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=IL0IhZ89qP0aP4cEleW4k8GTKxNWY73C+es1+kPwk0A=; b=eMcKFF/N44ybulEIyu1ps4XhlVR/zPORo0xo1HNej277HO6n2fXV83khprlxAvWHRj S16d3/OctivAZuQXFZ1SXSS5PMFKpQAPEOdX0juJExBwr9zsTnmgOosJGyhl1J6cGZo/ OTKfprLsbg/NHOQ9ua5oUYR1im5n9n6w/OqC/TTFUYqIrbIPo1otvctgLfGozltncdw6 lphrpgjFfhd/2mYJoYX2GUh9JAN3Lgnz6GwZ/Oeqv9uTGS4hdzy6JveBDKveIY38bjBD p2VXvdwZ0/P3ZKzcwvzrKWDI+1pmufHp3Zjd8a4aeCREtHGUWmEnKBSD4nRhWnMS7B/B qqfQ== X-Gm-Message-State: AOAM533msZL524D0G3Unx/hIadxlUpDOTgvgTAdMG4Dth9SpcGwSfz6m pNzv6sns3jxEFyz05AvWxl1gww== X-Google-Smtp-Source: ABdhPJw+FN3a2trMN9sQYMO2l9BUUw0q9ezznNNYD8w9XGwgs/hgBIbp7UH4Kxwq04gkJcSC5qjG+Q== X-Received: by 2002:a7b:c405:: with SMTP id k5mr8871274wmi.87.1630070663958; Fri, 27 Aug 2021 06:24:23 -0700 (PDT) Received: from larix (19.11.114.78.rev.sfr.net. [78.114.11.19]) by smtp.gmail.com with ESMTPSA id n8sm5331351wmq.18.2021.08.27.06.24.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Aug 2021 06:24:23 -0700 (PDT) Date: Fri, 27 Aug 2021 15:26:33 +0200 From: Jean-Philippe Brucker To: Eric Auger Subject: Re: [PATCH 6/6] pc: Allow instantiating a virtio-iommu device Message-ID: References: <20210810084505.2257983-1-jean-philippe@linaro.org> <20210810084505.2257983-7-jean-philippe@linaro.org> <41720de5-ce29-dd79-2911-d974408af544@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <41720de5-ce29-dd79-2911-d974408af544@redhat.com> Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=jean-philippe@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 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, RCVD_IN_SORBS_WEB=1.5, 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.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, qemu-arm@nongnu.org, pbonzini@redhat.com, imammedo@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Tue, Aug 17, 2021 at 04:11:49PM +0200, Eric Auger wrote: > Hi Jean, > > On 8/10/21 10:45 AM, Jean-Philippe Brucker wrote: > > From: Eric Auger > > > > Add a hotplug handler for virtio-iommu on x86 and set the necessary > > reserved region property. On x86, the [0xfee00000, 0xfeefffff] DMA > > region is reserved for MSIs. DMA transactions to this range either > > trigger IRQ remapping in the IOMMU or bypasses IOMMU translation. > > > > Although virtio-iommu does not support IRQ remapping it must be informed > > of the reserved region so that it can forward DMA transactions targeting > > this region. > > > > Signed-off-by: Eric Auger > > Signed-off-by: Jean-Philippe Brucker > > I think we need to handle the case where the end-user gets lost with > iommu options and use an invalid combination such as > > -M q35,iommu=on,int_remap=on,kernel_irqchip=off -device -device virtio-iommu-pci I guess that would be "-M q35,kernel_irqchip=off -device intel-iommu,intremap=on -device virtio-iommu-pci" I'll add the checks, similar to the one in x86_iommu_set_default(). > We may also document somewhere that the virtio-iommu-pci > does not support irq remapping as this may be an important limitation on x86. I'll mention it in the commit message, unless you had another place in mind? Thanks, Jean