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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 30595CCA46C for ; Fri, 16 Oct 2026 15:01:14 +0000 (UTC) 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=mzZj926dnJA+rXXp4YqYd9I/RNJ/XPFWVs/wQQ6/3bQ=; b=x5J8TtG9WOo/PH oUstnzcGCoPNVl/AWPnMUDp+kvNVG/NzE4n2t0lWfk7/AHxbuV44aooG/NcXuV8bvyenI3vO8rgzy p+xB20eRP4r3GNlbfbGl1ArO32EtRT6puUgpG8PNC4peD/JnFuk4FklPTq4SZ8EXiOORkLTsnJW8+ 4iUkn+jAzqMLgp0U5B9ZMNovX/r/rq3hfNUNAp/VPUjoRdgbdrENJjaRjG8EvYljsJ/3r7hsM4Lcz B2G0Nz6cLHDgMatvr9yUo/XMHCx6HYZic/37MHlIWnXHkMV74gMMt32/aGbailVcvAyl/hkY2pH1N ChPw9dDkX5McU66+0Qsw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xHjQV-00000003E8p-1Tby; Fri, 16 Oct 2026 15:00:55 +0000 Received: from mail-qv1-xf35.google.com ([2607:f8b0:4864:20::f35]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xHjQT-00000003E7u-1G0f for linux-riscv@lists.infradead.org; Fri, 16 Oct 2026 15:00:54 +0000 Received: by mail-qv1-xf35.google.com with SMTP id 6a1803df08f44-917b78dfe30so1119346d6.0 for ; Fri, 16 Oct 2026 08:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1792162852; x=1792767652; darn=lists.infradead.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=qAdHy+XfZaVWAHH+k3kEYHLQsWiJDDa9Am4rmLNBNPw=; b=iahrap8247jye3lY+WeYy/hvy1Wv8PDqjb6XI4vSw+QCXBhJPecVttjUf1W5/B+bzs c5ZtsDTLIg5qdoYg8dpbVsP/INs7CP20mNagLABZLiqGF2CWI4Ln4RC7v8iFUDYKKW1O ENgI/GbTwWfSd0iVTgvusYnvhLF661xU1uQ5fNkS+tc32hIQfjHdywjFeegX3xrOJioe gUjqsiH7kOaPrcXyqk41MqzDbui/TUy7vynHD4ccJw7A52iryq9nF1VF9ZkT1+N2LSNE cnvUDwpo2vOeqcEl8ikSDIDt2rM0qY/iJlnc6hqlH46vJuIZI/ArFJOxGyAFL9Gdy1ui H8gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792162852; x=1792767652; h=in-reply-to:content-disposition:content-type: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 :content-type; bh=qAdHy+XfZaVWAHH+k3kEYHLQsWiJDDa9Am4rmLNBNPw=; b=W07pSAByK0zThK/XQcJuQnaDLls+gT2/oJPUrsK6LPrTJY5cDlhHDdcaj/8FGeV//V xoH/Aqhfn/UxPX/fAkQqoiwJkE80OFlFWyhssgWI0qipHYfXvaKbEiInnAc8xvt3jIl2 hriubLy5AHqrO6vJJ9+Yy89KgFW/pkiv3l4MwuNc2b8fdCJLZ78KV2CfrrSTCxT3rUQH dxJVdlRJwxZPudyvoIimAZcimVY3BVqMurAkS/MD6ifAX4KM1eti/+pNLwAG/nmC+aOM rorQSn6A3KH0LlGbS7c5mn/C/hI+LPnI+vXZVRKLL9fawSB/Jqk4I3nCKJmompDQmEcc WdKA== X-Forwarded-Encrypted: i=1; AKwUvBwV3FQAZ1j1GuDHoZ4whHdNMqaBfZGJsc5ialA8/qFRQAMJLNM/P/HWAAIw9NVfsQH4+etCzAR4JuvSXw==@lists.infradead.org X-Gm-Message-State: AFq9FYIYpGEjjpDcJr6TShqD6zO8qJOtUE1L2liq6GUnBw+fTryJ3MVC xkpRF6etwjnpnPTrVLFcbjOVnwlsCGywRt4ni1wDy4keO7yApZy+fYRTb3joWwy6OoUKHBUpL4c rMmS3 X-Gm-Gg: AYBFou1ZYCttHqvAR+HifpXhMXVggVpkhetgB1ajb7MM2HGoRhawhVwzE+US7BZTA1C O/Om67+RhqRCr3faiTuWTyC5A9YvWA4c5wG7jguUx8PH8bQsIzS32fOuPRX5cq/a4GUxhZHZl7k 918P1Ba2YIDSwzlKWKW38Bboj72h9Sq6ucn0aXOjcV0/k3L+9DNCvHrE1n6HmcMpOGsoqCKDscq uNZC8oP9yivJuIFepAURBY9IFpaFcXsO8KdBJTVoxTOlSRgSLPVuwTiPOrZMq43wxzSUa3SrtEg tqc3wWrSjHAKTv3NujTPS+lINjVV5sy6kOB9XYGK/62Mk+HbE+WCXk4DUOBQzcfXQTuXNTioxAc hvIIlYJbE1ZIfmGXsAqLaOoZHTRX7sa/uyPzcihzozXm0biTvcxfn4EDdukTit9BggQu1JHvCMu bpNmT2kQ4gLcUVeB/aANte1AOCbh+oQwdBb+W6APlf3vIj4yIvjFKWYlFexux0gL3YvYPPy2EWo q43FgMRYjZ1SNy6VosNq0+Y5YjL+vsMxPvPFAfBCM5yxxXUoiVgoerT X-Received: by 2002:a05:620a:40c3:b0:93e:646c:9133 with SMTP id af79cd13be357-93f29da5d84mr10749685a.64.1792162851675; Fri, 16 Oct 2026 08:00:51 -0700 (PDT) Received: from ziepe.ca (hlfxns010zw-159-2-239-150.pppoe-dynamic.high-speed.ns.bellaliant.net. [159.2.239.150]) by smtp.gmail.com with ESMTPSA id af79cd13be357-93f1a0d0718sm232558985a.5.2026.10.16.08.00.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Oct 2026 08:00:50 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1xHjQP-00000001teG-31SO; Fri, 16 Oct 2026 12:00:49 -0300 Date: Fri, 16 Oct 2026 12:00:49 -0300 From: Jason Gunthorpe To: Gong Shuai Cc: alex@ghiti.fr, andrew.jones@oss.qualcomm.com, anup@brainfault.org, aou@eecs.berkeley.edu, atish.patra@linux.dev, fangyu.yu@linux.alibaba.com, gsh517025@gmail.com, iommu@lists.linux.dev, joro@8bytes.org, kevin.tian@intel.com, kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, palmer@dabbelt.com, pbonzini@redhat.com, pjw@kernel.org, robin.murphy@arm.com, seanjc@google.com, tomasz.jeznach@linux.dev, will@kernel.org, wu.fei9@sanechips.com.cn, zhao.qingye@sanechips.com.cn Subject: Re: [RFC PATCH 02/12] iommufd: Add RISC-V IOMMU hwpt and vIOMMU types Message-ID: <20261016150049.GG14213@ziepe.ca> References: <20261015235400.GZ14213@ziepe.ca> <20261016073020.10119-1-gong.shuai@sanechips.com.cn> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20261016073020.10119-1-gong.shuai@sanechips.com.cn> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261016_080053_351807_D8948618 X-CRM114-Status: GOOD ( 12.38 ) X-BeenThere: linux-riscv@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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Fri, Oct 16, 2026 at 03:30:20PM +0800, Gong Shuai wrote: > Hi Jason, > > Thank you for your review. > > > > +/** > > > + * struct iommu_hwpt_riscv - RISC-V IOMMU stage-1 page table data > > > + * (IOMMU_HWPT_DATA_RISCV_S1) > > > + * @tc: Guest device context translation control > > > + * @iosatp: Guest device context stage-1 root page table pointer > > > + */ > > > +struct iommu_hwpt_riscv { > > > + __aligned_u64 tc; > > > + __aligned_u64 iosatp; > > > +}; > > > > Like the others you need a spec reference explaining exactly what > > these fields are. > > I'll add references to the device-context sections of the RISC-V IOMMU > specification ("Leaf DDT entry", "Device-context fields", "Translation > control (tc)", and "First-Stage context (fsc)"), and I'll also include > detailed field information, as ARM does. > > Also, I'll rename the field from iosatp to fsc. It holds iosatp when > PDTV=0 and process-directory-table pointer (pdtp) when PDTV=1, and the > two share the same layout, so the name should cover both interpretations > and the uAPI won't need to change when Process-Directory-Table (PDT) > support is added. You might be better off just to have a data[] array of the device context. I prefer the fields are not parsed out in userspace.. Future specs may add more guest controlled bits and in other places? Jason _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (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 0A023380FD8 for ; Fri, 16 Oct 2026 15:00:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792162854; cv=none; b=j+LE+nzQZVb5RMTpQA4SaONCaAocIAbfgXsDczZm+wQkDK25rdwuKj96Z0qfSuixC7vpooUwAKJ9pNViZpLqdxN51WUE/l18ny+c6XUsrrD30ejXsxVDWX7TMDKruj1giNDMv70AQvAhhFvMP0tSFKeZeSixPSMtOOPBDPdwo6I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792162854; c=relaxed/simple; bh=X82haFxsdgKx1jjnaKgCGlknhRGQInX8s7YpCkTIPnA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=trlgTDNZ00mLZ+On5ROMwjbFJCBLKjxPaLanFCjbEruxQ3Z/rRkYwWKaqas/4yysGSqPxsHSUPw+LsNMci1qYvbAaEB96suc+VSRKv2DKdOm4WSCprRuDuBZbIvtN/RkTJEX1n//HHNFRJO9n+yxt455ltV1i0qd1n/fQcezUbo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=WHm948by; arc=none smtp.client-ip=209.85.222.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="WHm948by" Received: by mail-qk1-f181.google.com with SMTP id af79cd13be357-93f269e335eso3183385a.3 for ; Fri, 16 Oct 2026 08:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1792162852; x=1792767652; darn=lists.linux.dev; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=qAdHy+XfZaVWAHH+k3kEYHLQsWiJDDa9Am4rmLNBNPw=; b=WHm948byIcPdCjYc043C6WxQQcvoGdixAaJOtAG+gG0b9WAm3EACHzM3foekLtv4sN qpvVTxNB99sBKP4Q+b4eqtLj+RtBV65x01jGRbOCdhd3dx1otFdUYgbabrK+LQzLGK9c 6fLXOECH64N7NlFkJQsmsn5RsMojqJZcJtxTRhXCt3imEvmrGEp6vllwJRFfOIGsUo53 IOuZdkGg8rNKCUndvl30st4Q5DXa1hkDZzJKZavBoNSxZ2fjpSqL5ae5zxaBRif9QrHu GRogpPfSrWXhrmkRinjAA9KABZ7QloJWDsEQrw5HjZh4CY1BLeyMrUA8sjnjVaTa+sAv iaKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792162852; x=1792767652; h=in-reply-to:content-disposition:content-type: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 :content-type; bh=qAdHy+XfZaVWAHH+k3kEYHLQsWiJDDa9Am4rmLNBNPw=; b=snpa+/FUVH2Cjc+OoyDbLxE1ezLH1WGO6jzXCU+Tu4Vu+1SUfBwWG2kLcEu+82KsTJ nnz9dTRAYURet9ncuOyM85A0rZHeb4bpBqV6Ov/RisV/QKY4GPZ7Iu5vkXhdZ64go3be h3OlHc9kDBdTM412TGFhB9rWZL+8bMw2yvqZFqXiuRgYOFsVDL+PYLCg3nq4XHgfo9Ef Fg4lccu3PBHwh3Jxa4+x6oOTruQGE7/0kip4jQsH7ivfo+cjyrvq/xknxEfagKvxOAlf fdcYsY6h2dk+ORHSLaPgdcmCNAWKhGZdJtcaSZ5ZVRDm9ed2E5mgXju1qiYU7t9zI0rO RssQ== X-Forwarded-Encrypted: i=1; AKwUvByf1Y2p2woKOTNSJaC1j8gjpUGEQGEj1qjj9ctSuqMTB7UxfA8JyYg9Xlw5US5PsifOvtWDjw==@lists.linux.dev X-Gm-Message-State: AFq9FYLs+/D3wfs8Lstc24uv9IB/GrDuZQlc7eSYwPfvng39ZXbQgKpb L1wFDKFSKmLafxMTcqouznGNjHdO0uXm9a88hSFx7olwJzL7SJ2kZ+OC0c1ICU/cFGw= X-Gm-Gg: AYBFou3Tst2au5biwLRagNWSPDD46zhVYYAZB5D65PJIibRBHI+SrNruq8KGDad4fXN okHP1tESavOQP2fzdNTS1QT5RhJl4Rvl/1RK3By8+HK2vJ3ic3plqw31ZOKVS/8TrXP0v+BJnM5 vZxzru9/KuuN68n09ksJCv7eeb0+RlFg5uM/LUWH2DfpSsI1U2ETGZJKFXY3M8LX4jBsoY9IceY XP7h8Z5pJp/RVZZRBpL3U62tl137IKQqBFjgcTx9LR4GArMi647xogv7Gik99uKqZVsIWMrvjeZ GFqRl/Bkopqxg15hxyPWC2Vqx0/0n3/sESkfmIlb1bv8V1lJ5piHmGr3IzxQnTAJWk113H+ea1y I5lg8mHuLTITKfxUFEe7qLZRx61RpKgkyM6lnApbXB2msMGpYjVgdPZcvprCBEVESq8J+NrOe7g zmSiYeRDG0haTskAs1kDXcXHbf3k7/vnjycPetBm/WpzbBQJugFKl+6CbFVpUMpbw86XBAWC/yp HCw/Qihwhu7DYRWt5Ig+piCP0Nb2jnduv+chK39tRZn+0ZcwMtLYteu X-Received: by 2002:a05:620a:40c3:b0:93e:646c:9133 with SMTP id af79cd13be357-93f29da5d84mr10749685a.64.1792162851675; Fri, 16 Oct 2026 08:00:51 -0700 (PDT) Received: from ziepe.ca (hlfxns010zw-159-2-239-150.pppoe-dynamic.high-speed.ns.bellaliant.net. [159.2.239.150]) by smtp.gmail.com with ESMTPSA id af79cd13be357-93f1a0d0718sm232558985a.5.2026.10.16.08.00.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Oct 2026 08:00:50 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1xHjQP-00000001teG-31SO; Fri, 16 Oct 2026 12:00:49 -0300 Date: Fri, 16 Oct 2026 12:00:49 -0300 From: Jason Gunthorpe To: Gong Shuai Cc: alex@ghiti.fr, andrew.jones@oss.qualcomm.com, anup@brainfault.org, aou@eecs.berkeley.edu, atish.patra@linux.dev, fangyu.yu@linux.alibaba.com, gsh517025@gmail.com, iommu@lists.linux.dev, joro@8bytes.org, kevin.tian@intel.com, kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, palmer@dabbelt.com, pbonzini@redhat.com, pjw@kernel.org, robin.murphy@arm.com, seanjc@google.com, tomasz.jeznach@linux.dev, will@kernel.org, wu.fei9@sanechips.com.cn, zhao.qingye@sanechips.com.cn Subject: Re: [RFC PATCH 02/12] iommufd: Add RISC-V IOMMU hwpt and vIOMMU types Message-ID: <20261016150049.GG14213@ziepe.ca> References: <20261015235400.GZ14213@ziepe.ca> <20261016073020.10119-1-gong.shuai@sanechips.com.cn> Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261016073020.10119-1-gong.shuai@sanechips.com.cn> On Fri, Oct 16, 2026 at 03:30:20PM +0800, Gong Shuai wrote: > Hi Jason, > > Thank you for your review. > > > > +/** > > > + * struct iommu_hwpt_riscv - RISC-V IOMMU stage-1 page table data > > > + * (IOMMU_HWPT_DATA_RISCV_S1) > > > + * @tc: Guest device context translation control > > > + * @iosatp: Guest device context stage-1 root page table pointer > > > + */ > > > +struct iommu_hwpt_riscv { > > > + __aligned_u64 tc; > > > + __aligned_u64 iosatp; > > > +}; > > > > Like the others you need a spec reference explaining exactly what > > these fields are. > > I'll add references to the device-context sections of the RISC-V IOMMU > specification ("Leaf DDT entry", "Device-context fields", "Translation > control (tc)", and "First-Stage context (fsc)"), and I'll also include > detailed field information, as ARM does. > > Also, I'll rename the field from iosatp to fsc. It holds iosatp when > PDTV=0 and process-directory-table pointer (pdtp) when PDTV=1, and the > two share the same layout, so the name should cover both interpretations > and the uAPI won't need to change when Process-Directory-Table (PDT) > support is added. You might be better off just to have a data[] array of the device context. I prefer the fields are not parsed out in userspace.. Future specs may add more guest controlled bits and in other places? Jason 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id F1A36CCA46C for ; Fri, 16 Oct 2026 15:00:55 +0000 (UTC) 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=a2RtSq9M8PG8M8wtV8ybRecmp4ZVqJeDhQMHxX+8bK8=; b=uKO9UfYuHbBTWU HgQ+70kpn+B3/zrTUJZxAwwfZf04XEoe0JaY7cOHVB0voOi41NyX/vv2GGu2/kmGFOlDtfQhRlToN cQ03LsIxX7Lx5/2Is5qpntoCazDLWH8yz2w5fOs/EdNXmb0Vu0eWaGIU3HRJzL+8tg7xut3crY1ln 6CXdTNpRZMmWtfo31HWMEVSM6BLfCMktpJv3fOsrHMBLkEKejeBeOOryDeBHCKh3HHyeUeC4ojsWU VFUv2TegZR5QHTrKOjk/Bg8AVWUajDjHgtTioFaBijdos0s8lJ1ztYiW+kvUblQkU3IL78xNCrS21 5Vp0j8LYz9L6MlqaP8wg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1xHjQV-00000003E8t-1mAH; Fri, 16 Oct 2026 15:00:55 +0000 Received: from mail-qk1-x729.google.com ([2607:f8b0:4864:20::729]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1xHjQT-00000003E7v-1Fiy for kvm-riscv@lists.infradead.org; Fri, 16 Oct 2026 15:00:54 +0000 Received: by mail-qk1-x729.google.com with SMTP id af79cd13be357-93e706a6ba9so3904985a.2 for ; Fri, 16 Oct 2026 08:00:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1792162852; x=1792767652; darn=lists.infradead.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=qAdHy+XfZaVWAHH+k3kEYHLQsWiJDDa9Am4rmLNBNPw=; b=iahrap8247jye3lY+WeYy/hvy1Wv8PDqjb6XI4vSw+QCXBhJPecVttjUf1W5/B+bzs c5ZtsDTLIg5qdoYg8dpbVsP/INs7CP20mNagLABZLiqGF2CWI4Ln4RC7v8iFUDYKKW1O ENgI/GbTwWfSd0iVTgvusYnvhLF661xU1uQ5fNkS+tc32hIQfjHdywjFeegX3xrOJioe gUjqsiH7kOaPrcXyqk41MqzDbui/TUy7vynHD4ccJw7A52iryq9nF1VF9ZkT1+N2LSNE cnvUDwpo2vOeqcEl8ikSDIDt2rM0qY/iJlnc6hqlH46vJuIZI/ArFJOxGyAFL9Gdy1ui H8gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1792162852; x=1792767652; h=in-reply-to:content-disposition:content-type: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 :content-type; bh=qAdHy+XfZaVWAHH+k3kEYHLQsWiJDDa9Am4rmLNBNPw=; b=VxDLqFGaDWJGAO7Q5pD5Fshcz5okVlbxLusDUzdCjBj4hdJBLCvbMpJE7y0ckVGvtr lG25Et/1OvvRVm7XtZAN7WsFrUYwZ1DXboyxyd5GDVaZW6DFs3pWy9xV1kg7S4MjFe9x 26kYSpUtZcu1sRDeNV+2WoFlaBEO/X9uqt8QnPHfgwSwROdFn7hfrE90/fUX0q7txv5R UrmP2C2oioHlmWESc5t31W+H64OoYZhE7DnT4gYBjrJhzmT5hvFawI4Pup2XtrfhgN8t qWptfMlYxU8vKXewB1/ueZno8DDQCD/k1niGfiKlb7TEzaq9mrOz0njggkm1EY8Ttr7S ZBmg== X-Forwarded-Encrypted: i=1; AKwUvBwotB9826EQ/F5ILR0O3HFhHbR2kod6WXz2MATtRVx7rbi4hBmI355P6nxmJ0p0GuSJ4TN8vbuXaCM=@lists.infradead.org X-Gm-Message-State: AFq9FYKCrC1pvZcEkRAlWGkBfz+EgwFqhuzHw7VxmRsZhbyfbXoCKrcu yNeNCqWQTrScWtBRk5NLHYeT/tsbPTHo4ble3Xu3s1JlT+zn1RXBR/XhfOs4nInnzKQ= X-Gm-Gg: AYBFou22fJ5bzQdmBZnDXUeG93Z4oQW5fPJh7tL7u+HgqdSAC+8lYIzIMF+uJoIf2HN PfugeeW1woyBshH1SVdrJxvezfjR2BLz9JCKfPOkHQMlrRPOWX5V6WayQKWql3h9yVtoG+/x1m7 Gw0F3zEWU53A1LgB1USo1wSzigrXzRvcyZf5szISsx6cR1qmQezjuxe6qQlau13CzE+SlTQoEB7 0NLZFH58ShVDPjiJ+944T/K60Z/xlmdmmrwSIOowb7Zh4qiADRRfsPo7y1N1CpMyIouWAzKf4VK 9mUwx8e7ZAXATszBAAMcoKrj6T8CxVZdhRcke6mrs3QIC3LxVSy0/DqI7AQ2VLrzBKNoChOtaF4 xrlKaB0FEjm5uJTif2QbqgqN5eYahP1sMV604WedBO+KqBiFAUQ1xflRVsixHBdjhg+5CRNXF78 857xzY+Bkm+yjsEBfo4dbXkbyaQEgaHK2JfKtzq4a0ExzzZlwrnt1gZe0BJkvSdAIXBasC7t3Ca /ksF8gAd7DolDfn4Bq0sx8O6zhK8DVGG+tANrz9Pl+jqDpfvDqKly1p X-Received: by 2002:a05:620a:40c3:b0:93e:646c:9133 with SMTP id af79cd13be357-93f29da5d84mr10749685a.64.1792162851675; Fri, 16 Oct 2026 08:00:51 -0700 (PDT) Received: from ziepe.ca (hlfxns010zw-159-2-239-150.pppoe-dynamic.high-speed.ns.bellaliant.net. [159.2.239.150]) by smtp.gmail.com with ESMTPSA id af79cd13be357-93f1a0d0718sm232558985a.5.2026.10.16.08.00.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Oct 2026 08:00:50 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1xHjQP-00000001teG-31SO; Fri, 16 Oct 2026 12:00:49 -0300 Date: Fri, 16 Oct 2026 12:00:49 -0300 From: Jason Gunthorpe To: Gong Shuai Cc: alex@ghiti.fr, andrew.jones@oss.qualcomm.com, anup@brainfault.org, aou@eecs.berkeley.edu, atish.patra@linux.dev, fangyu.yu@linux.alibaba.com, gsh517025@gmail.com, iommu@lists.linux.dev, joro@8bytes.org, kevin.tian@intel.com, kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, palmer@dabbelt.com, pbonzini@redhat.com, pjw@kernel.org, robin.murphy@arm.com, seanjc@google.com, tomasz.jeznach@linux.dev, will@kernel.org, wu.fei9@sanechips.com.cn, zhao.qingye@sanechips.com.cn Subject: Re: [RFC PATCH 02/12] iommufd: Add RISC-V IOMMU hwpt and vIOMMU types Message-ID: <20261016150049.GG14213@ziepe.ca> References: <20261015235400.GZ14213@ziepe.ca> <20261016073020.10119-1-gong.shuai@sanechips.com.cn> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20261016073020.10119-1-gong.shuai@sanechips.com.cn> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261016_080053_350327_E661E0DB X-CRM114-Status: GOOD ( 12.38 ) X-BeenThere: kvm-riscv@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: "kvm-riscv" Errors-To: kvm-riscv-bounces+kvm-riscv=archiver.kernel.org@lists.infradead.org On Fri, Oct 16, 2026 at 03:30:20PM +0800, Gong Shuai wrote: > Hi Jason, > > Thank you for your review. > > > > +/** > > > + * struct iommu_hwpt_riscv - RISC-V IOMMU stage-1 page table data > > > + * (IOMMU_HWPT_DATA_RISCV_S1) > > > + * @tc: Guest device context translation control > > > + * @iosatp: Guest device context stage-1 root page table pointer > > > + */ > > > +struct iommu_hwpt_riscv { > > > + __aligned_u64 tc; > > > + __aligned_u64 iosatp; > > > +}; > > > > Like the others you need a spec reference explaining exactly what > > these fields are. > > I'll add references to the device-context sections of the RISC-V IOMMU > specification ("Leaf DDT entry", "Device-context fields", "Translation > control (tc)", and "First-Stage context (fsc)"), and I'll also include > detailed field information, as ARM does. > > Also, I'll rename the field from iosatp to fsc. It holds iosatp when > PDTV=0 and process-directory-table pointer (pdtp) when PDTV=1, and the > two share the same layout, so the name should cover both interpretations > and the uAPI won't need to change when Process-Directory-Table (PDT) > support is added. You might be better off just to have a data[] array of the device context. I prefer the fields are not parsed out in userspace.. Future specs may add more guest controlled bits and in other places? Jason -- kvm-riscv mailing list kvm-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kvm-riscv