From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f66.google.com (mail-oo1-f66.google.com [209.85.161.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCC0134EEEA for ; Wed, 7 Jan 2026 17:51:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.66 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767808308; cv=none; b=uSpZKBV0Fo3d1SuO4lNPJOMxzylmeUxxFFf4mnynN+068CgE6KsnM9kPt6YkNQdJeLUuru4At6VBqWVOOlGtTA5xnRSL2WQR3Zyb1Y+77QT11S4ZSxdXSxKQVE8zm67Byz2cYwnBMNIzo/g1Afzs6KLa+6fAeSf5413peWa/EIQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767808308; c=relaxed/simple; bh=RcoDYlucZ66l2Sfv7PYDyJOdRnPBCeYpyqcCKNIchCE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eMwu/68LAOcXaWewmEwFTJKbkXEylZ7VBSTPAo6OkuXWTJgMC5rTiaXzbmhOGkLhEWVDKovoCJ3AWUA9xKPolRkGH+9uDODos3N/sbneq9+qKEfMhEaMEQsxGFDfE3NEwWySSg/0e0DdXYQhOiqVMk/V3abEBo3QYPEZDnj1S9k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=Ch1kgFCN; arc=none smtp.client-ip=209.85.161.66 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="Ch1kgFCN" Received: by mail-oo1-f66.google.com with SMTP id 006d021491bc7-657490df6f3so1174723eaf.2 for ; Wed, 07 Jan 2026 09:51:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1767808302; x=1768413102; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=/E5kiVoPjL6HPjfNbHsUE0ncuM+O4VtxgKzooyiAI6s=; b=Ch1kgFCNuj/o4cLx0yF/pnrhRx8vrnNMPxtTz9cLxuWBBjqRZll9ySnpVKSsEe09AB sRylTu41RhJDHf9whs3sVIPrEPZjHSQM8HNiN8PzowIhgWDWBFE6qZTN6H0sPv2qKSZ9 F5kfQhsiSyUV84F5NQOCCZyOo08k1SULFS1040re54QJ8s0i8cCocJg0msivVEZnU265 AVFU6p+WViRvu75vPMRjZOJXaRqmfqcLk8aO3IVLZ7qzdcCz2/vFPAPkLaSqU9v4SgdA VloVbvffGCRSxitUQM8VP9JY6FWIBsmOhtJ9+Qm1o14raCz8rLrh7brhpLhO1R9m4pCG 4yZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767808302; x=1768413102; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/E5kiVoPjL6HPjfNbHsUE0ncuM+O4VtxgKzooyiAI6s=; b=uixfaF6+dEQA2GHigkcVK9vyOWD2qTT9KgzwLPRaxTW88YTDhi90a7NMDHSHetf25f 15fFYzcl4JeuDeaMFbC/LZp+tpgh4fNN+vurv69ojQny07BDs4WNs8Bm39UnLqGbEPql 1fiuft+cKrsn89IMsuh5L1RF2+I+9QOoIydm4hMXD+QneNhHsXbEkwGgoELZeV2czq3P KQXGaAKWYGzJPYJUEC0wKZAfzftEmL10VdR+VlvQClN7eF573XhTDepytmYao80PC4jo Xmo9rw4tXDtQyyZb3I1lCwR4tIrgyPRMUiCsv67FKqYTSl51fQyoJESf0fOYZxFXLbNu 9YQQ== X-Forwarded-Encrypted: i=1; AJvYcCXvclTPHOFhJLMkhCmOFDmRsl9TkyJ1+zfg1TaDoRioYeOVhVuPXDhEgmhioNZplAn9kyVjBKOq3o1aX4g=@vger.kernel.org X-Gm-Message-State: AOJu0Yw/oCiQtOso9ctuh+vhYlX/zW+33SNq9OxdmJUeo1gGNIakL3Kr uFrGYcccwTt9dlYVNWKBNHeXUmDoBZ4c/9+ChoWW7YEVa5gNvSUHyNjVqObCwiLjKWw= X-Gm-Gg: AY/fxX7mUOKf/mH0hHPLGRcSvJP0QTYbb8nv/UVhc6X9RPi0liXuJp08QTaRwLuXGZE Vxwh6HcpPw0KVoFShFo8jIfpXWwkKwRfIMnAnIv6/kzGtNc4teI5jvVwInNteRSPUKCK0ZZVnxP /L2U6iuY4HIfOXHEvl8TPfVQjxb+9ZBg65fTK0frOCTB9Kl82kXKgf9MCVFCMkcbtm5jMa/vRWk Awh3RGR5aOGhZMKR6iMoOV43s2o6mFpT/x7OVYLuWs+xWKE4vy1ZJQyTHB7YFi/C88PklM0y3pj FEpdaoosJmntvfmphBZY4A/LUlq92xDNKTZVQyWZG59O3pJZlGkqIijQDbeUqaLaRJT8vO/whxu 6qBTDK87BaBt7eoZvNZcWCcepexEOMgWw1R+5DSA3NXo8/5nE3rcY048ufbQnNh/6vtAML18V5Q zZ5wepEj826e6X X-Google-Smtp-Source: AGHT+IE13osf5CjYyTbx4kUFVq9/wdcOC/ch/TW3ja8QBG6H6cD6+EWQcns0Lx1kzYLZNwCYibHqkw== X-Received: by 2002:a05:6820:2204:b0:659:9a49:8fe1 with SMTP id 006d021491bc7-65f54ed4064mr1332868eaf.14.1767808301928; Wed, 07 Jan 2026 09:51:41 -0800 (PST) Received: from localhost ([140.82.166.162]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-3ffa4de8cbfsm3524574fac.3.2026.01.07.09.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Jan 2026 09:51:41 -0800 (PST) Date: Wed, 7 Jan 2026 11:51:40 -0600 From: Andrew Jones To: Xu Lu Cc: Jason Gunthorpe , Zong Li , Tomasz Jeznach , joro@8bytes.org, Will Deacon , Robin Murphy , Anup Patel , atish.patra@linux.dev, Thomas Gleixner , alex.williamson@redhat.com, Paul Walmsley , Palmer Dabbelt , Alexandre Ghiti , iommu@lists.linux.dev, kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, linux-riscv , LKML Subject: Re: Question about RISCV IOMMU irqbypass patch series Message-ID: <20260107-dc4b5f1d879db9afb00a4a87@orel> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Jan 07, 2026 at 06:01:26PM +0800, Xu Lu wrote: > Hi Andrew, > > Thanks for your brilliant job on the RISCV IOMMU irqbypass patch > series[1]. I have rebased it on v6.18 and successfully passed through > a nvme device to VM. But I still have some questions about it. > > 1. It seems "irqdomain->host_data->domain" can be NULL for blocking or > identity domain. So it's better to check whether it's NULL in > riscv_iommu_ir_irq_domain_alloc_irqs or > riscv_iommu_ir_irq_domain_free_irqs functions. Otherwise page fault > can happen. Indeed. Did you hit the NULL dereference in your testing? > > 2. It seems you are using the first stage iommu page table even for > gpa->spa, what if a VM needs an vIOMMU? Or did I miss something? Unfortunately the IOMMU spec wasn't clear on the use of the MSI table when only stage1 is in use and now, after discussions with the spec author, it appears what I have written won't work. Additionally, Jason didn't like this new approach to IRQ_DOMAIN_FLAG_ISOLATED_MSI either, so there's a lot of rework that needs to be done for v3. I had had hopes to dedicate December to this but got distracted with other things and vacation. Now I hope to dedicate this month, but I still need to get started! Thanks, drew > > [1] https://lore.kernel.org/all/20250920203851.2205115-20-ajones@ventanamicro.com/ > > Best regards, > Xu Lu