From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 977D01FAC42 for ; Fri, 12 Dec 2025 16:07:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765555639; cv=none; b=k32oLwbPagzbDpUJ820WhCftYyuNtSUjdD3csBLizmT66F8NQ9G4FO+UsoKo0ew3j5HEL5mUhPgqJTkIk1hHmT1kJ90v6FNPSKJHAJo9P/bJiVtkHqcF06WNH8an5BqRufcPZhuPajJqcvFmy6MuQHb3/0n/wu+UQAEND0juFeA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765555639; c=relaxed/simple; bh=CadN1clJTjA4RMo1uLhmMUV7CPVXKBuCrjugsR4QrFI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Q3mKjKK4D8WOCoxQKeN5ponKLZM048VylW4WjjY7AnR+LhNpZVaq36jjin34nYLrDgsmQC1Bk9Jhxj9LDSsgof9qX7YVllgScDt8CsQSnYToBGM+aiDXBF0M0vIcAj68uiOJrOqbdcmENCph+6PGPXByfBYG5TpZtu0Dg9N5rZk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=mwaH1+eP; arc=none smtp.client-ip=209.85.128.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="mwaH1+eP" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4779a4fb9bfso130625e9.0 for ; Fri, 12 Dec 2025 08:07:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1765555636; x=1766160436; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=j/MUKGMtq/AZXEzw4+AUVbVepsRjCX4PBUc6yHK/8Wg=; b=mwaH1+eP6YypatHOGdHoibfy0N4WMPTQLaBsWJ0X9fWDqNKAeeIaBYHxYVyj/pmhPo Wvj+vTyAf00AYFUuR67vpHYPW05NrDUmfalZLjT6UlDOFPC24hJviG7WWGzSNOLG+7Fr MCkw04qUguK/xRkLSsT34CAzlsQKCsbC0990/axeVH6eS3HqkvtsoXWkLSbG7uE6QzoF r1RyabBLLYv/FnNYwp5Al8arj1pemrVYfwXf0MsmkpCrkNFfo/Wmg8+r+DUXfnx8BWFF 4V09WYEFKEn9d+zUBDf0miFFYfdSy2u54b8ablDGo4VwnDYTDfrlD9bgGgolNXGCHkFh q5lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765555636; x=1766160436; h=in-reply-to:content-transfer-encoding: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=j/MUKGMtq/AZXEzw4+AUVbVepsRjCX4PBUc6yHK/8Wg=; b=HkadoWEW8EbC4SIVPmotJuiq5FxDCZ00M5JTPRMLNuCKXRvNfPHT1psC5qzw6ktfJD Nf9id2PdM2NRA8Bpmaau650ladR06tcOd3igxpwCf2AQbwm0VG2dxN+RJzD1odV0s4q6 w6iXOEM8rVeJp8PIQXak47zVJBnR1r0bR8ns7OehcZy7kZGvVvwG5A6AiOwiG9Leg7ct fN/zZrrEntnyxcP49c8pvJSBa+NMqqVvcaN5YpVFVFSpJ48Kj8l20Q7DWR5C+IJKnqnL 2HIf3Mywr4YLVOjrOmbJxc4JQT2ob4nWDPpj7qMw85rtFtXyrYMsqyRlKWJJtQMTKCq3 abLg== X-Forwarded-Encrypted: i=1; AJvYcCUDdm/kP9+gXy2RQyiWLDJ6wFxzEuIEFVkzfSGoCCyulM3LpvS+ANv1/aa0NKKBxJGx0FRBXg3Yq1A5uRM=@vger.kernel.org X-Gm-Message-State: AOJu0YxM98//ofcHrwOst14YfWGkvfPqEO7UCJ++RWQ825Wn7iWgexUU wKfz10iWqNXIIXzWo532Kx2seLICyomr43sxR3rkPikOMc2152pCsTIkVY2Ku18ud4QojfwBiiW G4nnpLw== X-Gm-Gg: AY/fxX7bcYIqomDThKFAhkYnbOZc+RS7Rqd71PKrV6ORSt826DPH6DApLvjP5UMp6Ml KKDUfpiGEFIj7dtnmwKZXyDDp/XxvTcxtRkaAzGWpAdFPqlcBhi2/3jn0sTossps+CstKZKhZbS rm+KrL8u/AGgeNl39/CtrPU6lIetn9Uyw+ZpaK3GjLopLsLquQGaQL/039sjw10etUkQmfCOWEE TETwrYQi9V57AuTWUJs6FP7s1b4sKnNnMPAsil0oy2K5jHOgeJoCOVkiC6qHerC0fDaaeq/P1sC X27IDhqSQK4OZBXq4VLc/1Ywir/sL3O4cnLPTSWcx9OGgiyvrcS1xlG4lBmhZH136l7u/o5iKCo W+Ijqvxz5SK2hZFNOUKRRrN8esOhFoPm9Qe2G23KsVu5EeBBrI85+h/FwBudEk2zUbqgWT9vJfQ JTARnVXcs1d58HyJlcgRl/5jdaCHIDYXsmslKKfiKUzU+8wRV5OQ== X-Google-Smtp-Source: AGHT+IEIDx819rvyhX5iStRqL6toam/KgB5ggWiYCL8nDHKAqrNj8ytrnyVKvwTwKQ6ON9JUhN4seg== X-Received: by 2002:a05:600c:4a19:b0:477:b358:c0cc with SMTP id 5b1f17b1804b1-47a8981f631mr1202285e9.17.1765555635793; Fri, 12 Dec 2025 08:07:15 -0800 (PST) Received: from google.com (54.140.140.34.bc.googleusercontent.com. [34.140.140.54]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-42fb68866f3sm3708879f8f.36.2025.12.12.08.07.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Dec 2025 08:07:15 -0800 (PST) Date: Fri, 12 Dec 2025 16:07:11 +0000 From: Mostafa Saleh To: Jason Gunthorpe Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvmarm@lists.linux.dev, iommu@lists.linux.dev, catalin.marinas@arm.com, will@kernel.org, maz@kernel.org, oliver.upton@linux.dev, joey.gouly@arm.com, suzuki.poulose@arm.com, yuzenghui@huawei.com, joro@8bytes.org, jean-philippe@linaro.org, praan@google.com, danielmentz@google.com, mark.rutland@arm.com, qperret@google.com, tabba@google.com Subject: Re: [PATCH v5 17/27] iommu/arm-smmu-v3-kvm: Probe SMMU HW Message-ID: References: <20251117184815.1027271-1-smostafa@google.com> <20251117184815.1027271-18-smostafa@google.com> <20251128170748.GE812105@ziepe.ca> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20251128170748.GE812105@ziepe.ca> On Fri, Nov 28, 2025 at 01:07:48PM -0400, Jason Gunthorpe wrote: > On Mon, Nov 17, 2025 at 06:48:04PM +0000, Mostafa Saleh wrote: > > > +/* > > + * Mini-probe and validation for the hypervisor. > > + */ > > +static int smmu_probe(struct hyp_arm_smmu_v3_device *smmu) > > +{ > > + u32 reg; > > + > > + /* IDR0 */ > > + reg = readl_relaxed(smmu->base + ARM_SMMU_IDR0); > > + smmu->features = smmu_idr0_features(reg); > > + > > + /* > > + * Some MMU600 and MMU700 have errata that prevent them from using nesting, > > + * not sure how can we identify those, so it's recommended not to enable this > > + * drivers on such systems. > > + * And preventing any of those will be too restrictive > > + */ > > This driver is doing nesting though ?? > > Shouldn't you detect those IPs and not support a S1 at all so there is > no nesting? Identity only? I can see that the errarta are fixed in r1p1, and from the MMU-700 TRM, we can extract this information from IIDR[1], I guess we can allow nesting for all SMMUs except the one affected. Actually we can do that at the moment from the main driver too, I can prepare a patch for that. However nesting is still mandatroy, the fallback path for the KVM driver if nesting is not supported (just S2 for example) is to fail and let the upstream driver probe the platform devices with KVM out of the picture. The main reason for this is that the KVM driver relies on CFGI to know which SIDs to configure, for s2 only cases there won’t be trap and emulate as the hypervisor would be take control of all the SMMUs (as v3 of this series which requires HVCs) It might be useful to support only S2 SMMUs, but I’d like to keep this series simple and then we can build on top of it. [1] https://developer.arm.com/documentation/101542/0001/Functional-description/Constraints-and-limitations-of-use/SMMUv3-implementation Thanks, Mostafa > > Jason