From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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 03DBECA4E for ; Wed, 29 Apr 2026 12:18:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777465105; cv=none; b=it4Glt1ryKgaznx3y5cLRqduCNTcEsBiKM02esDESRIIbCK84CjFrYyCvHNBR/xFBBm9+Vvmz2UJE5X0+n0R9jMOiGUwaPXRb4N4hs+2stdy/JEEn6GfnybwKm2CWWx6rt7Qj70Ss0E90lDIytN/kBeoPD5RLtwFmpOq2TPFGXA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777465105; c=relaxed/simple; bh=wJQo8cWyxesgPH1j4degVgR5bsBDIIyoMutFduCoUzg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=O5r8dvlzTEdWd0D+FuNVjCeQtG6TYZtVsKY170BcI6qxJU2Eigi2kNSjBZXiwzI5/C9GfThEph+Lp22ov+7+ziB1+uYRK9TqARsiLebjrn3J8/MLy5A8UwmiTp2szMQKP62L07VmiNBLNGlVOvxX6DWCjU13i42Q75AaDO7EiIA= 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=l5C4MtY4; arc=none smtp.client-ip=209.85.222.180 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="l5C4MtY4" Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-8ee63e91acfso743511785a.2 for ; Wed, 29 Apr 2026 05:18:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1777465102; x=1778069902; 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=MPHSzoCIyDIC9QP5+spsNloO0c/6uT0t+rTHSV9tUV0=; b=l5C4MtY49v1HQivBmv3TSqtU1cgZcvPUfJWXPLnlLxlM7u8yfy8jdzthDJfGa5UNxv Z8/Lny/gmlRMZ9Mxjn3SyeM/dT6N0NlBDdNUdI0BrWb3BM+/IbBZORcyPhDD2mvs67xb ebRia/MW3KP1DzXQKXwPh+C67LoXu0fE9LML6WXonN6KskLXoOh9iX6I+1aD7soggGAI 1aKLqm+dcpB3PP1o6IYsVsk0SaoB0iMO6BQrSfpo7kGnfA025r97mnCKZVqCayZXZxaL ZjswJ25zwOWnlMHnYm9FTMSvwfpEDdU2u7whjzo0HkL7d8E6NtRvc9M0ejuxfzIxqZUk qJFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777465102; x=1778069902; 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=MPHSzoCIyDIC9QP5+spsNloO0c/6uT0t+rTHSV9tUV0=; b=R2bKSfGUdqMWsPVqqTlh03jVg0Vw5LR3wQiPMwaVlH+Vtz6TUMf1zm0RvZnrU7ZxWo cLYD+BZ3xT45u+ArVNj4Rne/ODsOhOSZOhn8Rq7PuJjBePW7YjykVc6Svbu0/b5Z3dp3 i56rFdCTQdlle7C5/mAsGRO1vkCMY7su3D3aQX09uJz44yRjJITTfHCczBlD86qZ2JPZ tlVtbrsrvxPlQFWqKwzMvrQ3TSfVbHcqEc4uVsX1g3rqGPhRW7z+6yM8vp1HsOKPBOK2 DwiMSJDrckMWBtC5EOvJWjdwQ88yai8ZHobW82Ptm1HoNyIlB1zfBEXBBMYh1W9L0Oy2 +Akg== X-Forwarded-Encrypted: i=1; AFNElJ/EifS6Kn7WF/dKw7bvqahgySGwEFnBRFnM1CmhRRDwHEsMfRM8X1muhvzdQ5SArt4gAajDxhMn2IUaMlU=@vger.kernel.org X-Gm-Message-State: AOJu0YyyFlxb3Xnkumi4XRduVycDhsfohBQTvgeyb6kBlFKLrEMmPygd oFebOspThP09ctus0mfvnY0ifqTWq9qPixMtcckpxTtcKLSaIuTDhzGvNBJzbykz8EE= X-Gm-Gg: AeBDiesUhPahBam5vGzF/NnhF8RkyNpKpAff+pE2KGr1C2BESjtKD5/q1bXPUV/KWm1 aQ0j4rpOK+lCcEG+YZqsQe7tjnyENo3trZ0oPt5/XLFFtXnXVcaAcwcPYZfIcYT+5WuV+VZwOrL 6IWoUarJNM+aSf8Pj/HbEiUe4ayik6NSH3IZKCzEDcCfeaZEJlILX4ooxzB+ST4Wunstp2FF9Iz 8Vvsiv6v5BWj/U86zj0gBnHIE3NssdparaUnmwrE0GxZX+vb5xK2nln7XiGb1OSSyvNzLzKBiLa GrvuX7wGmdsHRBCWq14040BdA7Rki93fYOzoBnaaguFnn9x6JEgo2jKQhrtmKaktri9VvoYYj09 SvZyeEY8neoyEKf0z2dd/VmAWul6fxvhmMhkl8iKlvhNLFG4wh5ODIa/HvBfSM72zdu6oqlICZ0 oVW/PbtGRvK548GWKsYSXzkhe05N+CnOI5PQ7Sm65bMN3c7e00gOCMkwvQtE4s9piM7LdXUp79D MTMuUBIVzUabI5p X-Received: by 2002:a05:620a:4481:b0:8cf:df8b:1e5e with SMTP id af79cd13be357-8f8f3534220mr552478185a.5.1777465101412; Wed, 29 Apr 2026 05:18:21 -0700 (PDT) Received: from ziepe.ca (crbknf0213w-47-54-130-67.pppoe-dynamic.high-speed.nl.bellaliant.net. [47.54.130.67]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8f940051f0bsm152785185a.40.2026.04.29.05.18.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Apr 2026 05:18:20 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wI3rw-0000000HF8A-18yU; Wed, 29 Apr 2026 09:18:20 -0300 Date: Wed, 29 Apr 2026 09:18:20 -0300 From: Jason Gunthorpe To: fangyu.yu@linux.alibaba.com Cc: alex@ghiti.fr, anup@brainfault.org, aou@eecs.berkeley.edu, atish.patra@linux.dev, baolu.lu@linux.intel.com, guoren@kernel.org, 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, pjw@kernel.org, robin.murphy@arm.com, skhawaja@google.com, tjeznach@rivosinc.com, vasant.hegde@amd.com, will@kernel.org Subject: Re: Re: [RFC PATCH 01/11] iommupt: Add RISC-V Second-stage (iohgatp) page table support Message-ID: <20260429121820.GL849557@ziepe.ca> References: <20260428133239.GC849557@ziepe.ca> <20260429010650.61646-1-fangyu.yu@linux.alibaba.com> 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: <20260429010650.61646-1-fangyu.yu@linux.alibaba.com> On Wed, Apr 29, 2026 at 09:06:50AM +0800, fangyu.yu@linux.alibaba.com wrote: > >> @@ -263,6 +281,22 @@ riscvpt_iommu_fmt_init(struct pt_iommu_riscv_64 *iommu_table, > >> case 57: > >> pt_top_set_level(&table->common, 4); > >> break; > >> + /* > >> + * Second-stage (iohgatp): Sv39x4 / Sv48x4 / Sv57x4. > >> + * The top level is the same as for the first-stage counterpart. > >> + */ > >> + case 41: > >> + pt_top_set_level(&table->common, 2); > >> + table->second_stage = true; > >> + break; > > > >Second stage needs to be an explicit PT_FEAT not implicitly deduced > >based on the vasz. > > Agreed. I will add an explicit PT_FEAT_RISCV_SECOND_STAGE flag and > stop deriving second-stage semantics from vasz. PT_FEAT_RISCV_S2 would match what I have for ARM Jason