From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (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 2F0F21EA7DB for ; Wed, 3 Jun 2026 01:01:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780448478; cv=none; b=WeHcw57GOqSiH8tsAz0i9ASoMTMD4du8b5xxpV+yKZd9LnAVfDd3SxE+Gch4QWOOSYwsHdHSBlJTkl5Zd72BMUGaRBVO5j7cP9LMC4Sx92wnYyW1tOaNuYuJhj+w9UYNF/qf3RvqTXWkTUa1+pAszb7Bfv1//rLNXZ77ZA/Wg/0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780448478; c=relaxed/simple; bh=UI/i7a3o2twKZmU9gVBMd/iTOYSldALT0tkSLrczf58=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=kMTCKKqeHqQ7Cev/8kCNDuKldS/9iMzTVaIcWMcleigoVmwsJyumNhGRXfrQLJqxMVo/YNRWLgo43g73iSVC6LIUE+TN/n04uF0SUz1H1Pb+OgtfATNVhvdexVwUuvmLWor/8UKoqtbTe5UtYnaeTdI+Sr2CfWXKP0JZdyIUAk4= 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=TEE3SSjd; arc=none smtp.client-ip=209.85.222.171 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="TEE3SSjd" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-915660e5b8eso329608085a.3 for ; Tue, 02 Jun 2026 18:01:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1780448476; x=1781053276; 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=AkdC3dWZFs3uTmguQZS1ztKpgkqPeW1kWupRwLRFJ1I=; b=TEE3SSjdaOKT3qKoSZziF9lfHb7uvUwFRVZJ+tPid0PloYtwPLECjHqyLvaE4pSOhF sBSuMq2nQJnYsxxRJySw7Mt0X0tzKEPpd/u6jBGEdO7XEvIa/FmyhLJCFfilV6M2BPWL DhxfFMGHWxtmzfIc0LOLyfC3oe8TAddwqfUfXJFZnK396ViZHtZlKIRhO6eoMbb3nY// YgK9RoFwmqpYKqd/6GJ/HH1nJKLz6dwHuoaRyqG1f4Tdd45zRFywQT4CGLckmVKiMdg3 jOfBq7t1nPYPs9vTB/F4tkDrH3xtVzdZYVqS64BibvtQM7XUGqn+wAnfp3kqLZs1tYxK yyoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780448476; x=1781053276; 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=AkdC3dWZFs3uTmguQZS1ztKpgkqPeW1kWupRwLRFJ1I=; b=RSEydw7geY7CAUZmSUOG+DiQ04sLqleDB31vwyHhAvaiffOlUOkfNuEVCXpYbJ6mrv RAk2sxQmgwmJhiqkcAR6QWMoSZmyb7xPrIwUqjt5aiKk3Lj4IQ+2dkG4WvzFwv/7mcPs F0YfkpowvrD0z4fjmaMre0gxWUl3hCfy3vIiuHtsUUm0HKHnYx86+j8yJMg1yQUXPtTY CPPb6+jyQeX7EnI7OPMdQjmhDD8WZDhH40cNNucmMXsJWgsbphY9X/jd1viUQQ8GBpto KGP48OdnB/A12bM+BvxjGGM1HbWMYNwVNmlpuNxcPm8hQPKVd7XxjRgWn2VjfwMJC5Fx Fl8g== X-Forwarded-Encrypted: i=1; AFNElJ/jdDPimyLD4Hszh4HFyTD9FYfB5uJLE3T7oKreQAgKG/0bvPjqy8YAYtqzPNlO89gZNJrMFEGhM6JJVSs=@vger.kernel.org X-Gm-Message-State: AOJu0YzQIpMPmLw08+Ol9AvL4B9otRFstlUud+MTXCXAnZWoVAgFFFp3 +cVzCfShgHMgp41hlnlTBXiUmPFL5jzbq9/DQ4ZyIjXLKC3IPwhqJO1iWqn2Y+1Qdyc= X-Gm-Gg: Acq92OGRfcc1mPLVPrpl54xuCQHZiwJR3bzA4RMohyTcaRue1ac3gsol6TDFRv4kebC 7gLhAuhmMj+f1n6mqp0+0KjW7Th3sRhoCqWxg0Wpe5XJVUFlHX1osgoiIXE3126UoDWXnKi7L3S Ey5TzRXr5Rtbw1BE6nAOH/Ar0cQkBUIVfbugbWBfAVQUQtRa0q6hjsjQ1mkACiGMeZfgWFCMSGQ jylJlSi6Hr4UZLJEa+RtPqpoJ3c08gl6W9ALG5H4DxKGSWhBBoG+ay1Exnc5yB2KOZwx8A4yHw1 to5qXha7Ha4OvMH6m5FKxVAsaF2Gk0YEgRDxlZhR4QQ919VkXU56tlAV1Bem8jcoC094i2Cemmh XJfsRqvADkTSJsqVsCAMTihU4V2O0sDJQSikh9IHoeyxqUMmtpdX9tDQes8jPjDH0gbmkOj2uNP Z7cUC5I09YOHkwy+SEAAJ+31rEVXmBcfHsE1InwByhTG9e1UFrH5jqIxfULMoOED14sN6M7Olci 5YTVKT1C+BoqJjvWh+SNeyHayo= X-Received: by 2002:a05:620a:21c5:b0:915:6c4b:eb60 with SMTP id af79cd13be357-9158a7b6304mr201153885a.29.1780448476209; Tue, 02 Jun 2026 18:01:16 -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-9158a00afbcsm101995885a.9.2026.06.02.18.01.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 18:01:15 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wUZys-00000004xXc-0zdZ; Tue, 02 Jun 2026 22:01:14 -0300 Date: Tue, 2 Jun 2026 22:01:14 -0300 From: Jason Gunthorpe To: Will Deacon Cc: Ashish Mhetre , robin.murphy@arm.com, joro@8bytes.org, nicolinc@nvidia.com, linux-arm-kernel@lists.infradead.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org Subject: Re: [PATCH v3 3/3] iommu/arm-smmu-v3: Issue CFGI/TLBI twice on Tegra264 Message-ID: <20260603010114.GO2487554@ziepe.ca> References: <20260601104845.995005-1-amhetre@nvidia.com> <20260601104845.995005-4-amhetre@nvidia.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: On Tue, Jun 02, 2026 at 09:22:15PM +0100, Will Deacon wrote: > > + /* > > + * On Tegra264 (see ARM_SMMU_OPT_TLBI_TWICE) re-issue the same > > + * cmdlist with another CMD_SYNC to satisfy the erratum. > > + * Callers must ensure the batch carries a uniform opcode class > > + * so that checking the first command is enough; the iommufd > > + * VSMMU path enforces this with arm_vsmmu_can_batch_cmd(). > > + */ > > + if (!ret && sync && arm_smmu_cmd_needs_tlbi_twice(smmu, &cmds[0])) > > Can you move the arm_smmu_cmd_... part to the start of the conjunction, > please? If you make it a static key as I mentioned previously, then > hopefully that should mean everything else is moved out of line. > > > + ret = __arm_smmu_cmdq_issue_cmdlist(smmu, cmdq, cmds, n, sync); > > Sashiko is also unhappy here if n == 0 because we probably shouldn't > be inspecting the command array in that case. That seems like an AI mistake though, we shouldn't actually ever pass in 0 sized batches? 'zero streams' should fail probe, not get into this code, that might be missing but I wouldn't add checks here.. Jason